torchfont¶
TorchFont: A PyTorch-native toolkit for modeling and processing vector fonts.
Notes
TorchFont ships cohesive building blocks—dataset wrappers, tensor pens, and preprocessing transforms—that keep glyph-centric machine learning pipelines declarative and reproducible.
- Features:
Seamless Google Fonts integration through sparse Git checkouts.
fontTools-backed pens that render glyph outlines directly into PyTorch tensors.Composable transform primitives for truncation, batching, and patch-based reshaping.
Examples
Assemble a dataset sourced from Google Fonts:
from torchfont.datasets import GoogleFonts
ds = GoogleFonts(root="data/google_fonts", ref="main", download=True)
References
The project README covers installation, advanced usage, and contribution guidelines in greater depth.
Modules
Dataset utilities that turn font files into model-ready glyph samples. |
|
Input/output helpers for converting font outlines to tensor formats. |
|
Transform primitives tailored to tensorized glyph sequences. |