uifont

How do I get the font name from an otf or ttf file?

↘锁芯ラ 提交于 2019-11-26 08:00:02
问题 I have used a custom font in my previous app. The file name was \"ProximaNova-Regular.otf\" and to load the font I just used... [UIFont fontWithName:@\"ProximaNova-Regular\" size:20]; This worked perfectly. Now in this new app I have three font files... Dude_Willie.otf Impact handsean.ttf But I\'m not sure how to load these. I have tried [UIFont fontWithName:<the file name> size:20]; But this just falls back to using Helvetica. How can I find what name to use? 回答1: Follow these four easy

Custom installed font not displayed correctly in UILabel

微笑、不失礼 提交于 2019-11-26 04:57:48
问题 I\'m trying to use a Helvetica Neue Condensed font which I got from the Adobe Font Collection Pro Package. Unfortunately, it seems to draw incorrectly when I use it within a UILabel . The line height seems to be calculated correctly (I think), but when the font is displayed, it is aligned to the very top of the bounding box. I called [myLabel sizeToFit] and only adjusted the width to produce this screen capture: I had the same problem with both the bold and regular version of the font. I was