ref: http://ju.outofmemory.cn/entry/217705
ref:http://gold.xitu.io/entry/57958a41128fe10056be13b1
下面两个函数创建字体:
+fontWithName:(NSString *)fontName size:(CGFloat) fontSize 创建并且返回一个指定字体类型和大小的字体对象,fontName指定字体集的名字和风格(例如宋体,楷书等这一类型的),fontsize设置字体的大小。
-fontWithSize:返回字体的大小
上面我们提到我们需要设置字体集,在IOS系统中我们用到的字体包含以下几种 :
Font: Copperplate-Light
Font: Copperplate
Font: Copperplate-Bold
Font: IowanOldStyle-Italic
Font: IowanOldStyle-Roman
Font: IowanOldStyle-BoldItalic
Font: IowanOldStyle-Bold
Font: KohinoorTelugu-Regular
Font: KohinoorTelugu-Medium
Font: KohinoorTelugu-Light
Font: CourierNewPS-BoldMT
Font: CourierNewPS-ItalicMT
Font: CourierNewPSMT
Font: CourierNewPS-BoldItalicMT
Font: GillSans-Italic
Font: GillSans-Bold
Font: GillSans-BoldItalic
Font: GillSans-LightItalic
Font: GillSans
Font: GillSans-Light
Font: GillSans-SemiBold
Font: GillSans-SemiBoldItalic
Font: GillSans-UltraBold
Font: AppleSDGothicNeo-Bold
Font: AppleSDGothicNeo-Thin
Font: AppleSDGothicNeo-UltraLight
Font: AppleSDGothicNeo-Regular
Font: AppleSDGothicNeo-Light
Font: AppleSDGothicNeo-Medium
Font: AppleSDGothicNeo-SemiBold
Font: MarkerFelt-Thin
Font: MarkerFelt-Wide
Font: Thonburi
Font: Thonburi-Bold
Font: Thonburi-Light
Font: FZLTXIHJW--GB1-0
Font: AvenirNextCondensed-BoldItalic
Font: AvenirNextCondensed-Heavy
Font: AvenirNextCondensed-Medium
Font: AvenirNextCondensed-Regular
Font: AvenirNextCondensed-HeavyItalic
Font: AvenirNextCondensed-MediumItalic
Font: AvenirNextCondensed-Italic
Font: AvenirNextCondensed-UltraLightItalic
Font: AvenirNextCondensed-UltraLight
Font: AvenirNextCondensed-DemiBold
Font: AvenirNextCondensed-Bold
Font: AvenirNextCondensed-DemiBoldItalic
Font: TamilSangamMN
Font: TamilSangamMN-Bold
Font: HelveticaNeue-Italic
Font: HelveticaNeue-Bold
Font: HelveticaNeue-UltraLight
Font: HelveticaNeue-CondensedBlack
Font: HelveticaNeue-BoldItalic
Font: HelveticaNeue-CondensedBold
Font: HelveticaNeue-Medium
Font: HelveticaNeue-Light
Font: HelveticaNeue-Thin
Font: HelveticaNeue-ThinItalic
Font: HelveticaNeue-LightItalic
Font: HelveticaNeue-UltraLightItalic
Font: HelveticaNeue-MediumItalic
Font: HelveticaNeue
Font: GurmukhiMN-Bold
Font: GurmukhiMN
Font: TimesNewRomanPSMT
Font: TimesNewRomanPS-BoldItalicMT
Font: TimesNewRomanPS-ItalicMT
Font: TimesNewRomanPS-BoldMT
Font: Georgia-BoldItalic
Font: Georgia
Font: Georgia-Italic
Font: Georgia-Bold
Font: AppleColorEmoji
Font: ArialRoundedMTBold
Font: Kailasa-Bold
Font: Kailasa
Font: KohinoorDevanagari-Light
Font: KohinoorDevanagari-Regular
Font: KohinoorDevanagari-Semibold
Font: KohinoorBangla-Semibold
Font: KohinoorBangla-Regular
Font: KohinoorBangla-Light
Font: ChalkboardSE-Bold
Font: ChalkboardSE-Light
Font: ChalkboardSE-Regular
Font: SinhalaSangamMN-Bold
Font: SinhalaSangamMN
Font: PingFangTC-Medium
Font: PingFangTC-Regular
Font: PingFangTC-Light
Font: PingFangTC-Ultralight
Font: PingFangTC-Semibold
Font: PingFangTC-Thin
Font: GujaratiSangamMN-Bold
Font: GujaratiSangamMN
Font: DamascusLight
Font: DamascusBold
Font: DamascusSemiBold
Font: DamascusMedium
Font: Damascus
Font: Noteworthy-Light
Font: Noteworthy-Bold
Font: GeezaPro
Font: GeezaPro-Bold
Font: Avenir-Medium
Font: Avenir-HeavyOblique
Font: Avenir-Book
Font: Avenir-Light
Font: Avenir-Roman
Font: Avenir-BookOblique
Font: Avenir-Black
Font: Avenir-MediumOblique
Font: Avenir-BlackOblique
Font: Avenir-Heavy
Font: Avenir-LightOblique
Font: Avenir-Oblique
Font: AcademyEngravedLetPlain
Font: DiwanMishafi
Font: Futura-CondensedMedium
Font: Futura-CondensedExtraBold
Font: Futura-Medium
Font: Futura-MediumItalic
Font: Farah
Font: KannadaSangamMN
Font: KannadaSangamMN-Bold
Font: ArialHebrew-Bold
Font: ArialHebrew-Light
Font: ArialHebrew
Font: ArialMT
Font: Arial-BoldItalicMT
Font: Arial-BoldMT
Font: Arial-ItalicMT
Font: PartyLetPlain
Font: Chalkduster
Font: HoeflerText-Italic
Font: HoeflerText-Regular
Font: HoeflerText-Black
Font: HoeflerText-BlackItalic
Font: Optima-Regular
Font: Optima-ExtraBlack
Font: Optima-BoldItalic
Font: Optima-Italic
Font: Optima-Bold
Font: Palatino-Bold
Font: Palatino-Roman
Font: Palatino-BoldItalic
Font: Palatino-Italic
Font: FZLTZHK--GBK1-0
Font: MalayalamSangamMN-Bold
Font: MalayalamSangamMN
Font: AlNile-Bold
Font: AlNile
Font: BradleyHandITCTT-Bold
Font: PingFangHK-Ultralight
Font: PingFangHK-Semibold
Font: PingFangHK-Thin
Font: PingFangHK-Light
Font: PingFangHK-Regular
Font: PingFangHK-Medium
Font: LaoSangamMN
Font: Helvetica-Bold
Font: Helvetica
Font: Helvetica-LightOblique
Font: Helvetica-Oblique
Font: Helvetica-BoldOblique
Font: Helvetica-Light
Font: Courier-BoldOblique
Font: Courier
Font: Courier-Bold
Font: Courier-Oblique
Font: Cochin-Bold
Font: Cochin
Font: Cochin-Italic
Font: Cochin-BoldItalic
Font: Trebuchet-BoldItalic
Font: TrebuchetMS
Font: TrebuchetMS-Bold
Font: TrebuchetMS-Italic
Font: HiraMinProN-W6
Font: HiraMinProN-W3
Font: DevanagariSangamMN
Font: DevanagariSangamMN-Bold
Font: OriyaSangamMN
Font: OriyaSangamMN-Bold
Font: SnellRoundhand-Bold
Font: SnellRoundhand
Font: SnellRoundhand-Black
Font: ZapfDingbatsITC
Font: BodoniSvtyTwoITCTT-Bold
Font: BodoniSvtyTwoITCTT-Book
Font: BodoniSvtyTwoITCTT-BookIta
Font: Verdana-Italic
Font: Verdana-BoldItalic
Font: Verdana
Font: Verdana-Bold
Font: AmericanTypewriter-CondensedLight
Font: AmericanTypewriter
Font: AmericanTypewriter-CondensedBold
Font: AmericanTypewriter-Light
Font: AmericanTypewriter-Bold
Font: AmericanTypewriter-Condensed
Font: AvenirNext-UltraLight
Font: AvenirNext-UltraLightItalic
Font: AvenirNext-Bold
Font: AvenirNext-BoldItalic
Font: AvenirNext-DemiBold
Font: AvenirNext-DemiBoldItalic
Font: AvenirNext-Medium
Font: AvenirNext-HeavyItalic
Font: AvenirNext-Heavy
Font: AvenirNext-Italic
Font: AvenirNext-Regular
Font: AvenirNext-MediumItalic
Font: Baskerville-Italic
Font: Baskerville-SemiBold
Font: Baskerville-BoldItalic
Font: Baskerville-SemiBoldItalic
Font: Baskerville-Bold
Font: Baskerville
Font: KhmerSangamMN
Font: Didot-Italic
Font: Didot-Bold
Font: Didot
Font: SavoyeLetPlain
Font: BodoniOrnamentsITCTT
Font: Symbol
Font: Menlo-Italic
Font: Menlo-Bold
Font: Menlo-Regular
Font: Menlo-BoldItalic
Font: BodoniSvtyTwoSCITCTT-Book
Font: Papyrus
Font: Papyrus-Condensed
Font: HiraginoSans-W3
Font: HiraginoSans-W6
Font: PingFangSC-Ultralight
Font: PingFangSC-Regular
Font: PingFangSC-Semibold
Font: PingFangSC-Thin
Font: PingFangSC-Light
Font: PingFangSC-Medium
Font: EuphemiaUCAS-Italic
Font: EuphemiaUCAS
Font: EuphemiaUCAS-Bold
Font: Zapfino
Font: BodoniSvtyTwoOSITCTT-Book
Font: BodoniSvtyTwoOSITCTT-Bold
Font: BodoniSvtyTwoOSITCTT-BookIt
UIFont fontWithName 后不知道字体的名字,看了下面的全解决!