- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 CTFontDescriptorMatchFontDescriptorsWithProgressHandler
下载字体。与Apple提供的示例相同: https://developer.apple.com/library/ios/samplecode/DownloadFont/Listings/DownloadFont_ViewController_m.html
它工作正常,我可以在我的应用程序中显示下载的字体,但是在我重新启动我的应用程序后,我无法使用 fontWithName:size:
和 [UIFont familyNames 创建 UIFont ]
不包括下载的字体。为了解决这个问题,我记录了字体路径并在启动应用程序时使用 CTFontManagerRegisterFontsForURL
注册字体。这样做之后,在模拟器上一切正常,但在设备上不工作!!!求助!!!
最佳答案
最后,我发现问题是当字体文件 url 类似于:/var/mobile/.../XXX.ttc
时,CTFontManagerRegisterFontsForURL
会失败,在我将 url 固定为 file:///var/mobile/.../XXX.ttc
之后,一切都会好起来的。
关于ios - CTFontManagerRegisterFontsForURL 在设备上不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23290958/
我正在尝试使用 CTFontDescriptorMatchFontDescriptorsWithProgressHandler 下载字体。与Apple提供的示例相同: https://develope
@implementation UIFont (FlatUI) + (void) initialize { [super initialize]; static dispatch_on
我是一名优秀的程序员,十分优秀!