mirror of
https://gitlab.com/MisterBiggs/bdfparse.git
synced 2025-08-16 10:24:55 +00:00
preparing code for official release
This commit is contained in:
24
README.md
24
README.md
@@ -1,2 +1,24 @@
|
||||
# bdf to numpy
|
||||
# .bdf to NumPy
|
||||
|
||||
This project takes a .bdf file and turns it into a [NumPy](https://www.numpy.org/) Array with an intended use with LED matrix displays. My [LED Stock Ticker](https://gitlab.com/them-boys/raspberry-pi-stock-ticker) uses this package. A good list of .bdf files can be found [here](https://github.com/hzeller/rpi-rgb-led-matrix/tree/master/fonts)
|
||||
|
||||
## Usage
|
||||
|
||||
```python
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
font = parse_chars("9x18.bdf")
|
||||
matrix = font["A"]
|
||||
text = "nson"
|
||||
|
||||
for letter in text:
|
||||
matrix = np.concatenate((matrix, font[letter]), axis=1)
|
||||
|
||||
plt.imshow(matrix)
|
||||
plt.show()
|
||||
```
|
||||
|
||||
Which outputs:
|
||||
|
||||

|
||||
|
Reference in New Issue
Block a user