1
0
mirror of https://github.com/gryf/wmdocklib.git synced 2025-12-31 19:12:29 +01:00

Added ability to define multiple bitmap font sources.

By defining attribute "fonts" in the DockApp inherited class, now there
is possible for adding more than one character sets.
This commit is contained in:
2022-05-03 18:40:53 +02:00
parent 1085074596
commit dca4bf5440
2 changed files with 93 additions and 59 deletions

View File

@@ -82,7 +82,7 @@ So below is the example for displaying random number:
def __init__(self):
super().__init__()
self.font = FONTS
self.fonts = [wmdocklib.BitmapFonts(FONTS, self.dimensions)]
def run(self):
self.prepare_pixmaps()
@@ -91,7 +91,7 @@ So below is the example for displaying random number:
def main_loop(self):
while True:
self.add_string(f'{random.randint(0, 999):3}', 1, 1)
self.fonts[0].add_string(f'{random.randint(0, 999):3}', 1, 1)
self.redraw()
time.sleep(0.1)