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.0b2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| glyphkit-1.0.0b2.tar.gz | 110.4 kB | Without provenance | Details for glyphkit-1.0.0b2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| glyphkit-1.0.0b2-py3-none-any.whl | Python 3 | none | any | Details for glyphkit-1.0.0b2-py3-none-any.whl |
Total release size: 158.0 kB
Release files / glyphkit-1.0.0b2.tar.gz
| Download URL | glyphkit-1.0.0b2.tar.gz |
|---|---|
| Size | 110.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3f0b2cdeb4b201ecd08a3bca1b9ee230857c6cbf7df301a2b7cdd1dfc14254af
|
|
BLAKE2b-256 checksum How to use checksums |
97a99f49b4666c20428a4f1691ae10c94863a4cde1cfd70790e550101bd96d3c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","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.0b2-py3-none-any.whl
| Download URL | glyphkit-1.0.0b2-py3-none-any.whl |
|---|---|
| Size | 47.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9a0abfb1dc4947a4ff2231ab3a0138e71fbb7193038362b9d9937b0e2374e2bc
|
|
BLAKE2b-256 checksum How to use checksums |
7d9fb579713e92c1c4f0ca52d7ea151a3ea5470f277990a58a8a7e6917eea096
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","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.0b2
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.