Custom Font in ios not working

前端 未结 17 1936
北海茫月
北海茫月 2020-12-07 22:53

I want to use HelveticaNeue-UltraLight in my ios application. I\'m adding the font file as a resource to my project and adding the \"Fonts provided by application\" key in t

17条回答
  •  清歌不尽
    2020-12-07 23:20

    It is working with different variations of the same font(even in IOS 8). I'll post my mistake just in case someone has the same problem... I was using font's filename instead of the font name. A useful solution is print all the fonts available and look for the one I was using. In Swift would be:

    for fontFamilyNames in UIFont.familyNames {
        for fontName in UIFont.fontNames(forFamilyName: fontFamilyNames) {
            print("FONTNAME:\(fontName)")
        }
    }
    

    I found this useful tutorial in: Code with Chris

提交回复
热议问题