Skip to content

JosephBARBIERDARNAL/pyfonts

Repository files navigation

PyFonts

pyfonts logo

A simple 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

(not recommended) Alternatively you can install the development version with:

pip install git+https://github.com/JosephBARBIERDARNAL/pyfonts.git



Quick start

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"
)

# check how the font looks on a minimalist example
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.

TODO features:

  • check the issues for ideas
  • suggest something (:

Installation for contributions

Follow the steps below for your OS.

  1. Fork the Repository: Fork this repository to your GitHub account.

  2. Clone the Repository:

    git clone https://github.com/yourusername/pyfonts.git
    cd pyfonts
  3. Set Up a Virtual Environment:

    • Mac/Linux:
      python -m venv venv
      source venv/bin/activate
    • Windows:
      python -m venv venv
      venv\Scripts\activate
  4. Install Dependencies:

    pip install -r requirements-dev.txt
    pip install -e .
  5. Create a Feature Branch:

    git checkout -b feature-name
  6. Start Coding!