UIFont fontWithName: limited to loading 2 variations per family

后端 未结 2 732
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-10 06:58

This question is extremely similar to UILabel with custom font displays *wrong* custom font, except I need to use three fonts from this family simultaneously. I am using Myriad

2条回答
  •  佛祖请我去吃肉
    2021-02-10 07:27

    In a bizarre but somewhat anticipated workaround, I found that I could actually use a third variation by opening the font up in an editor (I just grabbed the first one I found) and changing the family name, repackaging it as an otf, and adding the new file to the application plist. I left the fontName the same.

    The bizarre part is that it still loads with the same font name and shows up under the +fontNamesForFamilyName: response for Myriad Pro.

提交回复
热议问题