答案……恐怕没有。
至少不是根据这个非常hacky的测试......
extension unichar {
func isSupportedBy(fontName: String) -> Bool {
let characters = [self]
var glyphs: [CGGlyph] = []
let ctFont = CTFontCreateWithName(fontName as CFString, 15, nil)
return CTFontGetGlyphsForCharacters(ctFont, characters, &glyphs, 1)
}
}
UIFont.familyNames.map({
UIFont.fontNames(forFamilyName: $0)
}).joined().forEach({
for string in ["A", "\u{27FC}", "\u{290E}", "\u{290F}"].map({$0.utf16}){
if let char = string.first {
if char.isSupportedBy(fontName: $0) {
print("\($0) supports \(string)")
} else {
print("\($0) does not support \(string)")
}
} else {
print("invalid char \(string)")
}
}
})
Run Code Online (Sandbox Code Playgroud)
Copperplate-Light supports A
Copperplate-Light does not support ?
Copperplate-Light does not support ?
Copperplate-Light does not support ?
etc
Run Code Online (Sandbox Code Playgroud)
编辑:
检查 macOS 中的字符输入窗口,似乎这些特殊字形在STIXGeneral-Regular 和Apple Symbols字体中可用。也许您可以将其中一种作为自定义字体添加到您的 iOS 应用程序中?
| 归档时间: |
|
| 查看次数: |
2561 次 |
| 最近记录: |