format
This commit is contained in:
parent
9353b6499a
commit
15b40a6905
1 changed files with 10 additions and 2 deletions
12
printer.py
12
printer.py
|
@ -87,7 +87,7 @@ class ReceiptPrinter(CupsPrinter):
|
||||||
return CallbackContext(exit=super().set_with_default)
|
return CallbackContext(exit=super().set_with_default)
|
||||||
|
|
||||||
def split(self, left, right, cols=48):
|
def split(self, left, right, cols=48):
|
||||||
self.textln(f"{left:<{cols//2}}{right:<{cols//2}}")
|
self.textln(f"{left:<{cols // 2}}{right:<{cols // 2}}")
|
||||||
|
|
||||||
def vsplit(self, *args, **kwargs):
|
def vsplit(self, *args, **kwargs):
|
||||||
return Split2Context(self, *args, **kwargs)
|
return Split2Context(self, *args, **kwargs)
|
||||||
|
@ -111,7 +111,15 @@ class ReceiptPrinter(CupsPrinter):
|
||||||
def title(self, text, size=6, width=None, height=None):
|
def title(self, text, size=6, width=None, height=None):
|
||||||
width = width or size
|
width = width or size
|
||||||
height = height or size
|
height = height or size
|
||||||
with self.set(align="center", bold=True, invert=True, smooth=True, custom_size=True, width=width, height=height):
|
with self.set(
|
||||||
|
align="center",
|
||||||
|
bold=True,
|
||||||
|
invert=True,
|
||||||
|
smooth=True,
|
||||||
|
custom_size=True,
|
||||||
|
width=width,
|
||||||
|
height=height,
|
||||||
|
):
|
||||||
self.textln(text)
|
self.textln(text)
|
||||||
self.ln()
|
self.ln()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue