I am currently working on an iPhone project in which all labels/text views etc. should appear with a custom font (I'm using Xcode 4.2.1). I have done some research on this, and the only solution seems to be adding the font files to the project, editing the info.plist file appropriately and setting the font programmatically (i.e. by outlets or by subclassing the relevant views). In any case, these approaches won't lead to the interface builder displaying the text with the custom font (it will still show Helvetica). It is not possible to select the custom font using the attributes inspector.
Although I don't think I missed something, I just want to make sure there is no other way than programmatically setting the fonts, which would be a rather painful for the task I have to work on (localization issues, unique app design etc.). It would be nice to get the interface builder to display custom fonts..
Custom fonts can only be set programmatically..Unfortunately..this is termed as a bug in interface builder and hasn't been fixed yet.
using custom fonts in Interface Builder a reusable library is available.
It uses a simple trick for doing this. Set the font(say calibri) to all of your UI Elements that you will never use in your project and FontReplacer will do mapping between custom font and calibri. So there is no need to make IBOutlets or any other graphics.
Here is link to github from where you can download FontReplacer to use in your project. https://github.com/0xced/FontReplacer
another question is addressing same Fonts not displaying in Interface Builder i have also posted possible solution there
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With