gpt4 book ai didi

ios - 快速将 UIFont 转换为 CGFont?

转载 作者:搜寻专家 更新时间:2023-10-31 21:52:03 28 4
gpt4 key购买 nike

需要为下面的函数传递CGFont

CGFontCreateCopyWithVariations(<#font: CGFont!#>, <#variations: CFDictionary!#>))

最佳答案

这是一个小例子:

var font = UIFont.systemFontOfSize(15.0)
var fontName = font.fontName as NSString
var cgFont = CGFontCreateWithFontName(fontName);

var copiedFont = CGFontCreateCopyWithVariations(cgFont, nil)

关于ios - 快速将 UIFont 转换为 CGFont?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26035041/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com