label_printer/fonts.py

24 lines
876 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, stroke_width_bold: int, default: bool = False) -> None:
2024-11-27 23:59:36 +00:00
self.name = name
self.path = path
self.stroke_width = stroke_width
self.stroke_width_bold = stroke_width_bold
2024-11-27 23:59:36 +00:00
self.selected = default
def to_dict(self):
return {
"name": self.name,
"path": self.path,
"selected": self.selected,
"stroke_width": self.stroke_width,
"stroke_width_bold": self.stroke_width_bold
2024-11-27 23:59:36 +00:00
}
def fonts():
return {
"CYBER": Font("CYBER", "resources/OCRAEXT.TTF", 0, 3, True).to_dict(),
"ComicMono": Font("Comic Sans Mono", "resources/ComicMono.ttf", 0, 2).to_dict(),
"EstupidoEspezial": Font("¡¡¡Estupido-Espezial!!!", "resources/Estupido Espezial.ttf", 0, 2).to_dict()
2024-11-27 23:59:36 +00:00
}