Reputation: 15628
I have downloaded a Font file from the internet and the name of the font file is nuku1.ttf.
I have to use that in my application so I activated that by using this. CTFontManagerSetAutoActivationSetting(FontPath,2);
. After activating this font file how can get the font name for that file Programmatically? In other words where the AutoActivated Fonts are stored in mac?
Upvotes: 0
Views: 862
Reputation: 96323
CTFontManagerSetAutoActivationSetting(FontPath,2);
The CTFontManagerSetAutoActivationSetting
function takes a bundle identifier, not the path to a font. (Also, you should use the value names, not hard-coded numeric literals.)
To examine a font file, use the CTFontManagerCreateFontDescriptorsFromURL
function to create an array of CTFontDescriptor objects, one for each of the fonts in the file. Each descriptor will tell you the font's PostScript name, family name, and display name, among other attributes.
Upvotes: 1