Skip to main content

Loads bitmap fonts into CircuitPython displayio.

Project description

Introduction

Documentation Status Discord Build Status Code Style: Ruff

Loads bitmap fonts into CircuitPython’s displayio. BDF and PCF files are well supported. TTF support is not yet complete.

Dependencies

This driver depends on:

Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle.

Installing from PyPI

On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:

pip3 install adafruit-circuitpython-bitmap_font

To install system-wide (this may be required in some cases):

sudo pip3 install adafruit-circuitpython-bitmap_font

To install in a virtual environment in your current project:

mkdir project-name && cd project-name
python3 -m venv .venv
source .venv/bin/activate
pip3 install adafruit-circuitpython-bitmap_font

Usage Example

from adafruit_bitmap_font import bitmap_font
from displayio import Bitmap
font = bitmap_font.load_font("fonts/LeagueSpartan-Bold-16.bdf", Bitmap)
print(font.get_glyph(ord("A")))

Creating Fonts

See this learn guide for more information about building custom font files.

The command line tool otf2bdf can be used make bdf files for use with this library.

The command line tool bdftopcf can be used make pcf files for use with this library.

Documentation

API documentation for this library can be found on Read the Docs.

For information on building library documentation, please check out this guide.

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

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

adafruit_circuitpython_bitmap_font-2.4.2.tar.gz (843.4 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file adafruit_circuitpython_bitmap_font-2.4.2.tar.gz.

File metadata

File hashes

Hashes for adafruit_circuitpython_bitmap_font-2.4.2.tar.gz
Algorithm Hash digest
SHA256 f9485b7275fe63adb3243fd32ae4ab676f33c153933144451bc3abaf9ab731d4
MD5 fb5dcde632f85129fdeece36f576304e
BLAKE2b-256 e8bae9c116a610e67f11d8855b9597cad0ff24d19c47bcd3f0d050f7bc48498a

See more details on using hashes here.

File details

Details for the file adafruit_circuitpython_bitmap_font-2.4.2-py3-none-any.whl.

File metadata

File hashes

Hashes for adafruit_circuitpython_bitmap_font-2.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 abb3e2cbc23293f6daf6c5a54b7c154fb22cd7e4f3d4ee296edad33a965faaa7
MD5 0cd1948bfeeec002416ba1b265ae620d
BLAKE2b-256 031c7623bf5e8ee8eff5640cab54196546d5f6ae62e9f892b0106d970d78b857

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