logo
Kurashizu Blogwhere ideas flow
  • Home
  • News
  • Blog
  • About
  • Home
  • News
  • Blog
  • About

© 2026 Kurashizu. All rights reserved.

Admin·New Post·Service Status
Powered by Cloudflare·02.11.26
← Back to news

Jim's TrueType QR Code Font

Original article
github.com|25 points|1 comments|by arantius|Jul 7, 2026

Jim's TrueType QR Code Font

This project, hosted by jimparis on GitHub, provides an experimental OpenType font capable of transforming specific text strings into functional QR code symbols.

🌐 Live Demo: https://qr.jim.sh/


📦 Available Font Versions

Depending on the required data capacity, there are three distinct font files available for download:

Font FileModule DimensionsMaximum Character Capacity
qrfont-1L.ttf21×2121 \times 2121×2117 characters
qrfont-2L.ttf25×2525 \times 2525×2532 characters
qrfont-3L.ttf29×2929 \times 2929×2953 characters

🛠️ How It Works

The font is designed to identify text wrapped in brackets and render that specific segment as a QR code, while leaving the surrounding text as standard, readable characters.

Example Input: abc[hello]ghi Result: The characters abc and ghi appear normally, but [hello] is rendered as a QR code symbol.

Technical Specifications

  • Input Type: Printable ASCII.
  • Encoding Mode: Byte mode.
  • Masking: Uses a fixed mask pattern 0.
  • Delimiters: [ and ] are used to trigger the QR generation.
  • Creation Method: These fonts are hand-authored →\rightarrow→ programmatically generated.

The Generation Pipeline

The build process utilizes a script to create glyph outlines and GSUB (Glyph Substitution) feature logic.


🏗️ Build Instructions

The project leverages uv for managing Python dependencies.

Installation & Compilation

To build the font, you can use the following methods:

  • Standard Build: Run make
  • Direct Python Execution: uv run tools/build_font.py

[!NOTE] By default, the generator looks for the base font at: /usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf

If you wish to use a different TrueType source, use the --base-font flag: uv run tools/build_font.py --base-font /path/to/BaseFont-Regular.ttf

Build Variants

Depending on your needs, you can choose between two build paths:

  1. Full Parity: make full-parity
    • Detail: Generates thousands of contextual lookups.
    • Performance: Takes significantly longer to compile.
  2. Fast Placeholder: make fast-placeholder
    • Detail: Uses placeholder zero parity for rapid layout testing.

Debugging

To analyze the shaped glyph stream, execute: uv run tools/shape_debug.py ' [a] ' ' [b] '


📤 Project Outputs

Upon a successful build, the following files are generated in the dist/ and build/ directories:

  • dist/qrfont-*.ttf: The actual font files (1-L, 2-L, 3-L).
  • dist/index.html: An interactive web-based demonstration.
  • build/qrfont-*.fea: The OpenType feature files.

QR Font Concept


⚖️ Licensing & Requirements

The resulting fonts are considered a Modified Version of Liberation Sans Regular. Consequently, they are licensed under the SIL Open Font License, Version 1.1.

Critical Requirements:

  • Shaping Engine: Because the font relies heavily on OpenType shaping, it must be used in an environment that supports GSUB features.
  • Constraints: Input within the QR blocks is strictly limited to printable ASCII and the character limits defined in the version table above.