torchfont.datasets.folderΒΆ
Utilities for turning local font folders into indexed glyph datasets.
Notes
Fonts are cached by absolute path to minimize redundant disk access during dataset iteration, so edits on disk require an explicit cache clear.
Examples
Iterate glyph samples from a directory of fonts:
from torchfont.datasets import FontFolder
dataset = FontFolder(root="~/fonts")
sample, target = dataset[0]
Functions
|
Convert a glyph outline to tensor representations. |
|
Load a font file and cache the resulting |
Classes
|
Dataset that yields glyph samples from a directory of font files. |