npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@luma.gl/text

v9.4.2

Published

2D and 3D text utilities for luma.gl

Readme

@luma.gl/text

Experimental 2D text utilities for luma.gl. The package contains:

  • FontAtlas, the normalized glyph metrics, image pages, and sampling settings used by atlas-backed text.
  • buildBitmapFontAtlas() and buildSdfFontAtlas(), explicit browser-font atlas builders.
  • GPUTextData, caller-owned prepared text resources with representation-independent statistics.
  • TextRenderer, a stable facade that borrows GPUTextData and selects an internal model.
  • An @luma.gl/text/experimental entry point for forced strategies and low-level benchmarks.

Usage

import {TextRenderer, type GPUTextData} from '@luma.gl/text';

// GPUTextData is caller-owned and prepared by an application adapter.
const data: GPUTextData = getPreparedTextData();
const renderer = new TextRenderer(device, {data});

renderer.draw(renderPass);

// Destroy borrowing models before caller-owned data.
renderer.destroy();
data.destroy();

Each GPUTextData owns one batch's uploaded and generated GPU resources while borrowing shared GPUTextResources. TextRenderer and its internal render and picking models borrow both.

Automatic strategy selection uses attributes for WebGL, per-character colors, and fallback; dictionary storage for supported WebGPU dictionary input; and storage for other supported WebGPU text. Row-indexed storage is available only through @luma.gl/text/experimental until benchmark data supports an automatic-selection heuristic.

GPUTextData.stats reports the selected strategy, row and glyph counts, preserved source and render batch counts, preparation time, retained bytes, and transient compute-input bytes without exposing implementation buffers.

Atlas-backed text consumes the common FontAtlas format. Build generated browser-font atlases with buildBitmapFontAtlas() or buildSdfFontAtlas(). Build or load BMFont JSON MSDF atlases with buildMsdfFontAtlas() or loadMsdfFontAtlas().

Text input vector support:

| Input Vector | Attribute State | Storage State | | --- | --- | --- | | positions | GPUVector<'float32x2'> | GPUVector<'float32x2'> | | texts | GPUVector<ValueList<'uint8'> \| Int> | GPUVector<ValueList<'uint8'> \| Int> | | colors? | GPUVector<'unorm8x4' \| VertexList<'unorm8x4'>> | GPUVector<'unorm8x4'> | | angles? | GPUVector<'float32'> | GPUVector<'float32'> | | sizes? | GPUVector<'float32'> | GPUVector<'float32'> | | pixel offsets? | GPUVector<'float32x2'> | GPUVector<'float32x2'> | | clip rects? | Expanded into generated per-glyph vertex data. | Packed into row storage. | | text anchors? | Custom label attribute/shader responsibility. | GPUVector<'uint8'> | | alignment baselines? | Custom label attribute/shader responsibility. | GPUVector<'uint8'> |

Text column support:

| Text Vector | Attribute State | Storage State | Dictionary State | | --- | --- | --- | --- | | Vector<Utf8> | Supported | Supported | Not supported | | Vector<Dictionary<Utf8, Int8 \| Int16 \| Int32 \| Uint8 \| Uint16 \| Uint32>> | Supported | Supported | Supported with compressed dictionary glyph storage |

Text draw buffers:

| Buffer | Attribute Model | Storage Model | Description | | --- | --- | --- | --- | | row positions | vertex | row | Per-label anchor positions for the currently bound input rows or storage batch. | | row colors | vertex | row | Optional packed RGBA8 per-label colors, or a one-row storage fallback buffer. | | row angles | vertex | row | Optional per-label rotation angles, or a one-row storage fallback buffer. | | row sizes | vertex | row | Optional per-label text sizes, or a one-row storage fallback buffer. | | row pixel offsets | vertex | row | Optional per-label pixel offsets, or a one-row storage fallback buffer. | | row clip rects | - | row | Optional packed Int16[4] clip rectangles remain row storage in the storage model; the attribute model expands them into expandedGlyphVertexData. | | expandedGlyphVertexData | vertex | - | Expanded per-glyph vertex payload for the attribute model: model-generated offsets, inline glyph frames, and global source-row ids. | | compactGlyphVertexData | - | vertex | Compact text-storage glyph payload: packed offsets, glyph ids, and optional global source-row ids. | | glyph frames | vertex | data | Per-glyph atlas frame attributes in the attribute model; shared atlas-frame storage indexed by glyph id in the storage model. | | atlas texture | data | data | Font atlas sampled by the fragment shader. | | sampler | data | data | Sampler paired with the atlas texture. | | style config uniform | - | data | Per-draw fallback style values, row-style presence flags, clip flag, row bases, and font alpha settings. |

getGpuUtf8MapShaderSource() and getGpuUtf8MapShaderBindings() expose reusable WebGPU UTF-8 mapping helpers. Consumers can compose sparse UTF-8 byte traversal, code point decode, and lookup-table mapping into text-oriented compute shaders.