Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change System Font for iPhone application - entire Application

Is there a way I can change the System Font for an entire Application?

I want to define the font for the entire Application so that I don't have to go to individual labels or individual fonts to change it. I would like a universal definition which will change all the fonts that exist within the application. How do I do this?

like image 694
vivianaranha Avatar asked Nov 10 '09 18:11

vivianaranha


People also ask

Can you change your entire iPhone font?

To manage installed fonts, go to Settings > General, then tap Fonts.

What font is used on iPhone apps?

SF Pro is the system font in iOS and iPadOS. iOS and iPadOS apps can also use NY.

How do I change the writing style on my iPhone without an app?

Press the Settings button in the upper-right corner of the screen. Tap on Fonts. Under the Select Font list, choose your desired font style. Tap Done.


2 Answers

You can use Pixate to style your app. When using pixate, you can set the style attributes of your UI elements via CSS. This way you can globally setup your UILabels and UITextField etc. to use your custom font. This is by far the best way to globally style your font.

In my app I had to use "Open Sans" and setup all my UILabels, UITextFields and UITextViews to use that font:

In your "default.css"

label {
    font-family: "Open Sans";
}

text-field {
    font-family: "Open Sans";
}

text-view {
    font-family: "Open Sans";
}

enter image description here

like image 56
leviathan Avatar answered Sep 19 '22 23:09

leviathan


Make a shared class called Constants.h or something. In it do this:

#define kStandardFont [UIFont systemFontOfSize:20] 

Of course adjust the font to be what you need it to be. Then, whenever you need to use it (in a label or whatever) do this:

#import "Constants.h"
…
…
… 
[label setFont:kStandardFont];
like image 43
coneybeare Avatar answered Sep 20 '22 23:09

coneybeare