Conversation
Contributor
There was a problem hiding this comment.
2 issues found across 7 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="lib/font/table_glyf.js">
<violation number="1" location="lib/font/table_glyf.js:103">
P1: LSB byte reordering can corrupt glyph header bits when pixel data starts mid-byte, because whole bytes are reordered without verifying byte alignment.</violation>
<violation number="2" location="lib/font/table_glyf.js:123">
P2: `pixel_order='LSB'` is only handled in raw glyph storage; when compression is enabled, the option is silently ignored instead of being rejected.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Add a --pixel-order CLI parameter (MSB/LSB, default MSB) to control the pixel bit arrangement within each byte of glyph bitmap data. Some embedded LCD controllers require LSB-first pixel ordering. This option enables direct compatibility without post-processing. - Implement byte-level pixel bit reordering in lib/pixel_order.js - Integrate into glyph table generation (storePixelsRaw) - Add LSB/compression mutual exclusion validation - Support all BPP configurations (1, 2, 4, 8) - Add comprehensive property-based tests using fast-check - Maintain backward compatibility (MSB as default) Change-Id: Id677ae17b0fb14d13553456793f7dd73968ba9a6
hellsge
force-pushed
the
feat/pixel-order
branch
from
April 17, 2026 10:41
1256edb to
c0a47c6
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.
Summary
Add a
--pixel-orderCLI option to control pixel bit arrangement within each byte of glyph bitmap data. Defaults toMSB(current behavior), withLSBas a new option.Motivation
Some embedded LCD controllers (e.g., SSD1306 in page-addressing mode, certain SPI-driven monochrome displays) expect pixel data in LSB-first bit ordering. Currently, users must post-process the font output to reverse bit order per byte, which is error-prone and adds complexity to the build pipeline.
This option enables direct compatibility without post-processing.
Changes
lib/pixel_order.jslib/font/table_glyf.jsstorePixelsRaw()lib/cli.js--pixel-order {MSB,LSB}argument with validationtest/test_pixel_order.jstest/test_cli.jspackage.jsonfast-checkto devDependencies (property-based testing)Design decisions
BitStreamlogic untouched. This minimizes risk to existing functionality.Usage
Testing
fast-checkcovering all BPP × order combinationsNotes
package-lock.jsonhas minor"peer": truefield removals due to npm version differences. The only actual dependency additions arefast-checkand its dependencypure-rand.Summary by cubic
Add a
--pixel-orderCLI option to control per-byte pixel bit order in glyph bitmaps. Default staysMSB;LSBis available for devices that read LSB-first.New Features
--pixel-order {MSB,LSB}to choose pixel bit ordering when packing glyphs.--pixel-order LSBwith compression; use with--no-compress.Migration
--pixel-order LSB --no-compress.Written for commit c0a47c6. Summary will update on new commits.