iPhone UIFont boldFont带有名称 [英] iPhone UIFont boldFont With name

查看:47
本文介绍了iPhone UIFont boldFont带有名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看过UIFont的标头,但它具有所有类方法,只有一个实例方法和一些无用的属性.我想知道如何将字体设置为具有字体名称,并且粗体字体粗细有点像[[UIFont alloc] initWithFontName:@"Courier New" weight:@"Bold" size:14];.感谢您的任何提前帮助!

I have looked at the headers for UIFont but it has all class methods and only one instance method and some useless properties. I would like to know how to set the font to have a font name, and bold font weight kinda like [[UIFont alloc] initWithFontName:@"Courier New" weight:@"Bold" size:14];. Thanks for any help in advance!

〜汤米

推荐答案

我想出了答案,那就是使用字体家族的粗体字体: CourierNewPS-BoldMT并有效:

I figured out the answer, and that was to use the font-family's bolded version of the font: CourierNewPS-BoldMT and that worked :

我通过使用[UIFont fontNamesForFamilyName:@"Courier New"]方法发现了这一点,该方法返回了Courier New所有不同变体的数组,包括Bolded和Italic等.

I found this out by using the [UIFont fontNamesForFamilyName:@"Courier New"] method which returned an array of all the different variations of Courier New including, Bolded and Italic etc.

这篇关于iPhone UIFont boldFont带有名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆