Skip to content

fix(gpu): span Nerd Font icons across two cells when room allows - #85

Closed
piny4man wants to merge 1 commit into
mainfrom
fix/gpu-icon-two-cells
Closed

piny4man wants to merge 1 commit into
mainfrom
fix/gpu-icon-two-cells

Conversation

@piny4man

Copy link
Copy Markdown
Owner

Fixes NUKE-102: GPU icons rendered at about half the text height because every private-use glyph was fitted into one text cell (cw − 3 × h − 3), so the text face's advance width decided icon size.

Change

  • GlyphKey gains a GlyphSpan (Single/Left/Right). The two halves of a wide icon are separate atlas tiles, distinct from the one-cell form.
  • FontSet::coverage_span rasterizes an icon into a 2·cw × h tile and returns the requested half. Text ignores the span. With no icon font, the square badge stays in the left cell.
  • grid::glyph_tiles decides the span: an icon whose next cell is blank and inside the grid spans two cells, and anything else stays one cell. Glyph lists are row-major, so the check only looks at the next entry.
  • CellRenderer::draw uses it, so the native and Rio frontends both get the fix. The external tui is unchanged.

Validation

  • cargo fmt --all -- --check, cargo clippy --all-targets --all-features -- -D warnings, cargo build --all-targets, cargo test --all: all green.
  • New tests:
    • atlas half keys;
    • the wide icon is larger than the one-cell fit, centred and never clipped;
    • text and the badge ignore the span;
    • span selection: blank neighbour, occupied neighbour, grid edge, next row, text.
  • Not done: a visual check on Hyprland at font size 25.

Both GPU frontends fitted every private-use icon into one text cell, so
the text face's advance width, not the icon, decided its size: at font
size 25 icons rendered at roughly half the text height (NUKE-102).

An icon whose right-hand neighbour is blank (the launcher always writes
"icon name") is now rasterized across two cells and drawn as two atlas
tiles, like a double-width glyph in a terminal. Icons with an occupied
neighbour or at the grid edge keep the one-cell fit, and the procedural
badge shown without an icon font stays one square cell.
@piny4man piny4man closed this Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant