Currently, I am in the process of creating a mobile app that will work across different platforms using jQueryMobile and PhoneGap. My initial focus is on developing for Android.
When it comes to Android app development, it is recommended that developers use dp as the unit for font sizes. DP, which stands for density-independent pixels, ensures that fonts appear the same physical size on the screen, regardless of screen density.
While this approach works well for Android, I am curious to know if other browser platforms also support this unit. My assumption is that they do not.
This leads me to question the need to move away from older methods or workarounds for setting fonts to a physically absolute size:
1. PT: where one pt equals 1/72 of an inch.
Could this method truly provide a reliable and universally supported physically absolute size for fonts across all browsers and devices? If so, why consider other options?
2. EM: defined as the size of the font for the document.
With PT offering an absolute size to begin with, leveraging em for font size could involve simply adjusting the document's font size to suit the screen through Javascript. If all other elements are specified in em, would that not suffice?
3. Exploring jQueryMobile* As I delve into this project, I am utilizing CSS media queries to determine screen dimensions and density, ultimately setting a base font-size for the element, followed by working with em for font dimensions. While many advocate for using em solely for fonts, could it not be beneficial to apply this approach to all text-containing elements in an app or site focused on text?
4. An Alternatove Perspective
Does dp extend its support to 'desktop' browsers and iOS as well?