label_printer/fonts.py

21 lines
623 B
Python
Raw Normal View History

2024-11-27 23:59:36 +00:00
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()
}