显示iPhone可用字体代码
2010-06-19 18:36:00 来源:WEB开发网如下代码可以用来显示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
- ››可用性测试方法:卡片分类法
- ››iPhone应用帮助残障儿童看图说话
- ››iPhone实用工具AppBox Pro使用教程大揭秘
- ››iphone4省电方法
- ››iphone 获取地址的详细信息
- ››iPhone 库的基本内存管理策略
- ››iPhone加密文字亲手做 私密信息有保障
- ››iphone 根据经纬度坐标取详细地址(包括国,省,市...
- ››iphone/ipad ios cocoa object-c 近期苹果UI部分小...
- ››iphone中如何进行多线程编程
- ››iPhone OS SDK的这些事[安装、下载、版本、实例、...
- ››iPhone ObjectC的NSAutoreleasePool
更多精彩
赞助商链接