I received a private message from @becode asking about how to format the text in ESC/POS. I thought it might be useful to reply to his question here for everyone’s benefit. Here’s what he wrote:
Hello Brian,
After many tries, I finally managed to install JSprintManager on my Bubble application.
Thanks again for typing this so clearly.
Now I’m trying to format my ticket but it’s not clear to me how I can do this.
This is how it looks now in the bubble editor.

Do you have a website where I can find extra information on this or a good example?
What I don’t understand above all is how you can change the size of your font or make it bold, for example.
Here I saw a great example of yours. And I hope that you can help me with that. Thank you very much.
The general answer is this: With ESC/POS, you work line by line. To change the formatting of the text, you enter a command to change it and anything that comes afterwards will be formatted that way.
There are examples of this in the very image you sent me:
esc + '!' + '\x00'
is your standard normal-sized font, usually called ‘Font A’ in documentation
esc + '!' + '\x38'
will give you an emphasized double-height double-width font
Personally I like this page for examples of font controlling commands, but there’s loads of documentation online in all sorts of places for this.
One of the most baffling things about ESC/POS documentation is that it typically presents info about the commands in hex, decimal, and ASCII formats. You’ll want to make sure you’re passing hex values with this setup.
Since you asked about making something bold, you would use \x1B\x45\x01
to turn emphasis mode on and \x1B\x45\x00
to turn it off. In documentation (like this example), this command may appear as ESC E n
with n
having a possible value of 0 or 1.