Fonts in mobile apps for developers

05. 11. 2018

In following text we describe basic principles every programmer should respect when developing mobile app.

Use proper units

Fonts in mobile apps are not defined in pixels. We need more abstract units to cover all displays with different densities where the text with size defined in pixels will be really big or really tiny. All mobile platforms have units preserving the same physical size across all display densities. It could imagined as defining font size in millimeters.

When you are developing for Android platform the proper unit is SP (scalable independent-pixel), the equivalent of pixel size on 160 DPI display (mdpi). This unit enforces the same physical font size on all devices and allow users to change font size in system settings.

Developers on iOS platform should define font size in PT (point). This is again the equivalent of pixel size for 160 DPI display.

Respect minimal font size

General recommendation is to avoid fonts smaller than 14 sp/pt. Some sources mention 13 pt as minimal recommended size for iOS apps. Anyway, if there is a small font defined in your graphical design, you missed the density it was made for or your designer did it the wrong way.

Be careful with bigger fonts; they are acceptable for headlines but not for longer texts.

Custom fonts on Android

Unlike iOS, Android has no build-in support for custom fonts. Fortunately, there is a lot of third party libraries trying to help with this weakness. We like the most Calligraphy , where you can in few simple steps use any font with most of Android widgets.

Fancy how we do it? Or do you have any suggestions? Let us know in the comment section. 

10 Entrepreneurship Lessons Worth Thousands of Dollars

Instead of great success we have experienced great entrepreneurship lessons (for now). It also transformed me, a person who has …

Read article

Unique Czech words reflecting coronavirus now also with English explanations as Flashcard quiz in Vocabulary Miner

  Project Čestina 2.0 covering a variety of the modern Czech language with its slangs and new words has joined …

Read article

Performance of built-in higher-order functions Map, Filter, Reduce, and flatMap vs. for-in loop in Swift

  The most popular higher-order functions are map, filter, and reduce. We all use them since we think that syntax …

Read article

Generate JSON key for Google Play deployment

In order to allow our CI server to deploy applications on Google Play automatically, we have to generate the JSON …

Read article