receipt-print-hq / escpos-tools

Utilities to read ESC/POS print data
MIT License
200 stars 73 forks source link

Add support for user-defined character sets #63

Open mike42 opened 5 years ago

mike42 commented 5 years ago

Example file: unifont-print-buffer.bin

This contains the text "Hello World", rendered with a user-defined character set.

2019-10-unifont-example

We first need to detect/skip these commands correctly, then add substitution characters, then finally the correct bitmaps. Size/orientation is not required to close this issue off.

$ php esc2text.php unifont-print-buffer.bin 
WARNING: Unknown command ESC %
WARNING: Unknown command ESC &
WARNING: Unknown command ESC &
WARNING: Unknown command ESC &
WARNING: Unknown command DLE 
WARNING: Unknown command ESC &
WARNING: Unknown command ESC %
WARNING: Unknown command ESC &
WARNING: Unknown command ESC &
WARNING: Unknown command ESC &
 ⁿÇÇÇÇⁿ !°DDDD╚!"ⁿ""#°°#
$ⁿ0└└0ⁿ$#%ⁿÇ%"&ⁿ&
blapid commented 4 years ago

Hi! Thank you for this tool, it has been very useful for us. We've followed this post[0], but as mentioned in this issue, user-defined-character-sets do not seem to print. In addition, inline images do not seem to work (they force a new line after the previous text, and ignore additional text until a line-feed is given). Any chance a fix is coming? 🤞 [0] https://mike42.me/blog/2018-03-how-to-print-custom-currency-symbols-on-a-receipt-printer