I encountered some issues loading physical fonts from file on my system,
resulting in FontFormatException: Font name not found.

I traced these back to sun.font.TrueTypeFont#initNames(), which takes a
rather strict approach to populating the familyName and fullName fields for
a Font instance, both of which are required to be non-null in the init()
method. Notably, initNames() ignores any name records with a platform ID
other than Microsoft (MS_PLATFORM_ID).  This makes any font file that only
contains Mac OS name records unloadable.

Two possible (complimentary) fixes:

   1. Inspect name records for platforms other than Microsoft.
   2. Generate default names (based on file name, user-supplied, etc.) when
   a valid name record cannot be found

Thoughts?

Cheers,
nate

Reply via email to