CoreText: недопустимая подтаблица 'керна' в CTFont

Я использую пользовательский шрифт, относился к CATextLayer. Я использую учебный и код кода, найденный здесь. http://www.freetimestudios.com/2010/09/13/custom-fonts-on-the-ipad-and-ios-4/

Однако время от времени я получаю следующую ошибку. Ничто в особенности, кажется, не инициировало его. Кто-то может пролить некоторый свет относительно того, что это означает? Что проверить на?

CoreText: Invalid 'kern' Subtable In CTFont 
CTFontDescriptor {type = mutable, count = 1, capacity = 3, pairs = (
    0 : {contents = "NSFontNameAttribute"} = {contents = "Intellect"}

Я загружаю шрифт с помощью следующего кода. Этот код взят из проекта в ссылке выше.

- (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 = CTFontDescriptorCreateWithAttributes((CFDictionaryRef)attributes);
    CTFontRef font = CTFontCreateWithGraphicsFont(cgFont, 0, NULL, fontDescriptor);
    CFRelease(fontDescriptor);
    CGFontRelease(cgFont);
    return font;
}

9
задан Oh Danny Boy 19 October 2010 в 21:26
поделиться