[CoreText] Algorithm naming table

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

I doubt you can get access to the source code. It is not open source but Apple property. And you are forbidden to disassemble it.

And you are forbidden to disassemble it.

That's why I am asking. I don't want to do anything illegal.

I don't necessary want the code, only the algorithm/logic behind it. With it, I could support how CoreText detect what is the family name in a font.

If you are not familiar with the naming table, in brief, a table can contain more than 1 family name, but CoreText will choose one name in particularly. I would like to know how it choose it, so I can provide a good support with CoreText.

[CoreText] Algorithm naming table
 
 
Q