Skip to content

perf(rendering): draw each row of a glyph's pixels as one rectangle - #1042

Open
ugcodrr wants to merge 8 commits into
mainfrom
fix/glyph-runs
Open

ugcodrr wants to merge 8 commits into
mainfrom
fix/glyph-runs

Conversation

@ugcodrr

@ugcodrr ugcodrr commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Description: Drawing text read each glyph's pixels from the font atlas for every character, then added a four-point path for every opaque pixel.

  1. Each glyph's pixels are now read once per font instead of once per character.
  2. At fractional text sizes, anti-aliased edges can move by up to 2 color levels.

Drawing the BedWars card on the M5 went from 4.2 to 2.6 ms with the default font, 7.4 to 3.1 ms with HD, and 11.4 to 4.9 ms with FPack.

Merge order for the perf PRs is in #1002.

Testing: /bedwars anrie looks the same.

Supersedes #1004

@vercel

vercel Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
statsify Ignored Ignored Nov 5, 2026 5:33am UTC

…racter

getImageData on a font atlas rasterises the whole atlas, and fillCharacter called it for
every character drawn, which was most of a card's render time. Each renderer now keeps a
glyph's ImageData after the first read, keyed by the character, and drops them when its
atlases are reloaded. The pixels are only read, never changed, so output is identical.
@vercel

vercel Bot commented Nov 2, 2026

Copy link
Copy Markdown

Deployment failed for project statsify with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/statsify-net?upgradeToPro=build-rate-limit

@vercel

vercel Bot commented Nov 3, 2026

Copy link
Copy Markdown

Deployment failed for project statsify with the following error:

Too many requests - try again in 5 minutes (more than 60, code: "api-deployments-flood").

Learn More: https://vercel.com/docs/limits#rate-limits

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant