Skip to content

Commit 2f64725

Browse files
authored
Merge pull request #8 from tannewt/fontio
Add support for fontio
2 parents c0f8e55 + e26a474 commit 2f64725

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

adafruit_bitmap_font/bdf.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@
4040
"""
4141

4242
import gc
43-
from displayio import Glyph
43+
try:
44+
from displayio import Glyph
45+
except ImportError:
46+
from fontio import Glyph
4447
from .glyph_cache import GlyphCache
4548

4649
__version__ = "0.0.0-auto.0"

test/displayio.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import collections
21

32
class Bitmap:
43
def __init__(self, width, height, color_count):
@@ -20,5 +19,3 @@ def __getitem__(self, index):
2019

2120
def __len__(self):
2221
return self.width * self.height
23-
24-
Glyph = collections.namedtuple("Glyph", ["bitmap", "tile_index", "width", "height", "dx", "dy", "shift_x", "shift_y"])

test/fontio.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import collections
2+
3+
Glyph = collections.namedtuple("Glyph", ["bitmap", "tile_index", "width", "height", "dx", "dy", "shift_x", "shift_y"])

0 commit comments

Comments
 (0)