torchfont.datasets.folderΒΆ

Utilities for turning local font folders into indexed glyph datasets.

Notes

Glyph data is cached inside the native backend for the lifetime of each dataset instance. Recreate the dataset when editing font files on disk to ensure changes are observed.

Examples

Iterate glyph samples from a directory of fonts:

from torchfont.datasets import FontFolder

dataset = FontFolder(root="~/fonts")
sample, target = dataset[0]

Classes

FontFolder(root, *[, codepoint_filter, ...])

Dataset that yields glyph samples from a directory of font files.