Hi,
I would like to know if it would be possible to share me the algorithm how CoreText pick the the family name, full name, etc in the naming table https://docs.microsoft.com/en-us/typography/opentype/spec/name#name-ids for TrueType and OpenType Font.
If this can help you understand what kind of information I am looking for, here is FontConfig algorithm:
- Sort naming table in ASC in this platformID, nameID, platEncID, isEnglish(), langID
- isEnglish() is a method that return True if the name = {platformID: 1, langID: 0} or {platformID: 3, langID: 0x409}
- Split the naming table in table that only contain one type of platformID.
- Finally, search nameID the user want in that order: MICROSOFT, APPLE, MACINTOSH, ISO and that the first match.
Or, if you prefer code example, here is FontConfig algorithm in python: https://github.com/moi15moi/fonttools/blob/add-strategy-naming-table/Lib/fontTools/ttLib/tables/sortNamesStrategy/FontConfigStrategy.py
Why do I want to know that? I would like to implement the way the way CoreText picks up the name in fonttools. Here is where I discuss about it: https://github.com/fonttools/fonttools/pull/2636
Thank you