BinaryKits.Zpl icon indicating copy to clipboard operation
BinaryKits.Zpl copied to clipboard

Viewer default fonts not displayed as expected

Open nnaku opened this issue 1 year ago • 3 comments

I'm currently hosting dockerized Viewer from arm mac and default font seem to be wrong for me.

Docker image it self only contains dejavu font in usr/shared/font

image

nnaku avatar Dec 15 '23 20:12 nnaku

Right, it is not 100% matching. Same on our viewer online https://binarykits-zpl-viewer.azurewebsites.net/ (Examle 9)

YipingRuan avatar Dec 18 '23 14:12 YipingRuan

The default fontface is Helvetica Narrow (Semi-Condensed) Bold for font 0, and DejaVu Sans Mono for all others: https://github.com/BinaryKits/BinaryKits.Zpl/blob/8381d676916a820ac80cd819152b57acf63107e6/src/BinaryKits.Zpl.Viewer/ElementDrawers/DrawerOptions.cs#L24-L32 I suspect the first of those may not be installed on the target system. image

Of course, extracting the "Swiss 721" font from a Zebra printer and using that in your application will give a much better result: image

primo-ppcg avatar Dec 19 '23 05:12 primo-ppcg

Well each printer could use what ever font, and therefore is impossible to please every one. For example I'm currently working with honeywell/datamax printer, which has their own defaults.

What do you think is it possible to implement feature that enables to setup custom fonts from per environment.

for example for docker api could be something like

# docker-compose.yml
zpl-viewer:
  image: yipingruan/binarykits-zpl:latest
  ports:
    - '40080:80'
  environment:
    FONT_0: ./../fonts/...ttf
    FONT_A1: ./../fonts/DejaVuSansMono.ttf

I have zero experience with C# so this might sound that I'm just asking features, but I can try to help as much as I can, if it's needed.

nnaku avatar Dec 19 '23 08:12 nnaku