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

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

Built distribution (wheel)

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

Total release size: 176.7 kB

Release files / glyphkit-1.0.0b4.tar.gz

Download URL glyphkit-1.0.0b4.tar.gz
Size 122.5 kB
Tags Source
SHA-256 checksum
How to use checksums
403de3972689b5444d19eb15d25e3e70f51ead76e1bac55be8bac2c6c12f5b6b
BLAKE2b-256 checksum
How to use checksums
d12281166ac570d757dae83870368184c0c698da72a06014caa975d47a320dd2
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.0b4-py3-none-any.whl

Download URL glyphkit-1.0.0b4-py3-none-any.whl
Size 54.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7da4c46f930b80c2052af8e43261e2d4c7e9770c51073e4eae9f1f4a97ce572c
BLAKE2b-256 checksum
How to use checksums
f637e7e23ccc500b939b8cd1fb5bf8a88905fd218fec1a3d4f0166be77677764
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.0b4

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