下面两个函数创建字体:
+fontWithName:(NSString *)fontName size:(CGFloat) fontSize //创建并且返回一个指定字体类型和大小的字体对象,fontName指定字体集的名字和风格(例如宋体,楷书等这一类型的),fontsize设置字体的大小。
-fontWithSize:返回字体的大小
上面我们提到我们需要设置字体集,在IOS系统中我们用到的字体包含一下几种 :
Font Family: American Typewriter( AmericanTypewriter,AmericanTypewriter-Bold)
Font Family: AppleGothic(AppleGothic)
Font Family: Arial(ArialMT,Arial-BoldMT,Arial-BoldItalicMT,Arial-ItalicMT)
Font Family: Arial Rounded MT Bold(ArialRoundedMTBold)
Font Family: Arial Unicode MS(ArialUnicodeMS)
Font Family: Courier(Courier,Courier-BoldOblique,Courier-Oblique,Courier-Bold)
Font Family: Courier New(CourierNewPS-BoldMT,CourierNewPS-ItalicMT,CourierNewPS-BoldItalicMT,CourierNewPSMT)
Font Family: DB LCD Temp (DBLCDTempBlack)
Font Family: Georgia( Georgia-Bold, Georgia,Georgia-BoldItalic,Georgia-Italic)
Font Family: Helvetica(Helvetica-Oblique,Helvetica-BoldOblique,Helvetica,Helvetica-Bold)默认字体
Font Family: Helvetica Neue(HelveticaNeue,HelveticaNeue-Bold)
Font Family: Hiragino Kaku Gothic **** W3(HiraKakuProN-W3)
Font Family: Hiragino Kaku Gothic **** W6(HiraKakuProN-W6)
Font Family: Marker Felt( MarkerFelt-Thin)
Font Family: STHeiti J (STHeitiJ-Medium,STHeitiJ-Light)
Font Family: STHeiti K( STHeitiK-Medium, STHeitiK-Light)
Font Family: STHeiti SC(STHeitiSC-Medium, STHeitiSC-Light)
Font Family: STHeiti TC(STHeitiTC-Light,STHeitiTC-Medium)
Font Family: Times New Roman(TimesNewRomanPSMT,TimesNewRomanPS-BoldMT, TimesNewRomanPS-BoldItalicMT, TimesNewRomanPS-ItalicMT)
Font Family: Trebuchet MS( TrebuchetMS-Italic,TrebuchetMS,Trebuchet-BoldItalic,TrebuchetMS-Bold)
Font Family: Verdana( Verdana-Bold,Verdana-BoldItalic, Verdana,Verdana-Italic)
Font Family: Zapfino( Zapfino)