OptimusPrime
OptimusPrime

Reputation: 41

Custom Font not showing in Xamarin Storyboard

For my iOS project i need to use custom fonts. I added fonts in Resources/Fonts folder. And register the fonts in Info.plist like this. In storyboard i am getting custom fonts like this but the fonts not affecting in design. The font style drop down always empty see here "www.tiikoni.com/tis/view/?id=1f07d04". I m working in .storyboard file not .xib

What have i done wrong?

Xamarin studio version - 5.10.3

Fonts used - Exo-SemiBold.ttf, Montserrat-Bold.ttf

Upvotes: 4

Views: 1470

Answers (2)

amu
amu

Reputation: 778

Ran into a similar problem. My custom fonts didn´t show up in Xcode at all.

Solution was to move fonts from /Resources/Fonts/ up to /Resources/ (And updating Info.plist accordingly). Doing so made them show up in Xcode.

Upvotes: 5

Awesome.Apple
Awesome.Apple

Reputation: 1324

Try setting font programmatically.

After adding reference of your Font file in plist using "Fonts provided by application" key.

Then Log available fonts in AppDelegate method like this

NSArray *fontFamilies = [UIFont familyNames];

for (int i = 0; i < [fontFamilies count]; i++)
{
    NSString *fontFamily = [fontFamilies objectAtIndex:i];
    NSArray *fontNames = [UIFont fontNamesForFamilyName:[fontFamilies objectAtIndex:i]];
    NSLog (@"%@: %@", fontFamily, fontNames);
}

In these logs you can find exact name of the font you want to apply.

Upvotes: 0

Related Questions