label_printer/fonts.py
2024-11-28 00:59:36 +01:00

20 lines
623 B
Python

class Font:
def __init__(self, name: str, path: str, stroke_width: int, default: bool = False) -> None:
self.name = name
self.path = path
self.stroke_width = stroke_width
self.selected = default
def to_dict(self):
return {
"name": self.name,
"path": self.path,
"selected": self.selected,
"stroke_width": self.stroke_width
}
def fonts():
return {
"CYBER": Font("CYBER", "resources/OCRAEXT.TTF", 3, True).to_dict(),
"ComicMono": Font("Comic Sans Mono", "resources/ComicMono.ttf", 0).to_dict()
}