How to get the font's index in font file?

I'm working on port a application from Linux to macOS, and it need to know current font's index in ttc/otc file.


On Linux, it use fontconfig's FC_Index property to get it.


On macOS, I can use Core Text API to get the CTFontDescriptor or CTFont struct from font's full name, but seems non of them provide the index attribute.


Any advices?

Replies

Apple platforms use a font’s PostScript name as the primary identifier, not the TTC index.