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.5.tar.gz (7.0 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.5-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file font_fetcher-0.0.5.tar.gz.

File metadata

  • Download URL: font_fetcher-0.0.5.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for font_fetcher-0.0.5.tar.gz
Algorithm Hash digest
SHA256 aa3ad2ca4db2dbef788d09ce57a36bbe47030b037943f07919cde8366c462b43
MD5 5fb41fad58d88c3e9eb715522f69fda0
BLAKE2b-256 efe29a90f2eb6498b11f9e5e812e46fa907b6338eb9754ec76e1f89b0ac67b8e

See more details on using hashes here.

File details

Details for the file font_fetcher-0.0.5-py3-none-any.whl.

File metadata

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

File hashes

Hashes for font_fetcher-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 61438b0ef8b9c9f619d4b3066cd280272c5c0fe419953e49e6a6bfe29608921a
MD5 b2b3570db51f5ab8e72bd36b412c05b5
BLAKE2b-256 266862654d00089aa8967d0ab54530deec490f6bd16e8e1046cbb2120feb87a8

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