07-18-2023, 11:27 PM
When using the same font (Bebas Neue), I experience the exact same problem: the font does not show up in the font list for `Plain` controls.
It does for `Attributed` controls, as described in Update 2 in Joes post, but then you're actually changing the `attributedText` instead of the regular `text`, which may lead to unwanted behavior. For example, you'll have to fiddle with `NSMutableAttributedString` to change the text or text color at runtime.
I did some investigation on this issue. I used [FontLab Studio][1] to modify the font and do some tests. I used [Bebas Neue version 1.400 (dated September 15, 2014) from dafont.com][2].
- Maybe the font file was somehow corrupted. Re-saved as .otf and .ttf: **Didn't work.**
- Maybe the meta data of the font were corrupted. Copied all the glyphs to a new font and named that Bebas Neue: **Didn't work.**
- I renamed the font from Bebas Neue to BN: **It works!** But why?
- Maybe you can't use "Neue" in a font name (since Helvetica Neue was the iOS system font up to iOS 8). Renamed the font to Test Neue: **Still works.**
- Maybe you can't use "Bebas" in a font name then? Renamed the font to Bebas: **Still works.**
- What... Just to be sure, I changed the font name back to Bebas Neue: **Doesn't work again.**
- I also tried BebasNeue: **Also didn't work.**
- Then I changed the name to Bebas Neue Whatever: **It works.**
[![Bebas Neue Whatever][3]][3]
I really do not understand why this is happening.
Doesn't Apple or Xcode want you to use "Bebas Neue" or "BebasNeue" in the Interface Builder?
I had the normal Bebas Neue installed. Maybe the reference got corrupted?
I really can't tell. Maybe someone on a clean system can try if Bebas Neue works in their Xcode.
Anyway, I achieved my goal: being able to use Bebas Neue (I named the final version "Bebas Neue MyAppName") for `Plain` styled labels and buttons, so I can design my app as-is and don't have to fiddle around with attributed strings.
[1]:
It does for `Attributed` controls, as described in Update 2 in Joes post, but then you're actually changing the `attributedText` instead of the regular `text`, which may lead to unwanted behavior. For example, you'll have to fiddle with `NSMutableAttributedString` to change the text or text color at runtime.
I did some investigation on this issue. I used [FontLab Studio][1] to modify the font and do some tests. I used [Bebas Neue version 1.400 (dated September 15, 2014) from dafont.com][2].
- Maybe the font file was somehow corrupted. Re-saved as .otf and .ttf: **Didn't work.**
- Maybe the meta data of the font were corrupted. Copied all the glyphs to a new font and named that Bebas Neue: **Didn't work.**
- I renamed the font from Bebas Neue to BN: **It works!** But why?
- Maybe you can't use "Neue" in a font name (since Helvetica Neue was the iOS system font up to iOS 8). Renamed the font to Test Neue: **Still works.**
- Maybe you can't use "Bebas" in a font name then? Renamed the font to Bebas: **Still works.**
- What... Just to be sure, I changed the font name back to Bebas Neue: **Doesn't work again.**
- I also tried BebasNeue: **Also didn't work.**
- Then I changed the name to Bebas Neue Whatever: **It works.**
[![Bebas Neue Whatever][3]][3]
I really do not understand why this is happening.
Doesn't Apple or Xcode want you to use "Bebas Neue" or "BebasNeue" in the Interface Builder?
I had the normal Bebas Neue installed. Maybe the reference got corrupted?
I really can't tell. Maybe someone on a clean system can try if Bebas Neue works in their Xcode.
Anyway, I achieved my goal: being able to use Bebas Neue (I named the final version "Bebas Neue MyAppName") for `Plain` styled labels and buttons, so I can design my app as-is and don't have to fiddle around with attributed strings.
[1]:
[To see links please register here]
[2]:[To see links please register here]
[3]: