Adafruit_CircuitPython_Bitm.../adafruit_bitmap_font
Jeff Epler 004085e34c bdf: Improve performance of bitmap font loading
Loading fonts can be one of the slow phases of a Magtag type project,
and run time decreases battery lifetime.  Therefore, it's warranted
to write less idiomatic Python here if it improves runtime significantly.

This change assumes that the lines within a character come in a specific
order.  While the document ostensibly defining the BDF file format
https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5005.BDF_Spec.pdf
does not say that the order is defined, I inspected the source of the
Linux program "bdftopcf" which has been used for decades to convert
textual bdf font files into binary pcf files, and it too assumes that the
lines come in a defined order.  I doubt that bdf files that do not work
with the linux bdftopcf program are less scarce than unicorns.

I timed loading the characters "Adafruit CircuitPython" from the font
"GothamBlack-50.bdf" on a PyBadge in CircuitPython 6.0.0:

```python
font = load_font("/GothamBlack-50.bdf")
font.load_glyphs("Adafruit CircuitPython")
```

The time decreased from 919ms to 530ms (-42%).

Just reading all the lines in the font file takes 380ms.  However,
only the first 38% of the file (or so) needs to be read, so the I/O time
is about 140ms.
2020-12-05 16:00:17 -06:00
..
__init__.py Accept a bitmap class to construct 2019-01-24 17:23:32 -08:00
bdf.py bdf: Improve performance of bitmap font loading 2020-12-05 16:00:17 -06:00
bitmap_font.py Ran black, updated to pylint 2.x 2020-03-15 16:17:54 -04:00
glyph_cache.py Ran black, updated to pylint 2.x 2020-03-15 16:17:54 -04:00
pcf.py Ran black, updated to pylint 2.x 2020-03-15 16:17:54 -04:00
ttf.py Ran black, updated to pylint 2.x 2020-03-15 16:17:54 -04:00