I'm developing a little webapp.
I tried displaying some output in an sort of ascii art way, using boxdrawing characters.
However, I noticed that on Android the space (
) isn't equal width with the other characters, leading to ugly output.
I've put the font as monospace
and even tried the monospace,monospace
CSS setting.
To see what I'm talking about:
Please open https://tpgnow.herokuapp.com/CERN on Android and on a desktop browser.
Expected Output (desktop browser):
Actual Output (android browser):
I've tried different browsers and platforms and devices. It seems to work on Win, Mac, Chrome and Firefox, also on iOS, but not on Android (neither Chrome nor Firefox).
Does anybody have a solution for this problem?
why not just set the CSS so the whitespace handling usespre
, so that spaces and newlines show as normal text? – Tameikafont-family: monospace,monospace;
andfont-family: font-family: "DejaVu Sans Mono", "Menlo", "Lucida Sans Typewriter", "Lucida Console", "monaco", "Bitstream Vera Sans Mono", monospace;
Also I tried
and normal space. Also it is wrapped in a<pre>
tag. The problem only occurs on Android (display on desktop and iOS is phone) – Paulownia@font-face
declaration for DejaVu Sans Mono, and a fallback tomonospace
. Which versions of Android have you tested? – TameikaMenlo Regular
and it works. Perhaps the font that I used had some issues. Thanks so much for your help! – Paulownia