Custom fonts on iOS app - working in Simulator but not iPad

前端 未结 8 1196
故里飘歌
故里飘歌 2021-02-08 07:11

Encountering a weird problem here. I\'m developing a game for my school project (non-commercial), and I\'m using a custom font Black Chancery (free under GNU GPL). I followed th

8条回答
  •  被撕碎了的回忆
    2021-02-08 08:00

    You have to use the real font name in the [UIFont fontWithName:@"... method! Not the ttf filename!!!

    This real name is mostly far away from the filename. Just open the rtf in the Mac font utility. In the header you see the font family!!! Only the family!!! if you now use

    NSArray *fontNames = [UIFont fontNamesForFamilyName:@"MyFontNameFamily"];
    NSLog(@"%@", fontNames);
    

    in your code, you get the real real real name in the console ;-)

    But in the plist entry you still need the (case sensitive) filename!!!

提交回复
热议问题