Font Tables 'name' with attribute unicode: True... Where is this field documented?
MelanieBerkley
Posts: 1
Hiya folks!
I'm looking at the 'name' table for OTF/TTF fonts and I've come across a particular attribute that I can't find any reference to.
Here's an example 'namerecord' (Copyright, Macintosh platform, Roman script, English language)
But what is this
Any help on understanding this attribute would be great, even a lead to more documentation would be fantastic. I'm not sure how I should handle this attribute while programmatically manipulating fonts, and wouldn't want to cause any downstream side effects by incorrectly handling this particular field.
Thanks
Melanie
NOTE: I've used fontools ttx program to pull this attribute out. (https://fonttools.readthedocs.io/en/latest/ttx.html)
I'm looking at the 'name' table for OTF/TTF fonts and I've come across a particular attribute that I can't find any reference to.
Here's an example 'namerecord' (Copyright, Macintosh platform, Roman script, English language)
{'nameID': '0', 'platformID': '1', 'platEncID': '0', 'langID': '0x0', 'unicode': 'True'}
But what is this
'unicode': 'True'
attribute doing there? From what I understand of the specification, Unicode has it's own platform ID (0), so why wouldn't this be used instead of adding an attribute of 'unicode': 'True'
? If this attribute is permitted here, what is it's function, exactly? Furthermore, I can't find any reference to this additional attribute in either Microsoft nor Apple specification references. Any help on understanding this attribute would be great, even a lead to more documentation would be fantastic. I'm not sure how I should handle this attribute while programmatically manipulating fonts, and wouldn't want to cause any downstream side effects by incorrectly handling this particular field.
Thanks
Melanie
NOTE: I've used fontools ttx program to pull this attribute out. (https://fonttools.readthedocs.io/en/latest/ttx.html)
Reference documentation:
0
Comments
-
I think the unicode=True attribute is just a hint for the ttx compiler that the input file (the ttx file itself) is in Unicode encoding.1
-
To add to that: The information in the name entry is stored in binary in the font, so its meaning is interpreted by applying an encoding to it. The byte 01010010 can have different meaning depending on what encoding you use to decode it. If the name is not encoded in unicode encoding internally, it is assumed that it is encoded in the specific platform's encoding. See for example this comment in the fonttools source code for the name table. So this is, like you suspected, a ttx specific attribute, not opentype specific information.
0 -
MelanieBerkley said:
Here's an example 'namerecord' (Copyright, Macintosh platform, Roman script, English language){'nameID': '0', 'platformID': '1', 'platEncID': '0', 'langID': '0x0', 'unicode': 'True'}
A name record, as stored in the font file, has six fields:
* platformID
* encodingID
* languageID
* nameID
* length
* offset
Evidently the information shown above is reported by some tool or utility. You should consult with the maker of that software to find out the intent.
In that example, the platformID is 1, which is the "Macintosh" platform; and the (platform-specific) encodingID is 0, which for the Macintosh platform means "Roman" — i.e., the legacy MacRoman encoding. It's possible a tool is extracting names from the font and outputting them in Unicode encoding. But the string data stored in the font would not be encoded in Unicode.0
Categories
- All Categories
- 43 Introductions
- 3.7K Typeface Design
- 803 Font Technology
- 1K Technique and Theory
- 622 Type Business
- 444 Type Design Critiques
- 542 Type Design Software
- 30 Punchcutting
- 136 Lettering and Calligraphy
- 83 Technique and Theory
- 53 Lettering Critiques
- 485 Typography
- 303 History of Typography
- 114 Education
- 68 Resources
- 499 Announcements
- 80 Events
- 105 Job Postings
- 148 Type Releases
- 165 Miscellaneous News
- 270 About TypeDrawers
- 53 TypeDrawers Announcements
- 116 Suggestions and Bug Reports