CATextLayer를 사용하고 있습니다. iOS에서 맞춤 글꼴을 사용하려면 Fonts provided by application
과 함께 맞춤 글꼴을 사용하는 간단한 방법이 있지만 다른 글꼴입니다. 각 문자 사이의 간격을 변경하는 방법이 있는지 궁금합니다. 나는 그렇게 할 어떤 재산도 찾지 못했습니다!CATextLayer 및 문자 사이의 추적/간격
편집 :
- (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'에 대한 해결책을 찾지 못했습니다! –
어떤 응답 ???? –