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
DIY annotations (--diy-annotations, optional) CSV of readings a user can type after any character to override the mapping, e.g. zaa1,zaa1 your own CSV, or wing-font fetch <path>.diy-annotation.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 .diy-annotation.csv → a DIY annotation file, path relative to python/diy-mappings/ (cantonese/lshk.diy-annotation.csv, mandarin/zhuyin.diy-annotation.csv, mandarin/pinyin.diy-annotation.csv, taiwanese/sutian.diy-annotation.csv).
  • Any other 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 cantonese/lshk.diy-annotation.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 --diy-annotations mappings/lshk.diy-annotation.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",
)

Name table (Google Fonts-ready by default)

Every build rewrites the provenance records so the output is ready for Google Fonts onboarding. Upstream copyright lines and designer credits are kept; pass --keep-base-names to leave all of these as the base font set them.

Record Default Override
nameID 0 Copyright Copyright {year} The Wing Font Project Authors (https://github.com/chunlaw/wing-font-generator) on the first line, then the base and annotation fonts' copyright lines --copyright-line TEXT ({year} is filled in)
nameID 3 Unique ID / OS/2 achVendID vendor WING --vendor-id XXXX
nameID 6 PostScript name family without spaces + - + style, e.g. WingSansYueJyutping-Regular --postscript-name
nameID 7 Trademark Wing Font --trademark
nameID 8 Manufacturer Wing Font --manufacturer
nameID 9 Designer base designers + ; Wing Font (annotations) --designer
nameID 11 / 12 Vendor / designer URL https://wing-font.chunlaw.io --vendor-url, --designer-url
nameID 5 Version / head.fontRevision base version + ; modified by Wing Font <date> --font-version X.YYY (e.g. 1.000)
nameID 13 / 14 License SIL OFL 1.1 text and https://openfontlicense.org — only when both input fonts are OFL —

nameID 10 (Description) gets Annotations added via Wing Font appended regardless. -opt always keeps the base font's Latin, punctuation and U+25CC (dotted circle) so the output covers Google Fonts' Latin Core.

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.2.2

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.2.2
File Size Uploaded Provenance Actions
wing_font-1.2.2.tar.gz 171.3 kB With provenance Details for wing_font-1.2.2.tar.gz

Built distribution (wheel)

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

Total release size: 313.3 kB

Release files / wing_font-1.2.2.tar.gz

Download URL wing_font-1.2.2.tar.gz
Size 171.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5660ad641e330dcbe3bfad944b2e9782b83eb7aa2b4fcd7daec984f368ae0fbf
BLAKE2b-256 checksum
How to use checksums
d16afcad6763fcf5bdadd9bc65c75de908f347c23a265107e23dfebed304f13e
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 18, 2026.

Transparency log

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

Download URL wing_font-1.2.2-py3-none-any.whl
Size 142.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
87acbe1678e5f2eaca956201bcbb004e5d29ddf041e4cde531490e6e2a3cbe36
BLAKE2b-256 checksum
How to use checksums
f40e92f1ccc74cbf44626236a03a2fd90c4c32e25a7404295bdb89f89dbabf1a
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 18, 2026.

Transparency log

Security for wing-font 1.2.2

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.2.2.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 18, 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