Custom Font in ios not working

前端 未结 17 1902
北海茫月
北海茫月 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:23

    In addition to:

    • adding the font file names to the info.plist under "Fonts provided by application"
    • adding the actual files to the project.

    You also have to make sure that under Targets -> Build Phases -> Copy Bundle Resources has the actual filenames of the custom fonts.

    To check if they have appeared, you can do something like:

            UIFont.familyNames.forEach { (name) in
            print(name)
        }
    

提交回复
热议问题