मैं आईओएस में एक कस्टम फ़ॉन्ट का उपयोग करने के लिए CATextLayer का उपयोग कर रहा हूं, मुझे पता है कि Fonts provided by application
के साथ कस्टम फ़ॉन्ट का उपयोग करने का एक आसान तरीका है लेकिन यह अलग फ़ॉन्ट है। मैं सोच रहा था कि प्रत्येक पात्र के बीच अंतर बदलने का कोई तरीका है? मुझे ऐसा करने के लिए कोई संपत्ति नहीं मिली!कैटक्स्टलेयर और अक्षरों के बीच ट्रैकिंग/अंतर
संपादित:
- (void)viewWillAppear:(BOOL)animated {
CTFontRef font = [self newCustomFontWithName:@"yeki"
ofType:@"ttf"
attributes:[NSDictionary dictionaryWithObject:[NSNumber numberWithFloat:16.f]
forKey:(NSString *)kCTFontSizeAttribute]];
CGRect screenBounds = [[UIScreen mainScreen] bounds];
normalTextLayer_ = [[CATextLayer alloc] init];
normalTextLayer_.font = font;
normalTextLayer_.string = str;
normalTextLayer_.wrapped = YES;
normalTextLayer_.foregroundColor = [[UIColor purpleColor] CGColor];
normalTextLayer_.fontSize = 50.f;
normalTextLayer_.alignmentMode = kCAAlignmentRight;
normalTextLayer_.frame = CGRectMake(0.f,100.f, screenBounds.size.width, screenBounds.size.height /1.f);
[self.view.layer addSublayer:normalTextLayer_];
CFRelease(font);
}
आपका मतलब कर्नाई है? आप 'CGContextSetCharacterSpacing' का उपयोग करने का प्रयास कर सकते हैं। –
हां, लेकिन मुझे CATextLayer क्लास के लिए 'CGContextSetCharacterSpacing' के साथ कोई समाधान नहीं मिला! –
कोई प्रतिक्रिया ???? –