Arial Narrow Font/typeface no longer working

1753
2
Jump to solution
07-06-2022 12:30 PM
GregC
by
Emerging Contributor

I have an add-in that adds a text element to a layout.  Its font/typeface is Arial Narrow Bold.  About the same time we were updated to ArcGIS Pro 2.9.2, the 'Narrow' formatting for this particular element ceased working. Code with Arial Narrow Bold would output to Arial Bold.  Arial Narrow output to Arial.  Arial Narrow Bold Italic output to Arial Bold Italic.  It as if "Narrow" was just not recognized anymore.  

I could still change the font to Arial Narrow Bold in the formatting tab in Pro, but I can no longer do it programmatically.  I've checked the installed typefaces/fonts and they are on my system.

My code is below:

CIMTextSymbol textLine = SymbolFactory.Instance.ConstructTextSymbol(ColorFactory.Instance.CreateRGBColor(45,45,45), 8, "Arial", "Narrow Bold");

At one point I had working code that was written this way (below), but I updated it to the above code.  The issues seems to be independent of the change in code.

//Old
CIMTextSymbol textLine = SymbolFactory.Instance.ConstructTextSymbol(ColorFactory.Instance.CreateRGBColor(45,45,45), 8, "Arial Narrow", "Bold");
(note - I had to retype the code here - if there are typos they would not appear in the original code)

Any advice is much appreciated, thank you!

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
CharlesMacleod
Esri Regular Contributor

I think this is a bug. "Arial Narrow" is the correct font family w/ a style of "Bold". After the text symbol creation can u try this as a workaround?

CIMTextSymbol textLine = 
   SymbolFactory.Instance.ConstructTextSymbol(..,"Arial Narrow","Bold");
//workaround
textLine.FontFamilyName = "Arial Narrow";
//set style too if needed
textLine.FontStyleName = "Bold";

 

I tested on 3.0 (the latest) and it is working the same way it did as u refer to as "old"...i.e.:

CIMTextSymbol textLine = SymbolFactory.Instance.ConstructTextSymbol(..., 8, "Arial Narrow", "Bold");

View solution in original post

2 Replies
CharlesMacleod
Esri Regular Contributor

I think this is a bug. "Arial Narrow" is the correct font family w/ a style of "Bold". After the text symbol creation can u try this as a workaround?

CIMTextSymbol textLine = 
   SymbolFactory.Instance.ConstructTextSymbol(..,"Arial Narrow","Bold");
//workaround
textLine.FontFamilyName = "Arial Narrow";
//set style too if needed
textLine.FontStyleName = "Bold";

 

I tested on 3.0 (the latest) and it is working the same way it did as u refer to as "old"...i.e.:

CIMTextSymbol textLine = SymbolFactory.Instance.ConstructTextSymbol(..., 8, "Arial Narrow", "Bold");

GregC
by
Emerging Contributor

Thank you Charles!  Your solution works perfectly!

0 Kudos