안드로이드 커스텀 폰트 사용
적용한 프로젝트 파일
아카이브.zip
Tw Cen MT Condensed.TTF폰트 정보 파일을 리소스로 추가
Fonts provided by application 추가 해서 아이템에 Tw Cen MT condensed.TTF입력
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
//이건 나의 폰트 종류를 알아낸다
NSArray* tempFonts = [UIFont familyNames];
for(NSString* aFont in tempFonts)
NSLog(aFont);
UILabel *lb = [[UILabel alloc]initWithFrame:CGRectMake(0, 100, 100, 100)];
[lb setText:@"123123"];
//폰트 적용하는 곳
[lb setFont:[UIFont fontWithName:@"Tw Cen MT Condensed" size:34]];
[lb setTextColor:[UIColor redColor]];
[self.view addSubview:lb];
[lb release];
}
return self;
}
NSLog로 찍어본 내폰트 종류
2012-11-14 10:56:58.875 FontTest[4391:11303] Thonburi
2012-11-14 10:56:58.876 FontTest[4391:11303] Snell Roundhand
2012-11-14 10:56:58.876 FontTest[4391:11303] Academy Engraved LET
2012-11-14 10:56:58.877 FontTest[4391:11303] Avenir
2012-11-14 10:56:58.877 FontTest[4391:11303] Marker Felt
2012-11-14 10:56:58.877 FontTest[4391:11303] Geeza Pro
2012-11-14 10:56:58.877 FontTest[4391:11303] Arial Rounded MT Bold
2012-11-14 10:56:58.877 FontTest[4391:11303] Trebuchet MS
2012-11-14 10:56:58.877 FontTest[4391:11303] Arial
2012-11-14 10:56:58.877 FontTest[4391:11303] Marion
2012-11-14 10:56:58.878 FontTest[4391:11303] Gurmukhi MN
2012-11-14 10:56:58.878 FontTest[4391:11303] Malayalam Sangam MN
2012-11-14 10:56:58.878 FontTest[4391:11303] Bradley Hand
2012-11-14 10:56:58.878 FontTest[4391:11303] Kannada Sangam MN
2012-11-14 10:56:58.878 FontTest[4391:11303] Bodoni 72 Oldstyle
2012-11-14 10:56:58.878 FontTest[4391:11303] Cochin
2012-11-14 10:56:58.878 FontTest[4391:11303] Sinhala Sangam MN
2012-11-14 10:56:58.879 FontTest[4391:11303] Hiragino Kaku Gothic ProN
2012-11-14 10:56:58.879 FontTest[4391:11303] Papyrus
2012-11-14 10:56:58.949 FontTest[4391:11303] Verdana
2012-11-14 10:56:58.950 FontTest[4391:11303] Zapf Dingbats
2012-11-14 10:56:58.950 FontTest[4391:11303] Avenir Next Condensed
2012-11-14 10:56:58.950 FontTest[4391:11303] Courier
2012-11-14 10:56:58.950 FontTest[4391:11303] Hoefler Text
2012-11-14 10:56:58.950 FontTest[4391:11303] Helvetica
2012-11-14 10:56:58.950 FontTest[4391:11303] Euphemia UCAS
2012-11-14 10:56:58.951 FontTest[4391:11303] Hiragino Mincho ProN
2012-11-14 10:56:58.951 FontTest[4391:11303] Bodoni Ornaments
2012-11-14 10:56:58.951 FontTest[4391:11303] Apple Color Emoji
2012-11-14 10:56:58.951 FontTest[4391:11303] Optima
2012-11-14 10:56:58.951 FontTest[4391:11303] Gujarati Sangam MN
2012-11-14 10:56:58.951 FontTest[4391:11303] Devanagari Sangam MN
2012-11-14 10:56:58.952 FontTest[4391:11303] Times New Roman
2012-11-14 10:56:58.952 FontTest[4391:11303] Kailasa
2012-11-14 10:56:58.952 FontTest[4391:11303] Telugu Sangam MN
2012-11-14 10:56:58.952 FontTest[4391:11303] Tw Cen MT Condensed 내가입력한 폰트가 포함되어졌으면 성공!
2012-11-14 10:56:58.953 FontTest[4391:11303] Heiti SC
2012-11-14 10:56:58.953 FontTest[4391:11303] Apple SD Gothic Neo
2012-11-14 10:56:58.953 FontTest[4391:11303] Futura
2012-11-14 10:56:58.953 FontTest[4391:11303] Bodoni 72
2012-11-14 10:56:58.953 FontTest[4391:11303] Baskerville
2012-11-14 10:56:58.954 FontTest[4391:11303] Chalkboard SE
2012-11-14 10:56:58.954 FontTest[4391:11303] Heiti TC
2012-11-14 10:56:58.954 FontTest[4391:11303] Copperplate
2012-11-14 10:56:58.954 FontTest[4391:11303] Party LET
2012-11-14 10:56:58.954 FontTest[4391:11303] American Typewriter
2012-11-14 10:56:58.954 FontTest[4391:11303] Symbol
2012-11-14 10:56:58.954 FontTest[4391:11303] Avenir Next
2012-11-14 10:56:58.955 FontTest[4391:11303] Noteworthy
2012-11-14 10:56:58.955 FontTest[4391:11303] Bangla Sangam MN
2012-11-14 10:56:58.955 FontTest[4391:11303] Zapfino
2012-11-14 10:56:58.955 FontTest[4391:11303] Tamil Sangam MN
2012-11-14 10:56:58.955 FontTest[4391:11303] Chalkduster
2012-11-14 10:56:58.955 FontTest[4391:11303] Arial Hebrew
2012-11-14 10:56:58.956 FontTest[4391:11303] Georgia
2012-11-14 10:56:58.956 FontTest[4391:11303] Helvetica Neue
2012-11-14 10:56:58.956 FontTest[4391:11303] Gill Sans
2012-11-14 10:56:58.956 FontTest[4391:11303] Palatino
2012-11-14 10:56:58.956 FontTest[4391:11303] Courier New
2012-11-14 10:56:58.956 FontTest[4391:11303] Oriya Sangam MN
2012-11-14 10:56:58.956 FontTest[4391:11303] Didot
2012-11-14 10:56:58.957 FontTest[4391:11303] Bodoni 72 Smallcaps