Do not include ZLIB header or checksum bytes in compressed glyphs

This commit is contained in:
Dave Allie
2026-01-05 22:58:42 +11:00
parent cb3e08e73c
commit c9cfedf3d6
55 changed files with 194408 additions and 203450 deletions

View File

@@ -241,7 +241,8 @@ for i_start, i_end in intervals:
# Build output data
packed = bytes(pixels)
compressed = zlib.compress(packed)
# DEFLATE compressed data without zlib header/footer
compressed = zlib.compress(packed, wbits=-15)
is_compressed = len(compressed) < len(packed) * 0.9
# Use compressed data only if it's at least 10% smaller
if is_compressed: