Custom fonts since iPhone OS 3.2

来源:互联网 发布:淘宝运营大概多少提成 编辑:程序博客网 时间:2024/06/05 19:38

Finally iPhone OS 3.2 supports custom fonts. Here is a short summary what you have to do..

Supported font formats are ..

  • TrueType-flavoured OpenType (extension .ttf) and
  • PostScript-flavoured OpenType (extension .otf).

Ok what you have to do is simple ..

  1. just add the key UIAppFonts as array to your Info.plist
  2. add the *.ttf or *.otf files to your bundle
  3. insert the filenames as values to your UIAppFonts array
  4. Load the fonts with ..
// use the font name here, not the filenameUIFont *myCustomFont = [UIFont fontWithName:@"AnnabelScript" size:30];

Note: You can also use the fonts in your UIWebViews with font-tags or CSS.


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



http://doli.at/2010/05/08/custom-fonts-ipad/
原创粉丝点击