I use CATextLayer to use a custom font in iOS, I know that there is an easy way to use a custom font with Fonts provided by application , but this is a different font. I was wondering if there is a way to change the interval between each character? I did not find any property to do this!
EDITED:
- (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); }
ios iphone core-animation catextlayer
Mc.lover
source share