To better characterize my vision difficulties, I’ve made a web page:
https://marknahabedian.github.io/VisionTests/words-test.html
It displays a series of randomly chosen words at progressively smaller font sizes.
One can choose a light or dark theme, and from several type faces and stroke weights to see if that helps.
I use the HTML style
attribute with the absolute pt
unit to conrol the text size.
When I look at this page on a small display like a smart phone
though, the text which has been given an absolute size in points
is much smaller than on my laptop, where 36pt text is half an
inch high. I don’t understand why the absolute size isn’t
respected on small displays.
I include text-size-adjust: none
and its browser specific
variants in my style rules but still on my phone the 36pt text is
only 1/4 inch tall.
Code is on GitHub:
https://github.com/MarkNahabedian/VisionTests
I welcome your suggestions.
Thanks.
2
Answers
As explained in the comment, you should use pixel sizes when displaying something on a pixel screen. If you want the text to be the same size on every device, you have to multiply the pixel value by the resolution. This applies to Retina resolution on Apple or HD resolution on other devices, or 4K for example.
I have built an example here.
You can never make it perfect, because the pixel sizes are different on different devices. But from my point of view this is the best solution for your problem.
Edit:
i just saw on my macbook that i forgot something. only if a device has small pixels, like smartphones with high resolution you should multiply the pixel-size with the dpi. you still have to do that in this code that.
I’ll have to see if I can find a solution for that too.
Implementation of viewport will vary by device / manufacturer. It’s best to stick with standard sizing to achieve best possible support across viewports.