Fonts as ordinary Python project dependencies. Inspired by Fontsource.
Browse the fonts at fontpkg.org →
uv add fontpkg fontpkg-interimport fontpkg
font_path = fontpkg.path("inter") # Path to 400/normal
fontpkg.path("Inter", weight=700, style="italic") # names are case/space-insensitive
fontpkg.path("Inter", weight=650, nearest=True)
fam = fontpkg.family("Inter") # .weights, .styles, .axes, .is_variable, .license
fontpkg.families() # everything installed in the environmentFind installable families with fontpkg search <query> (matches family, slug, or
category; the only CLI command that touches the network) or fontpkg list for what
is already installed.
Integrations (extras fontpkg[pil], fontpkg[matplotlib]):
from fontpkg.pil import truetype
img_font = truetype("Roboto", size=24, weight=500) # sets VF weight axis for you
from fontpkg.mpl import use
prop = use("Roboto", set_default=True)Font packages are generated from google/fonts (OFL/Apache-licensed families only) — see the repository root for the generator.