gpt4 book ai didi

iphone - iOS ttf 字体不工作

转载 作者:行者123 更新时间:2023-12-03 21:15:48 24 4
gpt4 key购买 nike

我正在尝试在我的应用程序中嵌入自定义字体。

我已将字体文件包含在我的项目中

我将 key 添加到.plist

我将字体添加到目标

结果:

NSLog(@"Fonts: %@", [UIFont familyNames]);

Fonts: (
Thonburi,
"Snell Roundhand",
"Academy Engraved LET",
Avenir,
"Marker Felt",
"Geeza Pro",
"Arial Rounded MT Bold",
"Trebuchet MS",
Arial,
Marion,
"Gurmukhi MN",
"Malayalam Sangam MN",
"Bradley Hand",
"Kannada Sangam MN",
"Bodoni 72 Oldstyle",
Cochin,
"Sinhala Sangam MN",
"Hiragino Kaku Gothic ProN",
Papyrus,
Verdana,
"Zapf Dingbats",
"Avenir Next Condensed",
Courier,
"Hoefler Text",
Helvetica,
"Euphemia UCAS",
"Hiragino Mincho ProN",
"Bodoni Ornaments",
"Apple Color Emoji",
Optima,
"Gujarati Sangam MN",
"Devanagari Sangam MN",
"Times New Roman",
Kailasa,
"Telugu Sangam MN",
"Heiti SC",
"Apple SD Gothic Neo",
Futura,
"Bodoni 72",
Baskerville,
"Chalkboard SE",
"Heiti TC",
Copperplate,
"Party LET",
"American Typewriter",
Symbol,
"Avenir Next",
Noteworthy,
"Bangla Sangam MN",
Zapfino,
"Tamil Sangam MN",
Chalkduster,
"Arial Hebrew",
Georgia,
"Helvetica Neue",
"Gill Sans",
Palatino,
"Courier New",
"Oriya Sangam MN",
Didot,
"Bodoni 72 Smallcaps"
)

我的字体没有在那里列出,这是我正在使用的代码:

[UIFont fontWithName:@"KozGoPr6N-Regular.ttf" size:self.LabelEmail.font.pointSize];

使用上面的代码,字体大小并不总是改变,只是有时会改变。

IE,当我用 0.20 替换 self.LabelEmail.font.pointSize 时,大小保持完全相同,标签作为 IB 的 IBOutlet 连接,并且在 IB 中将字体设置为 14 点

最佳答案

[UIFont fontWithName:@"KozGoPr6N-Regular.ttf" size:self.LabelEmail.font.pointSize];

首先,我很确定“.ttf”不是(内部)字体名称的一部分。

代码应如下所示:

[UIFont fontWithName:@"KozGoPr6N-Regular" size:self.LabelEmail.font.pointSize];

第二,您是否自己将此字体从 OpenType (.otf) 转换为 TrueType (.ttf)? (我在我的计算机上进行了快速搜索,发现存在此字体,但它是安装在/Library/Fonts/中的 OpenType 字体)。

关于iphone - iOS ttf 字体不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14501956/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com