开发学院手机开发iPhone 开发 显示iPhone可用字体代码 阅读

显示iPhone可用字体代码

 2010-06-19 18:36:00 来源:WEB开发网   
核心提示:如下代码可以用来显示iPhone系统可用的字体:NSArray *familyNames = [UIFont familyNames];for( NSString *familyName in familyNames ){printf( "Family: %s ", [familyName UTF8

如下代码可以用来显示iPhone系统可用的字体:

NSArray *familyNames = [UIFont familyNames];

for( NSString *familyName in familyNames ){

printf( "Family: %s ", [familyName UTF8String] );

NSArray *fontNames = [UIFont fontNamesForFamilyName:familyName];

for( NSString *fontName in fontNames ){

printf( " Font: %s ", [fontName UTF8String] );

}

}

NSArray

*familyNames = [UIFont familyNames]; for( NSString *familyName in

familyNames ){ printf( "Family: %s ", [familyName UTF8String] );

NSArray *fontNames = [UIFont fontNamesForFamilyName:familyName]; for(

NSString *fontName in fontNames ){ printf( " Font: %s ", [fontName

UTF8String] ); } }

下面是我在模拟器上获取的字体列表:

Family: Courier

Font: Courier

Font: Courier-BoldOblique

Font: Courier-Oblique

Font: Courier-Bold

Family: AppleGothic

Font: AppleGothic

Family: Arial

Font: ArialMT

Font: Arial-BoldMT

Font: Arial-BoldItalicMT

Font: Arial-ItalicMT

Family: STHeiti TC

Font: STHeitiTC-Light

Font: STHeitiTC-Medium

Family: Hiragino Kaku Gothic ProN

Font: HiraKakuProN-W6

Font: HiraKakuProN-W3

Family: Courier New

Font: CourierNewPS-BoldMT

Font: CourierNewPS-ItalicMT

Font: CourierNewPS-BoldItalicMT

Font: CourierNewPSMT

Family: Zapfino

Font: Zapfino

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

1 2  下一页

Tags:显示 iPhone 可用

编辑录入:coldstar [复制链接] [打 印]
[]
  • 好
  • 好的评价 如果觉得好,就请您
      0%(0)
  • 差
  • 差的评价 如果觉得差,就请您
      0%(0)
更多精彩
    赞助商链接

    热点阅读
      焦点图片
        最新推荐
          精彩阅读