chenglou

    chenglou/pretext

    Fast, accurate & comprehensive text measurement & layout

    51.1K stars
    2.8K forks
    134 GitHub watchers
    Updated Nov 19, 2026
    View on GitHub

    Build with Backblaze B2

    SDKs, agent skills, IDE extensions, and reference pipelines from Backblaze Labs. All open source.

    Explore Backblaze Labs

    Loading star history...

    Where it stands

    Rank, growth pace and release cadence relative to everything GStars tracks.

    1 release in the last 90 days, the latest 35 days ago, with 9 contributors on GitHub.

    Use Cases & Benefits

    • Provides fast, accurate multiline text measurement and layout in JavaScript/TypeScript without triggering browser layout reflows.
    • Avoids expensive DOM reflows by using canvas-based text measurement and precomputed layouts for efficient rendering and virtualization.
    • Use for calculating text block heights in dynamic web UIs to enable precise virtualization and prevent layout shifts on content changes.
    • Use for manual line-by-line text layout in canvas, SVG, or WebGL rendering contexts where custom text flow and wrapping are required.
    • Use for rich inline text flow with atomic elements like chips or mentions, supporting complex UI components with precise text measurement.

    Should you depend on it?

    License terms, project hygiene and risks, from GitHub metadata and GStars' snapshots.

    License

    Other

    GitHub could not identify this license; read the LICENSE file before depending on it.

    Watch-outs

    • License not identified by GitHub; read the LICENSE file before depending on it.

    General guidance from repository metadata, not legal advice. How we score

    About pretext

    Fast, accurate & comprehensive text measurement & layout

    https://chenglou.me/pretext/

    Daily snapshots

    Stars gained per day, and how forks and open issues moved, from GStars' daily snapshots

    Forks

    2.8K+23

    Open issues

    64-27

    Compared with peers in Web

    Fastest-growing repositories GStars tracks in this cohort for the week of Nov 22, by 7-day star growth

    chenglou/pretext compared with Web repositories by stars, 7-day star growth, health score and last release
    RepositoryStars+7dHealthLast release
    pingdotgg/t3code71.6K+10.1K40today
    dream-num/univer31.3K+5.6K651 day ago
    pbakaus/impeccable115.0K+4.3K35today
    meta/astryx32.2K+3.4K652 days ago
    GoogleChrome/modern-web-guidance-src10.2K+3.0K6339 days ago
    chenglou/pretext51.1K—2935 days ago
    Category median32.2K+4.3K63—

    Discover Repositories

    Search across tracked repositories by name or description