Frequently Asked Question:
Font Naming error
Hello, Using the AddTrueTypeFontFromFile fonts loose their spacing between words. I.e "Times New" becomes "TimesNew" or "Mason Regular" becomes "MasonRegular". Any ideas how to fix?
Thanks
The PDF reference specifies that the names for TrueType fonts should not include any spaces, so when the AddTrueTypeFontFromFile function adds a font, it removes the spaces.
As a result "Times New Roman" becomes "TimesNewRoman" and "Times New Roman Bold" becomes "TimesNewRoman,Bold" and so on, as you have discovered.
If you to retrieve the list of fonts for viewing purposes only then you'll need to query the string for capitalized characters and insert a space before them.