Is there a way to find if the font is a TrueType/OpenType

Hi, ALL,

Is there a way to find if the font is TrueType/OpenType font?


Is there a property which is set for those fonts?


I am doing a font enumeration with:


[code]

CTFontManagerCopyAvailableFontFamilyNames

[/code]


then creating the font with



[code]

wxCFRef<CTFontRef> font(CTFontCreateWithName(fontName...));

[/code]


and need to see if the font I'm looking at is TT/OT....


Thank you.

Replies

Does this answer your question ?


In CoreText, you have


CTFontDescriptor

The CTFontDescriptor opaque type represents a font descriptor, that is, a dictionary of attributes (such as name, point size, and variation) that can completely specify a font.


In which you get

Enumeration. CTFontFormat

Specifies the recognized format of the font.


enum CTFontFormat : UInt32


case unrecognized

case openTypePostScript. // The font is an OpenType format containing PostScript data.

case openTypeTrueType

case trueType

case postScript

case bitmap



Or, in objc


typedef enum CTFontFormat : uint32_t {
...
} CTFontFormat;



Constants



kCTFontFormatUnrecogniz


kCTFontFormatOpenTypePostScript

The font is an OpenType format containing PostScript data.


kCTFontFormatOpenTypeTrueType
kCTFontFormatTrueType
kCTFontFormatPostScript
kCTFontFormatBitmap

Claude31,

Yes, completely!


Thank you.

Great, good continuation.


Don't forget to close the threads you opened by marking the correct answers.