fontWithName后的参数设置

怎么设置已经创建好的lable上显示的字体格式,有一个方法是 [UIFont fontWithName:@"TrebuchetMS-Bold"size:13]; 我这是设置的粗体,有人会问 fontWithName:   怎么设置呢
http://www.cocoachina.com/bbs/read.php?tid=2824这上面有网友总结过了,可以试试
遍历一下font family
NSArray *familyNames = [UIFont familyNames];
for ( NSString *familyName in familyNames ){
 
     printf( "Family: %s \n" ,[familyName UTF8String] );
 
     NSArray *fontNames = [UIFontfontNamesForFamilyName:familyName];
     for ( NSString *fontName in fontNames ){
 
         printf( "\tFont: %s \n" ,[fontName UTF8String] );
     }
}

Family: Hiragino Kaku Gothic ProN W3 
    Font: HiraKakuProN-W3 
Family: Courier 
    Font: Courier 
    Font: Courier-BoldOblique 
    Font: Courier-Oblique 
    Font: Courier-Bold 
Family: Arial 
    Font: ArialMT 
    Font: Arial-BoldMT 
    Font: Arial-BoldItalicMT 
    Font: Arial-ItalicMT 
Family: STHeiti TC 
    Font: STHeitiTC-Light 
    Font: STHeitiTC-Medium 
Family: AppleGothic 
    Font: AppleGothic 
Family: Courier New 
    Font: CourierNewPS-BoldMT 
    Font: CourierNewPS-ItalicMT 
    Font: CourierNewPS-BoldItalicMT 
    Font: CourierNewPSMT 
Family: Zapfino 
    Font: Zapfino 
Family: Hiragino Kaku Gothic ProN W6 
    Font: HiraKakuProN-W6 
Family: Arial Unicode MS 
    Font: ArialUnicodeMS 
Family: STHeiti SC 
    Font: STHeitiSC-Medium 
    Font: STHeitiSC-Light 
Family: American Typewriter 
    Font: AmericanTypewriter 
    Font: AmericanTypewriter-Bold 
Family: Helvetica 
    Font: Helvetica-Oblique 
    Font: Helvetica-BoldOblique 
    Font: Helvetica 
    Font: Helvetica-Bold 
Family: Marker Felt 
    Font: MarkerFelt-Thin 
Family: Helvetica Neue 
    Font: HelveticaNeue 
    Font: HelveticaNeue-Bold 
Family: DB LCD Temp 
    Font: DBLCDTempBlack 
Family: Verdana 
    Font: Verdana-Bold 
    Font: Verdana-BoldItalic 
    Font: Verdana 
    Font: Verdana-Italic 
Family: Times New Roman 
    Font: TimesNewRomanPSMT 
    Font: TimesNewRomanPS-BoldMT 
    Font: TimesNewRomanPS-BoldItalicMT 
    Font: TimesNewRomanPS-ItalicMT 
Family: Georgia 
    Font: Georgia-Bold 
    Font: Georgia 
    Font: Georgia-BoldItalic 
    Font: Georgia-Italic 
Family: STHeiti J 
    Font: STHeitiJ-Medium 
    Font: STHeitiJ-Light 
Family: Arial Rounded MT Bold 
    Font: ArialRoundedMTBold 
Family: Trebuchet MS 
    Font: TrebuchetMS-Italic 
    Font: TrebuchetMS 
    Font: Trebuchet-BoldItalic 
    Font: TrebuchetMS-Bold 
Family: STHeiti K 
    Font: STHeitiK-Medium 
    Font: STHeitiK-Light

你可能感兴趣的:(fontWithName后的参数设置)