Add builtin glyph support for block sextants (U+1FB00-1FB3B)#19841
Add builtin glyph support for block sextants (U+1FB00-1FB3B)#19841cool-RR wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Implements pixel-perfect rendering for the 60 block sextant characters from Unicode's Symbols for Legacy Computing block. These are 2x3 grid patterns used for high-resolution terminal graphics. The implementation uses the existing instruction-based system: - Added Pos_1_3 and Pos_2_3 position constants for 1/3 divisions - Each sextant is rendered as 1-3 horizontal bars (row-based merging) - Patterns that duplicate existing glyphs are excluded: - Pattern 0 (empty) -> space - Pattern 21 (left half) -> U+258C - Pattern 42 (right half) -> U+2590 - Pattern 63 (full) -> U+2588 This enables gap-free sextant animation in terminal applications. Addresses issue microsoft#18498.
|
@lhecker Can you please enable CI run on this? Not ready for review yet. |
(If it's not ready for review, why would it be ready for CI?) |
|
Because I got errors trying to build it locally, and I want to get the CI to build it instead. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
|
So, what errors did you get while trying to build it locally? |
| // Symbols for Legacy Computing: Block Sextants (U+1FB00-1FB3B) | ||
| // 2x3 grid of cells numbered: | ||
| // 0 1 (top row: y = 0 to 1/3) | ||
| // 2 3 (middle row: y = 1/3 to 2/3) | ||
| // 4 5 (bottom row: y = 2/3 to 1) |
There was a problem hiding this comment.
The glyphs follow a predictable binary pattern. It makes more sense in my opinion to refactor the rasterization logic to dispatch to a specialized version which algorithmically draws the blocks.
This technically results in the issue of determining the minimum rectangle cover (to emit rectangle draw calls; polynomial solutions exist). But given that we only have 2^6-2 glyphs I believe hardcoding the rectangles in a bitfield would be feasible. There are only 15 unique rectangles here, fitting into a uint16_t.
Summary of the Pull Request
Adds pixel-perfect rendering for the 60 block sextant characters (U+1FB00-1FB3B) from Unicode's Symbols for Legacy Computing block. These are 2x3 grid patterns used for high-resolution terminal graphics (e.g. terminal animations, TUI dashboards).
Without builtin glyph support, sextants are rendered via DirectWrite using the font's glyph. The font glyph's tight bounding box doesn't cover the full cell height, which causes visible horizontal lines of background color bleeding between vertically adjacent cells when sextants are used for seamless graphics.
The implementation uses the existing instruction-based system:
Pos_1_3andPos_2_3position constants for 1/3 divisionsReferences and Relevant Issues
Addresses #18498
Detailed Description of the Pull Request / Additional comments
The sextant characters divide a cell into a 2×3 grid of sub-cells:
Each character has a 6-bit pattern where bit N indicates sub-cell N is filled. Adjacent filled sub-cells in the same row are merged into a single horizontal bar to minimize draw calls.
Validation Steps Performed
PR Checklist