Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70434

How to display text with an absolute size

$
0
0

@jsilver wrote:

Hi, I’m creating an Ionic app in which i need to print some characters on a screen with a fixed height in inches. This app is related to a vision test so that characters need to be fixed size regardless of the mobile device type.

Using a stylesheet (e.g. font-size: 1in) does allow me to change the font size but the characters don’t show up as 1in.

Since that approach didn’t work, I tried the article shown here: https://stackoverflow.com/questions/279749/detecting-the-system-dpi-ppi-from-js-css/311952#311952 which allows me to detect the device DPI. I can then create text with the correct number of pixels. This is close, but then when the phone is rotated between portrait and landscape mode, the size of the text changes.

Can anyone point me in the right direction?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70434

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>