v.0.5.1 font_checker
This commit is contained in:
@@ -14,8 +14,10 @@ class Font_Checker():
|
|||||||
print(pretty_font)
|
print(pretty_font)
|
||||||
|
|
||||||
def fonts_check(self, pretty=False) -> None:
|
def fonts_check(self, pretty=False) -> None:
|
||||||
|
|
||||||
|
for fnt in fonts.fonts_installed:
|
||||||
self.display.clear()
|
self.display.clear()
|
||||||
self.display.set_font(self.font)
|
self.display.set_font(fnt)
|
||||||
|
|
||||||
height = self.display.font_height
|
height = self.display.font_height
|
||||||
|
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
from app.utils import align_font, colors
|
|
||||||
from app.display.neopixel_64x64 import NeoPixel_64x64
|
|
||||||
import app.display.fonts as fonts
|
|
||||||
|
|
||||||
font = fonts.font_3x5
|
|
||||||
|
|
||||||
def font_pretty(font):
|
|
||||||
pretty_font = align_font(font, debug=False)
|
|
||||||
print(pretty_font)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _do_fonts_check_all(display: NeoPixel_64x64, pretty=False) -> None:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
def fonts_check(display: NeoPixel_64x64, pretty=False) -> None:
|
|
||||||
display.clear()
|
|
||||||
display.set_font(font)
|
|
||||||
|
|
||||||
height = display.font_height
|
|
||||||
|
|
||||||
alphanum: str = ''.join(sorted(font.keys()))
|
|
||||||
|
|
||||||
text_left = alphanum
|
|
||||||
while text_left:
|
|
||||||
# Text entsprechend des Display splitten
|
|
||||||
scr_txt_dict = display.screen_text(text=text_left)
|
|
||||||
print(f'scr_txt: {scr_txt_dict}')
|
|
||||||
|
|
||||||
display.clear()
|
|
||||||
for idx, row_text in enumerate(scr_txt_dict['visible']):
|
|
||||||
ypos = height * idx
|
|
||||||
# display.clear_row(ypos)
|
|
||||||
display.write_text(row_text, 0, ypos, colors.RAINBOW[idx % 6])
|
|
||||||
|
|
||||||
text_left = scr_txt_dict['invisible']
|
|
||||||
|
|
||||||
if pretty:
|
|
||||||
font_pretty(font)
|
|
||||||
Reference in New Issue
Block a user