feat: warn when a ZPL font has no mapping instead of substituting silently - #20
Open
mircis-stan wants to merge 1 commit into
Open
feat: warn when a ZPL font has no mapping instead of substituting silently#20mircis-stan wants to merge 1 commit into
mircis-stan wants to merge 1 commit into
Conversation
GOODBOY008
force-pushed
the
feat/warn-on-unmapped-font
branch
from
July 15, 2026 07:13
985d966 to
7c11943
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the renderer’s ZPL font-to-TTF mapping behavior so that genuinely unmapped ZPL font names emit a warning instead of silently substituting a fallback font, helping catch wrong-font layout regressions earlier.
Changes:
- Adds explicit handling for the remaining Zebra-resident fonts to keep intentional substitutions quiet.
- Emits a warning to stderr when an unrecognized/unmapped ZPL font name is encountered, before substituting DejaVu Sans Mono.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+720
to
+726
| _ => { | ||
| eprintln!( | ||
| "labelize: no mapping for ZPL font '{}'; substituting DejaVu Sans Mono (layout may differ)", | ||
| name | ||
| ); | ||
| FONT_DEJAVU_MONO | ||
| } |
…ently An unknown font name (a ^CW-loaded letter, or garbage from malformed input) currently falls back to DejaVu Sans Mono with no signal, so a wrong-font layout regression is invisible until someone looks at the output. Known resident fonts keep their intentional substitutions without noise.
GOODBOY008
force-pushed
the
feat/warn-on-unmapped-font
branch
from
July 16, 2026 01:44
7c11943 to
af90de2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An unknown font name (a
^CW-loaded letter, or garbage from malformed input) falls back to DejaVu Sans Mono with no signal, so a wrong-font layout regression is invisible until a human looks at the output — that's how the #18 bug went unnoticed. Known resident fonts (A, C, E–H, R, T–Z) keep their intentional substitution without log noise; only genuinely unmapped names warn.