iPhone - Convert CTFont to UIFont?

后端 未结 2 1645
無奈伤痛
無奈伤痛 2020-11-30 14:18

I am trying to convert a CTFont to a UIFont without losing any of the styles and attributes such as:

  • Font Name
  • Font Size
  • Font color
2条回答
  •  一整个雨季
    2020-11-30 14:44

    With ARC:

    UIFont *uiFont = [UIFont fontWithName:(__bridge NSString *)CTFontCopyPostScriptName(ctFont) size:CTFontGetSize(ctFont)];
    

提交回复
热议问题