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.0b5

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.0b5
File Size Uploaded Provenance Actions
glyphkit-1.0.0b5.tar.gz 124.5 kB Without provenance Details for glyphkit-1.0.0b5.tar.gz

Built distribution (wheel)

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

Total release size: 182.4 kB

Release files / glyphkit-1.0.0b5.tar.gz

Download URL glyphkit-1.0.0b5.tar.gz
Size 124.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b67796e67f6cf7be562f79db1fdfd71efdef304eef2e26e7a8f4fb4c4d059fa3
BLAKE2b-256 checksum
How to use checksums
99b8380ed4afb85eca8950ff048a7b120484afad8d70fdc9a88744b7772ea6d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","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.0b5-py3-none-any.whl

Download URL glyphkit-1.0.0b5-py3-none-any.whl
Size 57.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
237733336f4fb52b0e5cb5e07d73cf00adfd89b17f5555ab551569fbc08d6a7c
BLAKE2b-256 checksum
How to use checksums
af080e7156c5be419ed053291c9624fec4281925f6479596c28e4ec1307a5761
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","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.0b5

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