首页 > 解决方案 > 如何通过 AutoCAD Plot API 在 Forge 设计自动化中使用用户定义的字体

问题描述

我们正在使用 Forge Plot API 将 DWG 绘制为 PDF/JPG。一位客户提出了使用名为 ROBBI.TTF 的特殊 TTF 字体的 DWG。我想这个字体必须先上传到 Forge 服务器才能使用。是否可以一次上传字体,以便我们所有的绘图工作都可以使用它?如果不是:使用自定义 TTF 字体进行绘图的最佳方法是什么?

标签: plotfontsautodesk-forgetruetypeautodesk-designautomation

解决方案


Thomas,是的,您可以将自定义字体包装在 Contents 文件夹下的 apppackage 包中,并引用SupportPath属性的路径。

<Components>
    <RuntimeRequirements
        OS="Win64"
        Platform="AutoCAD" 
        SupportPath="./Contents/"/>
    <ComponentEntry
        AppName="CustomPlotter"
        ModuleName="./Contents/PlotLayout.dll"
        AppDescription="AutoCAD.IO Reset Plot Layout"
        LoadOnCommandInvocation="True"
        LoadOnAutoCADStartup="False">
      <Commands GroupName="PlotLayoutCommands">
        <Command Global="FPDPLOT" Local="FPDPLOT"/>
      </Commands>
    </ComponentEntry>
  </Components>

推荐阅读