Add support for fontio

This commit is contained in:
Scott Shawcroft 2019-03-19 16:20:17 -07:00
parent c0f8e55764
commit e26a474223
No known key found for this signature in database
GPG key ID: FD0EDC4B6C53CA59
3 changed files with 7 additions and 4 deletions

View file

@ -40,7 +40,10 @@ Implementation Notes
"""
import gc
from displayio import Glyph
try:
from displayio import Glyph
except ImportError:
from fontio import Glyph
from .glyph_cache import GlyphCache
__version__ = "0.0.0-auto.0"

View file

@ -1,4 +1,3 @@
import collections
class Bitmap:
def __init__(self, width, height, color_count):
@ -20,5 +19,3 @@ class Bitmap:
def __len__(self):
return self.width * self.height
Glyph = collections.namedtuple("Glyph", ["bitmap", "tile_index", "width", "height", "dx", "dy", "shift_x", "shift_y"])

3
test/fontio.py Normal file
View file

@ -0,0 +1,3 @@
import collections
Glyph = collections.namedtuple("Glyph", ["bitmap", "tile_index", "width", "height", "dx", "dy", "shift_x", "shift_y"])