Page 1 of 1

Request for monospaced font

Posted: 03 May 2018, 19:20
by Blaise170
Would love to have a monospaced font to use on the forums. I know that the code feature exists, but since it only displays the first 10 lines or so, it's not very useful. Not sure the difficulty in adding a new font to select, but...

Posted: 03 May 2018, 19:27
by cml
I use Liberation Mono. It prints ilL1| in a different enough manner so works for me.

Posted: 03 May 2018, 20:04
by webwit
It doesn't show as a button in the editor, but try the 'monospace' tag.

Posted: 03 May 2018, 20:09
by cml
Oh I think I misunderstood your request, sorry for intruding... :D

Posted: 03 May 2018, 20:23
by ramnes
let's try this
one space
two spaces
three spaces
four spaces

.
.
.
.
.
.


It works, but it doesn't handle front spaces nor multiple spaces.

Posted: 03 May 2018, 20:31
by Blaise170
ramnes wrote: let's try this
one space
two spaces
three spaces
four spaces

.
.
.
.
.
.


It works, but it doesn't handle front spaces nor multiple spaces.
Hmmm... I wonder if BBCode requires non-breaking spaces to display monospace correctly.

Posted: 03 May 2018, 20:36
by webwit
There's also 'fixed' and 'financial'.

Posted: 03 May 2018, 20:40
by Blaise170
Fixed:
0
 1
  2
   3
    4
     5
Financial:
0
 1
  2
   3
    4
     5

Posted: 03 May 2018, 20:42
by Blaise170
Nice.
┌──────────┬──────────┬──────────┐
│  Alpha   │   Beta   │  Gamma   │
├──────────┼──────────┼──────────┤
│ 1        │ 2        │ 3        │
│ AB       │ CD       │ EF       │
│ QWE      │ RTY      │ UIO      │
│ XXXX     │ WWWW     │ MMMM     │
│        A │        B │        C │
└──────────┴──────────┴──────────┘

Posted: 03 May 2018, 20:48
by webwit
Monospace: <span style="font-family: monospace">{TEXT}</span>

Fixed: <pre style="font-size: 10px; line-height: 16px; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word">{TEXT}</pre>

Financial: <pre style="font-size: 10px; line-height: 16px; overflow: auto">{TEXT}</pre>

So 'monospace' collapses white space and wraps lines if it doesn't fit (it behaves like non-monospace text), 'fixed' preserves white space and wraps lines if it doesn't fit, and financial goes all the way: it preserves white-space and doesn't wrap until it encounters a newline, and shows a horizontal scrollbar if it doesn't fit.

Posted: 03 May 2018, 20:51
by Blaise170
Very useful information. Thanks for that webwit. I just updated a chart in my GB thread and now it actually looks somewhat nice. Looks like in general I'll be using
 to format any tables I make (the PHP table generator is extremely hard to use, FYI).