Set characters size with ESC/POS (Java)

drenda picture drenda · Mar 23, 2016 · Viewed 11.1k times · Source

I developed a small library in Java to send commands to a Epson TM-T70II printer with ESC/POS protocol. I'm able to print all what I need but I can't find a way to change the font size of the text to a smaller value than the default font size. Just to puntualize, "GS!" is not a ESC/POS useful command because it can only increase the font size, see here to more info.

I was looking at "ESC&" but I'm not sure this can be useful to reduce the font size. Can you give me some suggestion and a small example of the command to use?

Answer

Tomo picture Tomo · Apr 7, 2016

TM-T70II has two types of Font, FontA(12x24) and FontB(9x17).
To change the font size, you can use the "ESC !" command

  • Font A: "ESC ! 0" (1Bh 21h 00h)
  • Font B: "ESC ! 1" (1Bh 21h 01h)

If it does not work you can send the "ESC @" first to clean the command buffer.