如何检查字体是否受字体支持 [英] How to check if a character is supported by a font
本文介绍了如何检查字体是否受字体支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这就是为什么我想要得到字体提供的所有字符(字体被下载,所以我可以直接处理文件或UIFont对象)。
I听说> CTFontGetGlyphsForCharacters
但我不确定这个函数做了我想要的,我不能得到它的工作。
这是我的代码:
CTFontRef fontRef = CTFontCreateWithName((CFStringRef)font.fontName,font.pointSize,NULL) ;
NSString * characters = @I'm working on an app with a text field. The text wrote in this field will be printed and I have an issue with some characters like emoji, chinese characters, etc... because the font do not provide these characters.
It's why I want to get all the character provided by a font (The font is downloaded so I can deal directly with the file or with an UIFont object).
I heard about CTFontGetGlyphsForCharacters
but I'm not sure that this function do what I want and I can't get it work.
Here is my code :
CTFontRef fontRef = CTFontCreateWithName((CFStringRef)font.fontName, font.pointSize, NULL);
NSString *characters = @"
这篇关于如何检查字体是否受字体支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文