You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Font D diffs (kmart, dpdpl, dhlparceluk) are driven by glyph shape mismatch — DejaVu Mono Bold's outlines don't resemble Zebra's built-in bitmap Font D characters at all. Replacing the backing font with one whose glyphs actually match Zebra's pixel patterns reduces this diff.
Changes
scripts/generate_zebra_font_d.py — fonttools-based generator that encodes pixel-accurate 12×14–17 bitmaps (uppercase, digits, punctuation) as filled TrueType rectangles. Characters extracted pixel-by-pixel from Labelary reference images (testdata/kmart.png); remaining characters designed in the same style with accurate 2-pixel-wide strokes matching Zebra Font D. Font metrics are intentionally kept identical to DejaVu Mono Bold (UPM=2048, ascent=1901, descent=-483, h_advance=1233) so the existing 2.317 advance-width ratio calibration in font.rs requires no changes.
Key generator fixes:
Corrected Y_SCALE: ab_glyph uses v_scale_factor = scale.y / height_unscaled where height_unscaled = ascent − descent = 2384, not UPM. The old formula rendered each bitmap row at 0.859 px instead of 1 px. Fixed to Y_SCALE = 2384 / (18 × 7/6) ≈ 113.52.
Accurate 2-pixel-wide stroke bitmaps for all uppercase letters and digits extracted from the kmart Labelary reference.
( and ) extended to 17 rows to match the reference descender zone.
src/assets/fonts/ZebraFontD.ttf — Regenerated font embedded as a static asset (~38 KB).
@copilot adjust the new font to enhance the diff report
Done in commit 507f81a. Two improvements were made:
Fixed Y_SCALE formula: ab_glyph uses v_scale_factor = scale.y / height_unscaled where height_unscaled = ascent − descent = 2384, not UPM. The old formula gave 0.859 px/row instead of 1 px — characters were rendering shorter and blurry at row boundaries. Fixed to Y_SCALE = 2384 / (18 × 7/6) ≈ 113.52.
Accurate 2-pixel-wide stroke bitmaps: Extracted all uppercase letters and digits pixel-by-pixel from the kmart Labelary reference. Zebra Font D uses 2-pixel-wide strokes throughout — H, N, L, P, T, I, E, C, D, G, O, R, S and the digits were all updated. ( and ) were extended to 17 rows to match the reference.
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
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.
Font D diffs (kmart, dpdpl, dhlparceluk) are driven by glyph shape mismatch — DejaVu Mono Bold's outlines don't resemble Zebra's built-in bitmap Font D characters at all. Replacing the backing font with one whose glyphs actually match Zebra's pixel patterns reduces this diff.
Changes
scripts/generate_zebra_font_d.py— fonttools-based generator that encodes pixel-accurate 12×14–17 bitmaps (uppercase, digits, punctuation) as filled TrueType rectangles. Characters extracted pixel-by-pixel from Labelary reference images (testdata/kmart.png); remaining characters designed in the same style with accurate 2-pixel-wide strokes matching Zebra Font D. Font metrics are intentionally kept identical to DejaVu Mono Bold (UPM=2048,ascent=1901,descent=-483,h_advance=1233) so the existing2.317advance-width ratio calibration infont.rsrequires no changes.Key generator fixes:
Y_SCALE:ab_glyphusesv_scale_factor = scale.y / height_unscaledwhereheight_unscaled = ascent − descent = 2384, not UPM. The old formula rendered each bitmap row at 0.859 px instead of 1 px. Fixed toY_SCALE = 2384 / (18 × 7/6) ≈ 113.52.(and)extended to 17 rows to match the reference descender zone.src/assets/fonts/ZebraFontD.ttf— Regenerated font embedded as a static asset (~38 KB).src/assets/mod.rs— ExposesFONT_ZEBRA_Dstatic byte slice.src/drawers/renderer.rs— Routes font name"D"toFONT_ZEBRA_Dinstead of DejaVu Mono Bold:Diff impact