I’m building a native extension for iOS. I’d like to use a custom font. So far, I have:
In the ANE build structure:
- the .ttf files in the same folder as the lib
In the AS lib:
-
included the files in the application descriptor like this:
UIDeviceFamily</key>
1</string>
2</string>
</array>
UIStatusBarStyle</key>
UIStatusBarStyleBlackOpaque</string>
UIRequiresPersistentWiFi</key>
YES</string>
UIAppFonts</key>myFont-bold.ttf</string>
myFont-halb.ttf</string>
myFont-reg.ttf</string>
</array>
]]>
high
In the iOS project:
- added the files under supporting files
- added the files to compile sources in the targets build phase
-
used the font in the lib like this:
[descriptionLabel setFont:[UIFont fontWithName:@”myFont-halb” size:11]];
Still, using the ANE (which works fine in all other regards), it defaults back to the system font. Can anybody see, what I’m missing?
Any hints appreciated!
Thanx, Marcus
Figured it out: font-files need to be added to the app’s bin-folder, too. Another pitfall: filename and fontname differ, be sure to use the right one’s, where needed.