问题描述
我正在尝试使用不是底层系统字体的字体
I am trying to use a font which is not a system font in the bottom way
[pickerLabelLeft setFont:[UIFont fontWithName:@"DaxOT-Bold" size:20]];
[pickerLabelLeft setFont:[UIFont fontWithName:@"Dax OT-Bold" size:20]];
[pickerLabelLeft setFont:[UIFont fontWithName:@"Dax-OT-Bold" size:20]];
但这些都不起作用。
但是,如果我使用如下,那么它可以很容易获得大小的系统字体
But if i use like below then it can altleast get the system font with size
[pickerLabelLeft setFont:[UIFont boldSystemFontOfSize:20]];
任何人都可以帮助我吗?
Can anyone help me?
推荐答案
查看这个,了解如何使用自定义字体。
Check out this short tutorial on how to use custom fonts.
重要的是要理解字体的文件名(例如DaxOTBold.ttf)和字体的实际名称是两个不同的东西。大多数情况下它们是相同的,但有些字体的名称与文件名略有不同。例如,Arial Rounded Bold.ttf的实际名称为Arial Rounded MT Bold。确保使用正确的名称。
It's important to understand that the file name of the font (e.g. DaxOTBold.ttf) and the actual name of the font are 2 different things. Most of the time they are the same but there are some fonts that have a name that is slightly different from the file name. For example "Arial Rounded Bold.ttf" has the actual name "Arial Rounded MT Bold". Make sure that you are using the correct name.
在plist的这个示例中,您将使用 Arial Rounded Bold.ttf 并在您使用的代码[UIFont fontwithName:@ Arial Rounded MT Bold 尺寸:20]
In this example in the plist you would use "Arial Rounded Bold.ttf" and in your code you'd use [UIFont fontwithName:@"Arial Rounded MT Bold" size:20]
这篇关于iOS:如何设置UILabel的非系统字体系列,样式,大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!