I'm using a custom font for English version of my app, before localizing for other languages, the font displayed fine, then I localized the app for Chinese, the custom font is replaced by system font when I run it, though it still looks right on the storyboard.
I set the font in storyboard, I think it's a easier approach as I have multiple view controllers using this font in different places, it'd be a little complicated to set font with code, here's the storyboard setting:
and info.plist:
localization:
So, what's wrong?
Problem solved by disabling localization of the font like this:
Related
I followed the Apple guide to add a custom font to my application. It does work only if I also add the font to my system. If I don't I get the following error when opening a storyboard which contains the custom font:
Font “AlmaMono-Bold” does not exist on this system, substituting the system font instead. Saving the document will lose the original font reference.
Is it required to add the custom font to the system or is there other way to do it? There are two main problems with requiring to add the font to the system:
If some other dev wants to work on the project, he gotta remember to add this custom font to his system.
How to handle it in the Continuous Integration server? I use fastlane to build the application and send to the store, but the font was not working.
A storyboard does not magically look in your project for fonts. So opening a storyboard will not display a font unless that font is available on your machine as a whole.
The usual approach is to set the font in code, not in the storyboard.
My app is going to be made in both English, Arabic languages. I have made my xib using auto layout for english version. Now i want to use same xib for arabic version. But the problem is that interface will also change its layout from right to left.
I know about NSLocalization for xib's but i am clueless for arabic version, I googled last day but not found any thing relevant.
e.g. English version
Icon label
Arabic version
label Icon
Please put some light in how can i convert my english version of xib to be used in Arabic version.
Thanks
Use Auto Layout in your xibs. By default, the constraints created in Xcode's Interface Builder use Leading/Trailing properties, meaning all of the UI gets automatically flipped in RTL languages.
Like Leszek commented as well, you can check out Supporting Right-to-Left Languages for anything else.
Does anyone know what is best way to implement setting concept for changing themes throughout the app including the font colour, font family name and font Size in iOS 7
Thanks in advance
You could make a CSS type Style Sheet class in your code where you define all your font type, colours, etc. using macros and use those macros for setting those fields at the required places. When the user goes to the settings page and chooses a different theme, you just need to handle those macros. Hope it helps.
All my UITextViews are created through the storyboard. I used to have the fonts as body. But now I want to change them to System Fonts. So I go to storyboard and change them there. When I run the app, the new fonts are ignored completely. I even change the sizes to 22 just to see some effects but nothing happens. Any ideas what sort of global setting might be doing this?
I just started to use Localization in my app. I now see that there are multiple "MainStoryboard.storyboard" files, for each language one. I can easily change the text.
But what happens when I want to extend the storyboard with a new view? I expected it to be duplicated into all storyboard files, but that doesn't seem to be the case?
Any suggestions?
Thank you.
You should be using Base Internationalization (see docs). The idea is to build up a flexible UI in your storyboards and then rely on Xcode / iOS to substitute in appropriate text. Instead of having a storyboard per language, you would have a single Base storyboard and a set of language strings files.