Autodesk forge 如何在Inventor Design Automation中使用自定义字体

Autodesk forge 如何在Inventor Design Automation中使用自定义字体,autodesk-forge,autodesk-designautomation,Autodesk Forge,Autodesk Designautomation,我试图在生成pdf时使用带有设计自动化的自定义字体。根据这个Stackoverflow问题的答案,我将字体文件放在捆绑包的Contents文件夹中,并将PackageContents.xml更改为引用支持路径,但我仍然收到来自forge的警告 Inventor内部xml: 我错过了什么吗?我刚刚写了一篇关于这一点的博文: 底线是,您可以使用System.Drawing.Text.PrivateFontCollection,以便在打开绘图之前加载您的自定义字体,这将使工作正常: public vo

我试图在生成pdf时使用带有设计自动化的自定义字体。根据这个Stackoverflow问题的答案,我将字体文件放在捆绑包的Contents文件夹中,并将PackageContents.xml更改为引用支持路径,但我仍然收到来自forge的警告
Inventor内部xml:


我错过了什么吗?

我刚刚写了一篇关于这一点的博文:

底线是,您可以使用System.Drawing.Text.PrivateFontCollection,以便在打开绘图之前加载您的自定义字体,这将使工作正常:

public void RunWithArguments(Document doc, NameValueMap map)
{
  LogTrace("RunWithArguments called with v7");

  string bundlePath = map.Item["_1"] as string;
  string contents = System.IO.Path.Combine(bundlePath, @"DaSamplePlugin.bundle\Contents");

  string dwgPath = IO.Path.Combine(contents, "AssetLibraryTest", "CustomFontTest.dwg");
  string fontPath = IO.Path.Combine(contents, "AssetLibraryTest", "DancingScript-Regular.ttf");

  PrivateFontCollection pfc = new PrivateFontCollection();
  pfc.AddFontFile(fontPath);

  doc = inventorApplication.Documents.Open(dwgPath, false);

  doc.SaveAs("result.pdf", true);
}