Skip to main content

wing-font

Build OpenType fonts that show each character's pronunciation above the character itself — Cantonese Jyutping, Mandarin Pinyin, Taiwanese Tâi-lô, Japanese furigana and more. The reading is part of the glyph, so it works in plain text anywhere a font works (Word, Pages, Canva, browsers). No <ruby> markup.

Pre-built fonts and an in-browser generator: https://wing-font.chunlaw.io · Source: https://github.com/chunlaw/wing-font-generator

Install

pip install wing-font          # Python 3.10+

This gives you the wing-font command. The package contains code only: no fonts and no mapping data. You download those once with wing-font fetch.

What you need for one font

Input What it is Where it comes from
Base font (-i) The font for the characters, e.g. Noto Sans HK your own .ttf, or wing-font fetch <font file>
Annotation font (-a) The font for the readings, e.g. Noto Sans (Latin) your own .ttf, or wing-font fetch <font file>
Mapping (-m) CSV of character,reading, e.g. 行,hang4 your own CSV, or wing-font fetch <path>.csv

wing-font fetch — when and how

Use it once, before your first build, to download ready-made inputs into a folder. Skip it if you bring your own fonts and CSV.

wing-font fetch --list                              # what's available
wing-font fetch NAME [NAME ...] [--dest DIR] [--force]
  • NAME ending in .csv → a mapping, path relative to python/mappings/ in the repo (e.g. cantonese/canto-lshk.csv, mandarin/mandarin-cn.csv, taiwanese/taigi-tl-toned.csv, japanese/japanese-onkun.csv).
  • Any other NAME → a font file from wing-font-hub (all SIL OFL), e.g. NotoSansHK-VariableFont_wght.ttf, NotoSerif-Regular.ttf.
  • Files already downloaded are skipped unless you pass --force.

Quick start: Cantonese Jyutping on Noto Sans HK

wing-font fetch NotoSansHK-VariableFont_wght.ttf "NotoSans-VariableFont_wdth,wght.ttf" --dest fonts
wing-font fetch cantonese/canto-lshk.csv --dest mappings

wing-font -i fonts/NotoSansHK-VariableFont_wght.ttf \
          -a "fonts/NotoSans-VariableFont_wdth,wght.ttf" --anno-axis wdth=75 \
          -m mappings/canto-lshk.csv \
          -o out/NotoSansHK-Jyutping -opt -as 0.39 -bs 0.70 -y 0.70

Output: out/NotoSansHK-Jyutping.ttf and .woff2. Install the .ttf and type Chinese. Polyphonic characters pick their reading from word context (銀行 → hong4, 行人 → hang4). You can also force a reading by typing its number after the character (行1, 行2, …).

wing-font --help lists every option (scales, offsets, annotation below, variable-font axes, DIY annotations, …).

Your own language

A mapping is a UTF-8 CSV, one row per character or word:

各,gok3
銀行,ngan4 hong4

Pick an annotation font that covers every letter and mark in your readings. The full format, and how to add a new script, is in the repo: CONTRIBUTING-mappings.md and AGENTS.md.

From Python

from wingfont.cli import main

main(
    base_font_file="fonts/NotoSansHK-VariableFont_wght.ttf",
    anno_font_file="fonts/NotoSerif-Regular.ttf",
    mapping="mappings/canto-lshk.csv",
    output_prefix="out/NotoSansHK-Jyutping",
)

Licences

Code: MIT. Fonts you build inherit the licences of the input fonts (SIL OFL for everything on wing-font-hub). Each mapping CSV keeps its own data licence. See LICENSES.md.

Metadata

Release files for wing-font 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wing-font 1.0.0
File Size Uploaded Provenance Actions
wing_font-1.0.0.tar.gz 164.9 kB With provenance Details for wing_font-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for wing-font 1.0.0
File Interpreter ABI Platform Actions
wing_font-1.0.0-py3-none-any.whl Python 3 none any Details for wing_font-1.0.0-py3-none-any.whl

Total release size: 303.0 kB

Release files / wing_font-1.0.0.tar.gz

Download URL wing_font-1.0.0.tar.gz
Size 164.9 kB
Tags Source
SHA-256 checksum
How to use checksums
da70a285fe71d61a2e769382fc4eee7ad5916a8efd8e2c46ced625f198ceb21e
BLAKE2b-256 checksum
How to use checksums
1c5e02893c967c820f8b5e4143369370c3ffd787d110ceb78a78a3f8a0a0fcbb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Release files / wing_font-1.0.0-py3-none-any.whl

Download URL wing_font-1.0.0-py3-none-any.whl
Size 138.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
700dcd3b6fc420acef80da7f945c821e7bfb1fb8aa2dd66aab37ae2d61d63943
BLAKE2b-256 checksum
How to use checksums
33c19d388873d66f616905faa0c9cf3157ded142db7d2a053a8b80fa746be131
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Security for wing-font 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for wing_font-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page