Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

GlyphKit

GlyphKit is a renderer-independent Python typography engine. It selects explicit fonts, shapes Unicode, lays out paragraphs and structured math, measures text, extracts exact glyph paths, and creates permission-aware subset bytes. It returns immutable data only.

It does not draw, animate, create a canvas or scene, download fonts, interpret licenses, or write SVG, HTML, images, video, PDFs, or any other output file. A static figure kit, an animation kit, a document tool, or an application may consume the same TextLayout without GlyphKit importing any of them.

Install

uv add glyphkit
uv add 'glyphkit[portable]'  # add WOFF2 payload support

GlyphKit supports Python 3.10 through 3.13.

Explicit fonts, one layout for any consumer

from glyphkit import FontLibrary, FontSource, Paragraph, TextSpan, TextStyle

library = FontLibrary.from_sources(
    (
        FontSource.path("fonts/SourceSans3-Regular.ttf"),
        FontSource.path("fonts/NotoSansTC-Regular.otf"),
    ),
    generic_families={"sans-serif": ("Source Sans 3", "Noto Sans TC")},
)

paragraph = Paragraph(
    (TextSpan("效用 U(x₁, x₂)", TextStyle(("Source Sans 3", "Noto Sans TC"), 18)),),
    max_width=360,
)
layout = library.layout(paragraph)

layout is a data asset: its lines, runs, glyph positions, source ranges, logical bounds, ink bounds, and font uses are independent of DPI and any output backend.

Geometry, math, and portable data

from glyphkit.embedding import EmbeddingUse
from glyphkit.math import MathStyle, parse_math

glyph = layout.lines[0].runs[0].glyphs[0]
outline = library.outline(glyph)  # MoveTo / LineTo / QuadraticTo / CubicTo / ClosePath
bundle = library.subset(layout, embedding_use=EmbeddingUse.WEB)  # bytes, never a file

formula = parse_math(r"U(x_1, x_2) = x_1^\\alpha x_2^{1-\\alpha}")
math_box = library.layout_math(formula, style=MathStyle(18, ("STIX Two Math",)))

See font safety, the supported math grammar, and the data-only examples/ directory.

Reproducibility and safety

Use caller-owned paths, bytes, or streams. Paths and streams are snapshotted while building the library; face identity derives from SHA-256 content plus collection index, not the path. System discovery is opt-in. A portable subset is rejected when embedding permissions are restricted or unknown unless the caller explicitly records an override.

GlyphKit is distributed under the MIT License.

Metadata

Release files for glyphkit 1.0.0b3

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

Source distribution (sdist)

Source distribution for glyphkit 1.0.0b3
File Size Uploaded Provenance Actions
glyphkit-1.0.0b3.tar.gz 121.0 kB Without provenance Details for glyphkit-1.0.0b3.tar.gz

Built distribution (wheel)

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

Total release size: 174.3 kB

Release files / glyphkit-1.0.0b3.tar.gz

Download URL glyphkit-1.0.0b3.tar.gz
Size 121.0 kB
Tags Source
SHA-256 checksum
How to use checksums
cbf459c9b76c3ed702179003b23aa392d22d536e0150aa0820fc69d064af831e
BLAKE2b-256 checksum
How to use checksums
41daf5ecdb9a6948e39cb6c4c27320b41b5f047daf3fa0b921ff2b788be8ef65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / glyphkit-1.0.0b3-py3-none-any.whl

Download URL glyphkit-1.0.0b3-py3-none-any.whl
Size 53.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f0d4372db584682e968a3ab2dfe54d074c64910f39183095132447baf5cd023c
BLAKE2b-256 checksum
How to use checksums
6264fde015f678019650c426e59f641a85ca9a62d1774369ccb9fe1afd268ad9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for glyphkit 1.0.0b3

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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