Do you own a Debenu Quick PDF Library 12/11/10/9/8/7? Upgrade to Debenu Quick PDF Library 13!

Foxit Quick PDF Library

Frequently Asked Question:

Return to FAQ Index

Font Naming error

Question

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

Answer

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.


© 2015 Debenu & Foxit. All rights reserved. AboutBuyContactBlogNewsletterSupportFAQProduct UpdatesForum