diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2018-09-20 13:11:52 -0400 |
---|---|---|
committer | KevinOConnor <kevin@koconnor.net> | 2018-09-21 16:39:38 -0400 |
commit | 05ba62600cc9ccdd925ce47512d7125b1745dbca (patch) | |
tree | 517ab8445108e94ae6cd97f162c1840235958c58 /klippy/extras/display/st7920.py | |
parent | a4e2540f14be1608eceefca4fb9ffdc2ffa081e2 (diff) | |
download | kutter-05ba62600cc9ccdd925ce47512d7125b1745dbca.tar.gz kutter-05ba62600cc9ccdd925ce47512d7125b1745dbca.tar.xz kutter-05ba62600cc9ccdd925ce47512d7125b1745dbca.zip |
st7920: Support writing degrees symbol
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/display/st7920.py')
-rw-r--r-- | klippy/extras/display/st7920.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/klippy/extras/display/st7920.py b/klippy/extras/display/st7920.py index 4ccfcd24..f76e523a 100644 --- a/klippy/extras/display/st7920.py +++ b/klippy/extras/display/st7920.py @@ -4,7 +4,7 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging -import icons +import icons, font8x14 BACKGROUND_PRIORITY_CLOCK = 0x7fffffff00000000 @@ -13,6 +13,7 @@ ST7920_CMD_DELAY = .000020 ST7920_SYNC_DELAY = .000045 TextGlyphs = { 'right_arrow': '\x1a' } +CharGlyphs = { 'degrees': font8x14.VGA_FONT[0xf8] } class ST7920: def __init__(self, config): @@ -145,6 +146,12 @@ class ST7920: # Draw character self.write_text(x, y, char) return 1 + font = CharGlyphs.get(glyph_name) + if font is not None: + # Draw single width character + for i, bits in enumerate(font): + self.write_graphics(x, y, i, [bits]) + return 1 return 0 def clear(self): self.text_framebuffer[0][:] = ' '*64 |