iOS中中文字体种类特别的少,有时为了增加字体的艺术效果需要添加自定义的字体。其实在iOS中添加自定义字体很简单,4步就可搞定:
1,在Info.plist中加入名为UIAppFonts的array
2,把*.ttf 和*.otf文件加入到项目当中,比如说是MyScript.ttf
3,把文件名添加到UIAppFonts数组里面
4,在程序中用下面的命令来调用
// use the font name here, not the filename
UIFont *myCustomFont = [UIFont fontWithName: @"MyScript" size:30];
so easy!
1,在Info.plist中加入名为UIAppFonts的array
2,把*.ttf 和*.otf文件加入到项目当中,比如说是MyScript.ttf
3,把文件名添加到UIAppFonts数组里面
4,在程序中用下面的命令来调用
// use the font name here, not the filename
UIFont *myCustomFont = [UIFont fontWithName: @"MyScript" size:30];
so easy!
本文介绍如何在iOS应用中轻松添加自定义字体。只需四步:配置Info.plist支持UIAppFonts,导入字体文件如MyScript.ttf,注册字体名称,并在代码中调用。此方法适用于希望提升字体艺术效果的开发者。
3803

被折叠的 条评论
为什么被折叠?



