ios 开发中内嵌字体不显示,大概率是因为字体名称不对。
所以这个方法可以打印系统所有字体。
func showAllFonts()
{
let familyNames = UIFont.familyNames
for familyName in familyNames
{
let fontNames = UIFont.fontNames(forFamilyName: familyName as String)
for fontName in fontNames
{
print("字体font名称:\(fontName)")
}
}
}