में अमान्य 'कर्न' सबटेबल मैं 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"}
मैं निम्नलिखित कोड का उपयोग कर फ़ॉन्ट लोड करता हूं। यह कोड उपरोक्त लिंक में परियोजना से लिया गया है।
- (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;
}
तो क्या सत्यापन ने इसे ठीक किया? – Ralphleon
@ राल्फलेन नहीं, ऐसा नहीं हुआ। मुझे किसी अन्य साइट से फ़ॉन्ट डाउनलोड करना था, सत्यापित करना था, और सुनिश्चित करना था कि यह ठीक था। मुझे लगता है कि कर्न को अंतराल के साथ करना है, कभी-कभी कस्टम फ़ॉन्ट के साथ समस्या होती है। –
मुझे यह समस्या है। मान्यताओं को छोड़कर। मैं ओपनसैन का उपयोग कर रहा हूं ... किसी को भी यह ठीक करने का तरीका पता है? – bogardon