Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Viewer default fonts not displayed as expected #204

Open
nnaku opened this issue Dec 15, 2023 · 3 comments
Open

Viewer default fonts not displayed as expected #204

nnaku opened this issue Dec 15, 2023 · 3 comments

Comments

@nnaku
Copy link

nnaku commented Dec 15, 2023

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 nnaku changed the title Viewer uses windows fonts? Viewer default fonts not displayed as expected Dec 15, 2023
@YipingRuan
Copy link
Contributor

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

@primo-ppcg
Copy link
Collaborator

primo-ppcg commented Dec 19, 2023

The default fontface is Helvetica Narrow (Semi-Condensed) Bold for font 0, and DejaVu Sans Mono for all others:

if (fontName == "0")
{
//typeface = SKTypeface.FromFile(@"swiss-721-black-bt.ttf");
typeface = SKTypeface.FromFamilyName("Helvetica", SKFontStyleWeight.Bold, SKFontStyleWidth.SemiCondensed, SKFontStyleSlant.Upright);
}
else
{
typeface = SKTypeface.FromFamilyName("DejaVu Sans Mono", SKFontStyleWeight.Normal, SKFontStyleWidth.Normal, SKFontStyleSlant.Upright);
}

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

@nnaku
Copy link
Author

nnaku commented Dec 19, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants