eliasweingaertner / peripage-A6-bluetooth

Directly printing on a Peripage A6 thermal printer via Bluetooth
MIT License
68 stars 11 forks source link

Add initial support for text print #2

Open migonzalvar opened 3 years ago

migonzalvar commented 3 years ago

Thank you for your work @eliasweingaertner

I've done some preliminary work to implement text print in this pull request.

If you are open to accept contributions I could complete the documentation.

eliasweingaertner commented 3 years ago

Thank you for your interest and your motivation to contribute! I need to test your PR later today in detail. If it works, chances are likely we'll merge your image-based text print just using minor changes.

Still, some preliminary comment:

When I wrote text print in the README.MD file, I actually meant something else: The printer actually supports text to be directly printed without the need of generating an image. The script already contains some code to print RAW text (see also the discussion #1 ). The entry in the README was referring to this. While this allows you to print text already, the question is: Can we adjust the font size/font face?

migonzalvar commented 3 years ago

Can we adjust the font size/font face?

Currently, the font face and size are hard coded. I also included an autoscale feature: if the resulting image is wider than 384 pixels, the image is scaled down.

If you agree, I can add two more options --font and --size with sensible defaults.