laptop and a wrench

漏洞

When updating the font name and style of an annotation feature class with an annotation cursor and CIM in ArcGIS Pro, in some cases it will update the map annotation style but not the associated fields in the annotation attribute table.

ArcGIS Pro
漏洞 ID 编号 BUG-000176087
已提交April 28, 2025
上次修改时间June 26, 2025
适用范围ArcGIS Pro
找到的版本3.4.2
操作系统Windows OS
操作系统版本11.0 64 bit
状态As Designed

附加信息

The fontFamilyName and fontStyleName CIM properties do not always match the ArcGIS Pro user interface due to the way ArcGIS Pro organizes font styles by common font family in the UI. When setting the fontFamilyName and fontStyleName properties programmatically, it's important to first confirm how the desired font and style are defined in the CIM. One way to do this is to configure a layer's label class to use the desired font and save the layer to a layer file (.lyrx extension). Then open the layer file in a text editor and search for the font name and examine how the font information is defined in the CIM. In addition to fontFamilyName and fontStyleName, variable fonts also require the fontVariationSettings property to be defined. https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm Sitka Small Bold is an example of a variable font that is represented differently in the ArcGIS Pro UI vs the CIM definition. ArcGIS Pro lists this font with Font Name = "Sitka" and Font Style = "Small Bold", along with 2 variable font settings: OpticalSize=6 and Weight=700. Here is how this looks in the CIM definition:

"fontFamilyName" : "Sitka Text",
"fontStyleName" : "Regular",
"fontType" : "TTOpenType",
"fontVariationSettings" : [
  {
    "type" : "CIMFontVariation",
    "tagName" : "opsz",
    "value" : 6
  },
  {
    "type" : "CIMFontVariation",
    "tagName" : "wght",
    "value" : 700
  }
]

With this information, a script that sets this font style should use "Sitka Text" as the fontFamilyName, "Regular" as the fontStyleName, and include the fontVariationSettings information. Python example:

myTextSymbol.fontFamilyName = Sitka Text"
myTextSymbol.fontStyleName = "Regular"
myTextSymbol.fontVariationSettings = [ {"tagName" : "opsz", "value" : 6}, {"tagName" : "wght", "value" : 700} ]

重现步骤

漏洞 ID: BUG-000176087

软件:

  • ArcGIS Pro

当漏洞状态发生变化时获得通知

下载 Esri 支持应用程序

发现关于本主题的更多内容

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项