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)")
}
}
})
Copperplate-Light supports A
Copperplate-Light does not support ⟼
Copperplate-Light does not support ⤎
Copperplate-Light does not support ⤏
etc
编辑:
在macOS上检查字符输入窗口,看起来这些特定的字形在STIXGeneral-Regular和Apple Symbols字体中都是可用的。也许您可以将其中一个添加为自定义字体到您的iOS应用程序中?