Skip to content

Text size not working (width and height) #592

@PonnyTheLight

Description

@PonnyTheLight

Bug description

I used python-escpos before and all the code working perfectly, but a few days ago, all sizes not work. I dont know why but the text align work, but then the width and height not work in the same line. Any one can help me?

Steps to reproduce

  • Install python-escpos 2.2.0 and then connect to the printer with Network().
  • Then use the printer has connusar and try the code below.
    if connusar:
            if productsinc.exists():
                connusar.set(width=2, height=2, align='center')
                connusar.text(f"--= NUEVO PEDIDO =--\n\n{mesa.name}\n\n")
                connusar.set(align=u'center', width=1, height=1)
                connusar.text(f"Pedido Por: {userm.username}\n")
                connusar.set(align=u'center', width=2, height=2)
                connusar.text("\n ----------------\n\n")
                for product in productsinc:
                    if product.bolas != 0:
                        connusar.set(align=u'left', height=2)
                        connusar.text(f"{product.num}x {product.name.upper()}\n")
                        if product.formato == "1":
                            connusar.text(f"  * EN TARRINA {product.bolas} BOLAS\n")
                        elif product.formato == "2":
                             connusar.text(f"  * EN COPA {product.bolas} BOLAS\n")
                        elif product.formato == "3":
                             connusar.text(f"  * EN CUCURUCHO {product.bolas} BOLAS\n")
                        for add in product.adds.all():
                            connusar.text(f"  + {add.name.upper()}\n")
                        for sabor in product.sabores.all():
                            connusar.text(f"  - {sabor.namei.upper()}\n")
                        connusar.text("\n")
                    else:
                        connusar.set(align=u'left', width=2, height=2)
                        connusar.text(f"{product.num}x {product.name.upper()}\n")
                        for sina in product.sins.all():
                            connusar.text(f"  - {sina.name.upper()}\n")
                        for add in product.adds.all():
                            connusar.text(f"  + {add.name.upper()}\n")
                        connusar.text("\n")
                connusar.set(align=u'center', width=2, height=2)
                connusar.text("\n\n ----------------")
                connusar.cut()`

All align variables, working, but all width and height variables not working..

Device info

Printer: I dont know sorry
OS: Windows 11

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions