Skip to main content

A simple way to load fonts for matplotlib

Project description

PyFonts

pyfonts logo

A simple (and reproducible) way to load fonts for matplotlib.

Check out the online documentation.



Installation

Note: pyfonts requires Python 3.9 and above.

You can install pyfonts directly from PyPI with:

pip install pyfonts



Quick start

pyfonts is designed to make the code of your graphs more reproducible by removing the need to add the local path to the font files. For example:

from pyfonts import load_font
import matplotlib.pyplot as plt

font = load_font(
    font_url="https://github.com/google/fonts/raw/main/apache/ultra/Ultra-Regular.ttf"
)

fig, ax = plt.subplots(figsize=(10, 6))
ax.text(
    x=0.5,
    y=0.5,
    s=f"What an easy way to load fonts, isn't it?",
    font=font,
    fontsize=20,
    ha="center",
)
plt.show()

output of quick start



Usage guide

Check out the online documentation.



Contributions

Contributions and feedback are welcome.

There's not much that needs to be implemented at the moment. If you've found a bug or want to request a new feature, open an issue.




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

pyfonts-0.0.2.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

pyfonts-0.0.2-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file pyfonts-0.0.2.tar.gz.

File metadata

  • Download URL: pyfonts-0.0.2.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.5

File hashes

Hashes for pyfonts-0.0.2.tar.gz
Algorithm Hash digest
SHA256 d942ee84db70c33a0a553619a52bff6bf2091c7751648f0f7ca09c56466d254d
MD5 7d06d05e22703c78d838940f221cbd3c
BLAKE2b-256 09331631ddc10e98164cc2808ed13c81f3e68eca29784d8951805b11dde32325

See more details on using hashes here.

File details

Details for the file pyfonts-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: pyfonts-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.5

File hashes

Hashes for pyfonts-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8f51c3b6bdb64efdc422d2b3d0aa69c5bb95f90e7419cbc026e90c18aa30ca06
MD5 5cd58a7baf027ebdc9bf066333a9ea2d
BLAKE2b-256 a1000aebe94c3a55d27a8be1419c577f5f61fd593a8d4b7f18e79559127c6478

See more details on using hashes here.

Supported by

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