声明:
文章转自新浪博主:Apple_ 小熊猫 原文地址:http://blog.sina.com.cn/s/blog_b22973cf0101auqv.html。转载时请附带声明。
ios中的字体:
- -
(void)enumerateFonts{ -
for(NSString *familyName in [UIFont familyNames]){ -
NSLog(@"Font FamilyName = %@",familyName); //*输出字体族科名字 -
-
for(NSString *fontName in [UIFont fontNameForFamilyName:familyName]){ -
NSLog(@"\t%@",fontName); //*输出字体族科下字样名字 -
} -
} - }
在ios模拟器上运行代码,得到如下结果:
...
Font Family = Geeza Pro
GeezaPro
GeezaPro-Bold
Font Family = Helvetica Neue
HelveticaNeue-Italic
HelveticaNeue-Bold
HelveticaNeue-BoldItalic
HelveticaNeue
...
字体族科后面加-Bold就是加粗 加-Oblique就是倾斜等
iPhone 5.0 | iPad 5.0 |
Font Families: | Font Families: |
Academy Engraved LET | |
AcademyEngravedLetPlain | AcademyEngravedLetPlain |
American Typewriter | |
AmericanTypewriter-CondensedLight | AmericanTypewriter-CondensedLight |
AmericanTypewriter-Light | AmericanTypewriter-Light |
AmericanTypewriter | AmericanTypewriter |
AmericanTypewriter-Condensed | AmericanTypewriter-Condensed |
AmericanTypewriter-Bold | AmericanTypewriter-Bold |
AmericanTypewriter-CondensedBold | AmericanTypewriter-CondensedBold |
Apple Color Emoji | |
AppleColorEmoji | AppleColorEmoji |
Apple SD Gothic Neo | |
AppleSDGothicNeo-Medium | AppleSDGothicNeo-Medium |
AppleSDGothicNeo-Bold | AppleSDGothicNeo-Bold |
Arial | |
ArialMT | ArialMT |
Arial-ItalicMT | Arial-ItalicMT |
Arial-BoldMT | Arial-BoldMT |
Arial-BoldItalicMT | Arial-BoldItalicMT |
Arial Hebrew | |
ArialHebrew | ArialHebrew |
ArialHebrew-Bold | ArialHebrew-Bold |
Arial Rounded MT Bold | |
ArialRoundedMTBold | ArialRoundedMTBold |
Bangla Sangam MN | |
BanglaSangamMN-Bold | BanglaSangamMN-Bold |
BanglaSangamMN | BanglaSangamMN |
Baskerville | |
Baskerville | Baskerville |
Baskerville-Italic | Baskerville-Italic |
Baskerville-SemiBold | Baskerville-SemiBold |
Baskerville-SemiBoldItalic | Baskerville-SemiBoldItalic |
Baskerville-Bold | Baskerville-Bold |
Baskerville-BoldItalic | Baskerville-BoldItalic |
Bodoni 72 | |
BodoniSvtyTwoITCTT-Book | BodoniSvtyTwoITCTT-Book |
BodoniSvtyTwoITCTT-BookIta | BodoniSvtyTwoITCTT-BookIta |
BodoniSvtyTwoITCTT-Bold | BodoniSvtyTwoITCTT-Bold |
Bodoni 72 Oldstyle | |
BodoniSvtyTwoOSITCTT-Book | BodoniSvtyTwoOSITCTT-Book |
BodoniSvtyTwoOSITCTT-BookIt | BodoniSvtyTwoOSITCTT-BookIt |
BodoniSvtyTwoOSITCTT-Bold | BodoniSvtyTwoOSITCTT-Bold |
Bodoni 72 Smallcaps | |
BodoniSvtyTwoSCITCTT-Book | BodoniSvtyTwoSCITCTT-Book |
Bodoni Ornaments | |
BodoniOrnamentsITCTT | BodoniOrnamentsITCTT |
Bradley Hand | |
BradleyHandITCTT-Bold | BradleyHandITCTT-Bold |
Chalkboard SE | |
ChalkboardSE-Light | ChalkboardSE-Light |
ChalkboardSE-Regular | ChalkboardSE-Regular |
ChalkboardSE-Bold | ChalkboardSE-Bold |
Chalkduster | |
Chalkduster | Chalkduster |
Cochin | |
Cochin | Cochin |
Cochin-Italic | Cochin-Italic |
Cochin-Bold | Cochin-Bold |
Cochin-BoldItalic | Cochin-BoldItalic |
Copperplate | |
Copperplate-Light | Copperplate-Light |
Copperplate | Copperplate |
Copperplate-Bold | Copperplate-Bold |
Courier | |
Courier | Courier |
Courier-Oblique | Courier-Oblique |
Courier-Bold | Courier-Bold |
Courier-BoldOblique | Courier-BoldOblique |
Courier New | |
CourierNewPSMT | CourierNewPSMT |
CourierNewPS-BoldMT | CourierNewPS-BoldMT |
CourierNewPS-BoldItalicMT | CourierNewPS-BoldItalicMT |
CourierNewPS-ItalicMT | CourierNewPS-ItalicMT |
DB LCD Temp | |
DBLCDTempBlack | DBLCDTempBlack |
Devanagari Sangam MN | |
DevanagariSangamMN | DevanagariSangamMN |
DevanagariSangamMN-Bold | DevanagariSangamMN-Bold |
Didot | |
Didot | Didot |
Didot-Italic | Didot-Italic |
Didot-Bold | Didot-Bold |
Euphemia UCAS | |
EuphemiaUCAS | EuphemiaUCAS |
EuphemiaUCAS-Italic | EuphemiaUCAS-Italic |
EuphemiaUCAS-Bold | EuphemiaUCAS-Bold |
Futura | |
Futura-Medium | Futura-Medium |
Futura-MediumItalic | Futura-MediumItalic |
Futura-CondensedMedium | Futura-CondensedMedium |
Futura-CondensedExtraBold | Futura-CondensedExtraBold |
Geeza Pro | |
GeezaPro | GeezaPro |
GeezaPro-Bold | GeezaPro-Bold |
Georgia | |
Georgia | Georgia |
Georgia-Italic | Georgia-Italic |
Georgia-Bold | Georgia-Bold |
Georgia-BoldItalic | Georgia-BoldItalic |
Gill Sans | |
GillSans-Light | GillSans-Light |
GillSans-LightItalic | GillSans-LightItalic |
GillSans | GillSans |
GillSans-Italic | GillSans-Italic |
GillSans-Bold | GillSans-Bold |
GillSans-BoldItalic | GillSans-BoldItalic |
Gujarati Sangam MN | |
GujaratiSangamMN | GujaratiSangamMN |
GujaratiSangamMN-Bold | GujaratiSangamMN-Bold |
Gurmukhi MN | |
GurmukhiMN | GurmukhiMN |
GurmukhiMN-Bold | GurmukhiMN-Bold |
Heiti SC | |
STHeitiSC-Light | STHeitiSC-Light |
STHeitiSC-Medium | STHeitiSC-Medium |
Heiti TC | |
STHeitiTC-Light | STHeitiTC-Light |
STHeitiTC-Medium | STHeitiTC-Medium |
Helvetica | |
Helvetica-Light | Helvetica-Light |
Helvetica-LightOblique | Helvetica-LightOblique |
Helvetica | Helvetica |
Helvetica-Oblique | Helvetica-Oblique |
Helvetica-Bold | Helvetica-Bold |
Helvetica-BoldOblique | Helvetica-BoldOblique |
Helvetica Neue | |
HelveticaNeue-UltraLight | HelveticaNeue-UltraLight |
HelveticaNeue-UltraLightItalic | HelveticaNeue-UltraLightItalic |
HelveticaNeue-Light | HelveticaNeue-Light |
HelveticaNeue-LightItalic | HelveticaNeue-LightItalic |
HelveticaNeue | HelveticaNeue |
HelveticaNeue-Italic | HelveticaNeue-Italic |
HelveticaNeue-Medium | HelveticaNeue-Medium |
HelveticaNeue-Bold | HelveticaNeue-Bold |
HelveticaNeue-BoldItalic | HelveticaNeue-BoldItalic |
HelveticaNeue-CondensedBold | HelveticaNeue-CondensedBold |
HelveticaNeue-CondensedBlack | HelveticaNeue-CondensedBlack |
Hiragino Kaku Gothic ProN | |
HiraKakuProN-W3 | HiraKakuProN-W3 |
HiraKakuProN-W6 | HiraKakuProN-W6 |
Hiragino Mincho ProN | |
HiraMinProN-W3 | HiraMinProN-W3 |
HiraMinProN-W6 | HiraMinProN-W6 |
Hoefler Text | |
HoeflerText-Regular | HoeflerText-Regular |
HoeflerText-Italic | HoeflerText-Italic |
HoeflerText-Black | HoeflerText-Black |
HoeflerText-BlackItalic | HoeflerText-BlackItalic |
Kailasa | |
Kailasa | Kailasa |
Kailasa-Bold | Kailasa-Bold |
Kannada Sangam MN | |
KannadaSangamMN | KannadaSangamMN |
KannadaSangamMN-Bold | KannadaSangamMN-Bold |
Malayalam Sangam MN | |
MalayalamSangamMN | MalayalamSangamMN |
MalayalamSangamMN-Bold | MalayalamSangamMN-Bold |
Marion | |
Marion-Regular | Marion-Regular |
Marion-Italic | Marion-Italic |
Marion-Bold | Marion-Bold |
Marker Felt | |
MarkerFelt-Thin | MarkerFelt-Thin |
MarkerFelt-Wide | MarkerFelt-Wide |
Noteworthy | |
Noteworthy-Light | Noteworthy-Light |
Noteworthy-Bold | Noteworthy-Bold |
Optima | |
Optima-Italic | Optima-Italic |
Optima-Regular | Optima-Regular |
Optima-Bold | Optima-Bold |
Optima-BoldItalic | Optima-BoldItalic |
Optima-ExtraBlack | Optima-ExtraBlack |
Oriya Sangam MN | |
OriyaSangamMN | OriyaSangamMN |
OriyaSangamMN-Bold | OriyaSangamMN-Bold |
Palatino | |
Palatino-Roman | Palatino-Roman |
Palatino-Italic | Palatino-Italic |
Palatino-Bold | Palatino-Bold |
Palatino-BoldItalic | Palatino-BoldItalic |
Papyrus | |
Papyrus | Papyrus |
Papyrus-Condensed | Papyrus-Condensed |
Party LET | |
PartyLetPlain | PartyLetPlain |
Sinhala Sangam MN | |
SinhalaSangamMN | SinhalaSangamMN |
SinhalaSangamMN-Bold | SinhalaSangamMN-Bold |
Snell Roundhand | |
SnellRoundhand | SnellRoundhand |
SnellRoundhand-Bold | SnellRoundhand-Bold |
SnellRoundhand-Black | SnellRoundhand-Black |
Tamil Sangam MN | |
TamilSangamMN | TamilSangamMN |
TamilSangamMN-Bold | TamilSangamMN-Bold |
Telugu Sangam MN | |
TeluguSangamMN | TeluguSangamMN |
TeluguSangamMN-Bold | TeluguSangamMN-Bold |
Thonburi | |
Thonburi | Thonburi |
Thonburi-Bold | Thonburi-Bold |
Times New Roman | |
TimesNewRomanPSMT | TimesNewRomanPSMT |
TimesNewRomanPS-ItalicMT | TimesNewRomanPS-ItalicMT |
TimesNewRomanPS-BoldMT | TimesNewRomanPS-BoldMT |
TimesNewRomanPS-BoldItalicMT | TimesNewRomanPS-BoldItalicMT |
Trebuchet MS | |
TrebuchetMS | TrebuchetMS |
TrebuchetMS-Italic | TrebuchetMS-Italic |
TrebuchetMS-Bold | TrebuchetMS-Bold |
Trebuchet-BoldItalic | Trebuchet-BoldItalic |
Verdana | |
Verdana | Verdana |
Verdana-Italic | Verdana-Italic |
Verdana-Bold | Verdana-Bold |
Verdana-BoldItalic | Verdana-BoldItalic |
Zapf Dingbats | |
ZapfDingbatsITC | ZapfDingbatsITC |
Zapfino | |
Zapfino | Zapfino |
附带例子:
UILabel *textLabel=[[UILabel alloc]initWithFrame:CGRectMake(10, 100, 300, 50)];
textLabel.text=@"Thonburi-Thonburi";
textLabel.backgroundColor=[UIColor clearColor];
textLabel.textColor=[UIColor blackColor];
textLabel.font=[UIFont fontWithName:@"GillSans-BoldItalic" size:20];//直接写入 每个字体族下的小类,即能改变字体。
[self.view addSubview:textLabel];