-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 parsing is incorrect #16322
Comments
We should also probably fall back to using PostScript font names if name table is unavailable or unreadable. |
Such ancient encodings require a reference to https://learn.microsoft.com/en-us/dotnet/api/system.text.codepagesencodingprovider?view=net-8.0 To make this work we need some feature flag to enable support for older platforms |
We need to explicitly skip reading them and explicitly fall back to PS font name then. Right now we are simply ignoring the relevant encoding field. |
I think correctly parsing old fonts' name record is a troublesome job, they may use different encoding from name record. If you just want to get the correct language code when platformID=3, you can do a simple conversion, such as https://github.com/HinTak/Font-Validator/blob/aa6d6bc0f1b5eb257877a998f97dbb323f7ddabb/OTFontFile/Table_name.cs#L102 |
The thing is, we can't rely on all encodings to be available in the published app. So we still need to silently ignore the name table entries we can't decode properly. |
Describe the bug
Was looking at this PR and noticed that while LCIDs map nicely to platformID=3, we pretty much ignore other platform IDs. E. g. platformID = 1 has its own set of language codes.
While being generally safe to do when filtering language IDs we can't ignore the platformID when selecting the encoding here, since non-windows fonts have different encoding identifiers and it will cause exceptions.
@Gillibald
To Reproduce
Try loading some font with mac/unicode platform in its name table
Expected behavior
No response
Avalonia version
master
OS
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: