开发者

Custom font in iOS app is used in places it shouldn't be

开发者 https://www.devze.com 2023-03-08 22:07 出处:网络
I\'ve added the custom font \"Helvetica-Condensed-Bold.otf\" (font family Helvetica, font name Helvetica-Condensed-Bold) to my iOS app using the UIAppFonts Info.plist key. As expected, this font is us

I've added the custom font "Helvetica-Condensed-Bold.otf" (font family Helvetica, font name Helvetica-Condensed-Bold) to my iOS app using the UIAppFonts Info.plist key. As expected, this font is used when I do the following:

someLabel.font = [UIFont fontWithName:@"Helvetica-Condensed-Bold" size:28.0];

But unlike what I expected, and unlike how this is supposed to work, this font is now also used in a bunch of places where I didn't want it to be, like in UIButtons and UILabels other than this one. In the iPhone Simulator, 开发者_开发百科the font is even used in iOS's own status bar.

Would anyone of you know how to resolve this problem: to have to custom font only be used where I specifically say it should be?


Let's try some troubleshooting. Pick a different font and see if you have the same issue. Also, try renaming Helvetica-Condensed-Bold to something else (say HelveticaCondensedBold).


I had to use this font and I came upon this question. It looks like Helvetica Condensed Bold has been available since iOS 5.0 (http://iosfonts.com.)

I used

[UIFont fontWithName:@"HelveticaNeue-CondensedBold" size:12.0];
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号