BinaryKits / BinaryKits.Zpl

BinaryKits.Zpl a set of .net libraries. The project supports you in the simple creation of zebra labels. It generates the ZPL data, it is a printer description language from Zebra Technologies. ZPL II is now emulated by many label printers from different manufacturers. So with this implementation you can create labels for most printers.
MIT License
307 stars 112 forks source link

Added: Font fallback structure for the default fonts. #217

Closed daanggc closed 5 months ago

daanggc commented 6 months ago

I ran into the same issue as #204; the dockerized environment is missing the required fonts, and getting those there is a pain.

So I made a fallback structure that looks for available fonts in the following order:

For the monospace fonttype it is:

Now you get a close result on most environments. Especially the docker container can profit from this, with the command apt install fonts-roboto you can use Roboto Condensed and that should give this result:

image
primo-ppcg commented 6 months ago

This is a good idea. Though, I would change the following:

For the monospace fonttype it is:
+ - DejaVu Sans Mono
  - Courier
  - Courier New
  - System fallback for DejaVu Sans Mono

possibly swapping the order of Courier and Courier New.

daanggc commented 6 months ago

This is a good idea. Though, I would change the following:

For the monospace fonttype it is:
+ - DejaVu Sans Mono
  - Courier
  - Courier New
  - System fallback for DejaVu Sans Mono

possibly swapping the order of Courier and Courier New.

I agree and have updated the code.

daanggc commented 6 months ago

I also added the font install command to the docker file and with the antialiasing from PR #218, the docker container produces this result:

image