System font thin shown in Interfacebuilder but not on iPad - ios

I want some labels to have the thin style font. For this I use the system font thin or ultraligth. In Interfacebuilder it looks exactly how I want it to look. But starting the App on Simulator or iPad the labels font doesn't change, it is still the systems basic font.
Anyone an idea?

Solved this problem. The labels had all a custom class. So if you make changes on Interface Builder it seems first that your App would take the uifont you have choosen on Interface Builder because the label appears immediately with the correct font , but in fact it takes its customClass.

Related

Swift - Strange text rendering at runtime

I am working on an iOS app right now. I usually use the Interface Builder and recently it has been producing an issue. When the storyboard is seen in Xcode the labels on everything look fine, but some UI elements don't render properly at runtime. This has also happened for some of the images in this project. The only font used is the system font.
I have tried readjusting the font and using attributed text, but this hasn't worked for the specific label shown. Just to mention, this app is a shared project through Git so it may be an issue with it pulling incorrectly or something, but that seems odd for it to affect the text after it has been changed and adjusted.
View post on imgur.com
The results should be crystal clear text on iOS, but it results in "fuzzy" text you would expect if you were running the Windows XP on a 480p screen. What could be causing this issue?
It seems like the layer of a superview of the UILabel in the provided image is set to pre-render. This is good for performance reasons but may not always look as good, as is seen here.
If you're setting a custom layer on a superview of the UILabel, try setting the layer's shouldRasterize to false.
Ex: exampleLayer.shouldRasterize = false

ios label with attributed text fonts not displaying correctly

labels in xcode aren't correctly displaying some fonts even though attributed text is selected...
In storyboards I have some labels that I changed the text from "plain" to "attributed" but the fonts I wont to use wont display correctly - instead xcode, or whatever is controlling it, displays what seems to be a fall-back font.
Any workaround?
Reasons why?
I'm trying to use schoolhouse cursive b (and yes it does show up in the list of fonts)...
The iOS Devices don't have the font schoolhouse cursive b preinstalled:
Font list iOS7
Font list iOS6
If you want to add a custom font, have a look at this answer.

Where Can I Find Sprite Kit Available fonts?

I am experimenting with the new iOS 7 SpriteKit.
This line of code is taken from apple class reference and can be found in their sample project as well.
SKLabelNode *label = [SKLabelNode labelNodeWithFontNamed:#"Chalkduster"];
In this line the Chalkduster font is used.
I understand it's a bitmap font but how do I know what other font name I can use to replace Chalkduster?
You can also view the available fonts within Xcode itself by going to your storyboard file. You create a label there, go to the label's Attributes Inspector (the slider icon in the Utilities bar), select Font -> Custom, then scroll through the Family section to view the font list.
And here is how you would use a custom font of your own. Make sure you go through steps 1-5, then you should be able to use your custom font using [SKLabelNode labelNodeWithFontNamed:#"Font Name Here"].
Here is a list of iOS 7 installed fonts
I found that there is a very useful website showing all the available fonts on iOS. It’s iosfonts.com. The website shows how given font looks like, its name and its code name as well as the iOS version when specific font was added.
You can also log all the font names that are available as described here:
How to log names of all available fonts in iOS project.

UILabel doesn't show text properly in Emulator and real device as it does in Interface Builder

I have some static Label with static text that will not change forever.
I adjust the layout in Interface Builder until they look great. and use Cmd + = to let all label's size fit their contents.
But when I run and test them on emulator and device they become truncate even though they look fit in the Interface Builder.
I have test it on iOS 5.0, 6.1 and on 3.5, 4 inches include on iphone5 device. All the result are different from in Interface Builder.
Emulator
Interface Builder
Any help to overcome this?
Thanks
You can try using this code for fitting the label content.
For that you need to have a IBOutlet for the label and then after that,
use this code when you load the view :
[self.label sizeToFit];
Hope that works !
As there's a change in DateFormatter it's creating a problem. In your XIB, date is in different format than your device.
You can set Minimum Font Size for your label from your XIB. Check below screenshot.
I hope it'll solve your problem.
Thanks,
Hemang.

iOS : Roboto Condensed through Interface builder

I have a weird issue here... An app uses some custom font (Roboto Condensed for instance).
I added my font to my project. They are associated with the target. They are declared in the info.plist and the typo is right (copy/paste from the original files) and they contain the extension of course. They are in the "Copy ressources" of the build phase, they are part of the Font Family when I log them but enumerating fonts, they work through IB, and they are not set when the app is running... The fonts were download from the latest version on the Google website.
Weirdest thing : I have other custom font, and they are working.
Even weirder : if I set the font programmatically, it works...
It seems that it is related to IB (font name, family?)
I'm running out of options here. Have you encountered this kind of behavior?
Thanks.
I did not find any solution. The only workaround is to have outlets for every font specific view and set it into code :-/

Resources