What characters do I have to expect when "consuming" font names and which ones should I avoid when "producing" font names? Are there differences between different operating systems, traditional desktop applications, mobile or web apps (->CSS) and different font formats like OpenType, TrueType, WOFF, PostScript, SVG etc.?
According to W3. Only ISO-10646 characters may be used in a valid font face name.
According to Adobe, PostScript fonts must not contain spaces and may only use characters from the standard ASCII character set. The name should also be no more than 29 characters long.
It is recommended to separate the font family name and the style definition using a hyphen and for optimization purposes to use both upper and lower case characters because some parsers work best when they are able to search for the first uppercase character followed by a lowercase character.
The standard names used in Macintosh font menus come from the name of the FOND resource associated with a Type 1 outline font. FOND resource names are technically allowed to be up to 31 characters, and may contain spaces but anything over 30 characters does not work due to a known bug.
In the Windows environment, font menu names are specified in the Printer Font Metrics (PFM) file and must be no greater than 31 characters; the same recommendation of limiting to 30 characters as in Macintosh exists.
Adobe’s naming convention is considered to be the industry-wide standard.
If your seeking a test have a look at this regression test: http://search.cpan.org/~mhosken/Font-TTF-1.05/lib/Font/TTF/Font.pm
Almost all the formats you list are versions of OpenType:
So it's really a question of "which naming format does OpenType allow", and "within that, which format is widest supported". Thankfully, the OpenType naming table specification has most of that information.
The important part is that you're not defining "one" family name, you define it several times, for different audiences. Have a look at the "Name IDs" section for the name table, and you'll see several fields all intended to house the font name, just for different contexts:
As a real world example, let's look at the name strings for Palatino Linotype:
In terms of platform differences, not every platform needs all these strings for the font to be installable, or usable. Hit up this SO question for more information on that. For webfonts, for instance, Name ID 1 is technically sufficient since the "role" the font plays is wholy determined by the @font-face
rule we give it, but for desktop applications IDs 2 through 5 matter a lot. And of course for postscript devices, ID 6 is critical, so Operating Systems tend to not recognise a font as "proper" without it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With