Skip to main content

No project description provided

Project description

Font Fetcher

A simple library to fetch (and cache) fonts from 1001fonts.com (more sources can be added later).

⚠️ Not all fonts are available for free for all use cases, so please check the license of each font before using it.

Installation

pip install font-fetcher

Usage

from font_fetcher import fetch_font

# Fetch a font by its name
font_name = "Open Sans"
font_style = "Bold"  # Optional (default is "Regular")
font_path = fetch_font(font_name, font_style)
print(f"Font '{font_name}' ('{font_style}') available at: {font_path}")

OCP integration

This library was written to help ensure the availability of fonts in code-CAD environments using OCP, so there is a simple hook to fetch fonts automatically when needed:

from font_fetcher.ocp import install_ocp_font_hook

install_ocp_font_hook()

After calling install_ocp_font_hook(), fonts will be fetched automatically if they are not already available.

Example for build123d: Text("Text", 10, font_name="Open Sans", font_style=FontStyle.BOLD)

Example for cadquery: wp.text("Text", 10, font="Open Sans", kind="bold")

⚠️ Not all fonts work with OCP, here is a list of known working and recommended fonts:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

font_fetcher-0.0.1a6.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

font_fetcher-0.0.1a6-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file font_fetcher-0.0.1a6.tar.gz.

File metadata

  • Download URL: font_fetcher-0.0.1a6.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for font_fetcher-0.0.1a6.tar.gz
Algorithm Hash digest
SHA256 9b36d51ae83f07bd68c879e0ade296bf896687156d30f23d201c2301c3c0e3d0
MD5 06f61c5c584cfad499d5c6d92ebaec6a
BLAKE2b-256 0be5820883c49a36919cf3617d8ad52056eae3e85ef49b4322df3493900e18af

See more details on using hashes here.

File details

Details for the file font_fetcher-0.0.1a6-py3-none-any.whl.

File metadata

  • Download URL: font_fetcher-0.0.1a6-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for font_fetcher-0.0.1a6-py3-none-any.whl
Algorithm Hash digest
SHA256 4ee52fe46eef51530e15bb7cd09dd3a2888b089c81bafb7986c0ce57af30b3e8
MD5 95b1f01652b6d8e16b82ab92560327a2
BLAKE2b-256 5c4a9d40d72ebbde99ce046a4ce7306f77f4e2ac328b032af636ce6f301534ad

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page