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.