-
Notifications
You must be signed in to change notification settings - Fork 16
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
Clarify and extend behavior around names in the FontMetadata object #69
Comments
I don't think all of these are enhancement requests. E.g., the first and last bullet point need to be defined, no? |
Yeah, there's a reasonable argument to be made that those are spec defects that should be corrected. |
Updated the label, and suggestions for all of these concerns would be welcome.
|
For the last bullet, platform behavior seems to vary a lot. On Windows, the PostScript name isn't even always used for matching (it seems to depend on the font type; if the font isn't either Type 1, Type 42, CID Type 1, or CFF, it instead matches based on the full name). FreeType prefers Windows-formatted PostScript names over Mac-formatted ones; macOS supports both but appears to ignore a Windows name if a corresponding Mac name is available. I think Windows only supports Windows names but I'm not 100% certain. As a developer, the best thing the API could do for me would be to let me query fonts by passing a font-request object (name + possibly weight/slant + possibly string being rendered) to the OS that is searched for via whatever fast mechanism the system provides. Currently you mention linear searches, but OSs generally provide a faster lookup mechanism that doesn't require retrieving and iterating the full list (e.g. WinGDI uses a hash-table lookup). Note that on some platforms, the relevant API only returns a single font rather than a list (Android, WinGDI), thus the potential need to specify a weight/slant. Specifying a sample string being rendered can be critical if I'm performing fallback due to a missing glyph; the OS generally knows a suitable fallback font for every supported Unicode character range, and usually doesn't expose that mapping directly. If I want to do a slow-but-consistent linear search, I can implement that myself. |
I noticed a few shortcomings here; they can all be addressed by applications by parsing the SFNT directly, but it'd certainly be helpful to have some improvements made:
en
? What happens in cases involving multi-label IETF language tags?query({select})
and the metadata objects (even if it just ends up being implementation-defined).The text was updated successfully, but these errors were encountered: