Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android monospace space ( ) width is different than character width

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): enter image description here

Actual Output (android browser): enter image description here

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?

like image 636
stklik Avatar asked Mar 02 '17 14:03

stklik


People also ask

What is the use of space in Android?

In Android, Space is a lightweight subclass of View class. It is normally placed between two components in the interface in order to create some space between these two components. For example: A Space is put into a LinearLayout (horizontally) as the first child View with the aim of creating the blank space on the left side.

What is monospace writer and how do I use it?

It get's rid of the standard editing features you'd find in standard writing and notes apps and replaces them with a modern-styled, essentials-only formatting popup. Monospace Writer supports Bold, Italics, Strikethrough, Bullet, Quote and a bunch of size related formatting styles.

Can I upgrade monospace for free?

Using APKPure App to upgrade Monospace, fast, free and saving internet data.! Monospace is a minimal notes and writing app, built from the ground up with a designed-for-touch UI. It get's rid of the standard editing features you'd find in standard writing and notes apps and replaces them with a modern-styled, essentials-only formatting popup.

Why use monospace fonts for coding?

Why use Monospace fonts for coding. Why? Well, monospace fonts allocate equal space for each character, meaning that the letter 'i' is given as much horizontal space as the letter 'k'. That may look unnatural for other types of text and typography, but it's perfect for coding.


1 Answers

I ran into this exact same problem! Box drawing gliphs are missing in Google fonts.

Adobe's Source Code Pro has them. Mononoki should too.

I suspect may other issues with Android monospace are due to this general issue.

like image 149
Jacopo Avatar answered Sep 21 '22 17:09

Jacopo