我正在使用应用于CATextLayer的自定义字体.我正在使用此处的教程和示例代码.http://www.freetimestudios.com/2010/09/13/custom-fonts-on-the-ipad-and-ios-4/
但是,每隔一段时间,我就会收到以下错误.没有什么特别可以触发它.有人可以说明这意味着什么吗?要检查什么?
CoreText: Invalid 'kern' Subtable In CTFont <name: Intellect, size: 20.000000, matrix: 0x0>
CTFontDescriptor <attributes: <CFDictionary 0xac07a80 [0x38295d98]>{type = mutable, count = 1, capacity = 3, pairs = (
0 : <CFString 0x3833f750 [0x38295d98]>{contents = "NSFontNameAttribute"} = <CFString 0x159af0 [0x38295d98]>{contents = "Intellect"}
Run Code Online (Sandbox Code Playgroud)
我使用以下代码加载字体.此代码取自上面链接中的项目.
- (CTFontRef)newCustomFontWithName:(NSString *)fontName
ofType:(NSString *)type
attributes:(NSDictionary *)attributes
{
NSString *fontPath = [[NSBundle mainBundle] pathForResource:fontName ofType:type];
NSData *data = [[NSData alloc] initWithContentsOfFile:fontPath];
CGDataProviderRef fontProvider = CGDataProviderCreateWithCFData((CFDataRef)data);
[data release];
CGFontRef cgFont = CGFontCreateWithDataProvider(fontProvider);
CGDataProviderRelease(fontProvider);
CTFontDescriptorRef fontDescriptor = …Run Code Online (Sandbox Code Playgroud)