cd /news/large-language-models/generate-fonts-where-every-llm-token… · home › topics › large-language-models › article
[ARTICLE · art-139970] src=ampdot.mesh.host ↗ pub= topic=large-language-models verified=true sentiment=· neutral

Generate fonts where every LLM token is the same width

A new token-space font compiler generates TTF fonts in which every LLM token renders at the same width, built from a font plus a tokenizer such as DeepSeek V4.1 Flash's byte-level BPE pre-tokenizer. The tool ships with setup instructions for Discord via Vesktop and for Slack via a userscript, and it rejects other uploaded pre-tokenizers, text normalizers, WordPiece and Unigram with a clear error. The compiler outputs a single TTF with the tokenizer embedded in its shaping rules, letting users see how a model segments text.

read5 min views1 publishedSep 26, 2026

font + tokenizer → token-space font, where each token is equal width

Try it! #

Type or paste your text above. Compiling a new font switches this preview to it.

Compile your own #

[Download font](token-space-fonts/compiler/default.ttf?v=pathways2)
        ·
        [CSS](token-space-fonts/compiler/default.css)
        ·
        [Build report](token-space-fonts/compiler/default-build.json)

Use it in Discord with Vesktop #

Theme font: DeepSeek V4.1 Flash × Inter

Leave blank to apply to all messages. We strongly recommend entering a specific em’s ID so only its messages use the token font.

Setup instructions #

              To use gg sans, select **gg sans (Discord)** above,
              choose a tokenizer preset or upload, and click**Compile font** . The theme download always matches
              the font currently in the preview.
  1.        Download the font and open the TTF in Font Book. Click
           **Install** . Install the compiled font, even if you
           already have ordinary gg sans.
    
              We strongly recommend entering a specific em’s Discord ID above;
              leaving it blank applies to all messages. Download the
              `.theme.css` file. To find an ID, enable Discord’s**Settings → Advanced → Developer Mode** , then
              right-click the user and choose**Copy User ID** .
              If you entered an ID, open Vesktop’s
              **Settings → Vencord → Plugins** and
              enable[ThemeAttributes](https://vencord.dev/plugins/ThemeAttributes) . Restart if prompted.
  1.        Open
           **Settings → Vencord → Themes → Local Themes → Open Themes
             Folder** . Move the downloaded`.theme.css` file into that
           folder. Return to Themes, click**Load Missing Themes** if needed, and enable the
           theme.
    
  2.        Fully quit Vesktop with **⌘Q** and reopen it so it
           sees the installed font.
    

Keep Vencord Location at its current setting. This is a theme, so no custom Vencord build or UserFonts plugin is needed. Disable older font themes for the same user if they conflict.

If messages look unchanged, check that the compiled font is installed and this theme is enabled. If targeting an ID, also check that ThemeAttributes is enabled and the ID is correct. Code blocks keep Discord’s normal monospace font. Extra token spacing defaults to zero; line height and word spacing follow Discord.

Use it in Slack #

Slack font: DeepSeek V4.1 Flash × Inter

Use the exact display name shown above each agent’s messages, or a Slack member ID such as U012345678. One per line. Only matching messages change.

Setup instructions #

  1. Download the font above and install its TTF on the device where you read Slack.
  2. Enter the agents’ Slack display names or member IDs, then download the .user.js file.
  3. Import the file into a userscript manager in your browser, enable it, and reload web Slack.

The userscript reads sender labels in the page and styles matching message text, including new messages and threads. It makes no network requests and does not modify message text. Code blocks keep a monospace font. If you compile another font, download and install that font and its newly generated userscript together. Disable an older Token Mono Slack script if it targets the same agent.

This works in web Slack in a browser with a userscript manager. Browser shaping runs and formatting spans can change token boundaries.

What works? #

      Byte-level BPE with DeepSeek V4.1 Flash’s pre-tokenizer, or a
          ByteLevel pre-tokenizer with `use_regex: false` and
          `add_prefix_space: false`. Other uploaded pre-tokenizers, text
          normalizers, WordPiece and Unigram produce a clear error. The ctok preset
          uses a separate minimum-cost backend.

The output is a single TTF with the tokenizer built into its shaping rules. No tokenizer script is needed to display it. It uses your font’s default variation and character coverage. Missing characters use its missing-glyph outline; no other typeface is mixed in.

Each token is 3 em wide. Extra token spacing defaults to zero and is capped at 0.5 em. The CSS leaves word spacing and line height alone.

N.B. Browser shaping runs, line breaks, normalization and complex scripts can change the result. Supported horizontal pair kerning is retained, but contextual shaping is not universally preserved. This is a token font, not an exact whole-message token counter.

Known discrepancies and experimental features #

**GLM-5.3 and LLaMa 3:** the audited raw-BPE conversions
            lose merge paths, pre-tokenizer boundaries and whole-piece shortcuts.
            Both differed from their references on all 5,493 Gutenberg passages
            tested (at least one token differed per passage, not every token).
            GLM remains an approximation. LLaMa 3 is audit-only and has no working
            preset here yet. The replacement backend is still a prototype.

Claude / ctok: ctok is an unofficial approximation, not a verified implementation of Claude’s tokenizer. The full ctok vocabularies now fit, but the shipped minimum-cost backend has a 256-step search limit per connected component and displays[limit] on overflow. Long wrapped text can still render slowly. Passing ctok comparisons does not establish agreement with Claude. #

Normalization and Unicode: a renderer can normalize text before the font sees it, changing token boundaries. General combining sequences remain limited. Qwen’s NFC support handles at most eight consecutive nonstarters after decomposition and displays[NFC limit] beyond that. Browser and native compiler Unicode versions can also differ for newly assigned characters. #

Rendering and font coverage: fonts cannot tokenize across separate shaping runs. Formatting, links, script changes, bidirectional text, fallback fonts and hard breaks can split those runs. Missing source-font glyphs and fallback may defeat equal token

            widths; complex-script shaping, ligatures and mark positioning are
            not universally preserved. Single-run tests do not guarantee identical
            results in every browser or app.

Message counts: special tokens, chat templates, multimodal content and automatic message overhead are not universally represented. Empty text cannot draw a framing token. These fonts visualize ordinary text, not exact API billing counts.

See the [detailed discrepancy tracker](token-space-fonts/compiler/discrepancies.md)
          for test results, repaired issues and remaining limitations.

        Compiled locally with
        [Pyodide](https://pyodide.org/en/0.29.2/) and
        [fontTools](https://fonttools.readthedocs.io/).
        [Inter license](token-space-fonts/licenses/OFL-Inter.txt).
      

<sup>[1](#font-expertise-reference)</sup>
        If you have more expertise in how fonts work, I encourage you to implement this project properly.
── more in #large-language-models 4 stories · sorted by recency
── more on @deepseek v4.1 flash 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/generate-fonts-where…] indexed:0 read:5min 2026-09-26 · —