How to display text with an absolute size

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: 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?