Problem using custom font

I've added the font to my Resources folder
Installed the font on my mac
Changed the property of Copy to output to "Always Copy"
Added the font to Font provide by application in Info.plist

I'm using this:
lblName.Font = UIFont.FromName("HelveticaRounded-Bold", 80f);

Yet it displays Helvetica instead of Helvetica Rounded Bold
The font for lblName goes from {.SFUIText 17} to {Helvetica 80}

Am I missing something?

Thanks for your help!

Answers

  • It seems modification has not done completely, Or editing is not done properly. Some configuration missing.

  • RodrigoLiraRodrigoLira USMember ✭✭

    Please check the "BuildAction" for every font file you added. You should change to "BundleResource".

    Also, if your font files are under "Resources\Fonts", your entries on "Info.plist" should be relative to the Resources folder.

    For example:

    "Fonts\some_font.ttf"

  • Carl-HenryMathieuCarl-HenryMathieu USMember
    edited December 2017

    Thanks for your replies.

    I've changed the BuildAction to BundleResource and the font is in the folder Resources

    I've done some tests.
    For some reason it's working on my physical device (iOS 10.3.3) and simulator (iOS 10.3.1) but not on iOS 11, I've tried on a iPhone SE simulator (iOS 11.2).
    Do you know what I must add for the font to work in iOS 11?

Sign In or Register to comment.