-
-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Name table entries contain null bytes #74
Comments
Until Pomax/lib-font#74 is fixed
this feels like it's because of the mac/microsoft string difference... we'd need to check which format the name record uses, and compensate for the two-byte string format that either the mac or windows platforms use. I forget which of the two was short and which was long off hand, but that should be something we can solve on the line you highlighted, by consoluting the record's platform/encoding |
Do you have a test font we can use to debug this one? |
Windows platform name strings are UTF-16 encoded, aren’t they? |
I couldn't remember which of the two was an 8 bit ansi-like and which was utf16, but yes. |
landed in https://github.com/Pomax/Font.js/blob/master/src/opentype/tables/simple/name.js#L51-L92 as unicode parsing for platforms 0 and 3, and "ascii" byte parsing for everything else. That's certainly not perfect, but I'll be filing a followup issue around line 91:
|
If my text is "Wakamai Fondue rules!",
font.opentype.tables.name.get(19)
will return:I could filter them out here but I guess there is a neater solution, probably involving getting the data at the right amount of bits?
The text was updated successfully, but these errors were encountered: