0
votes

I need to emulate in HTML what is printed in an esc/pos thermal printer. I have everything, except double-width text, which is text, printed with a non-proportional typography, that takes exactly twice the width of the normal typography, but the same height. For example, "ABCD" has the same width in normal text than "AB" in double-width mode. Is there a way, a font, something I can use to render this kind of text in HTML?

I searched high and low but I could not find a single font that matches this requirement.

2

2 Answers

0
votes

As James' answer, try:

 letter-spacing: 1em;

What you can also try is kinda ugly, but it works:

 #yourelement { 
        transform: scaleX(2);
 }
0
votes

I doubt you can stretch the font, but you can emulate the width using CSS:

letter-spacing: 1em;

Alternately, you could render the text to Canvas, then resize the canvas.