ThermalPrinterEncoder icon indicating copy to clipboard operation
ThermalPrinterEncoder copied to clipboard

Bug: Table column calcualtion with font size

Open Zetanova opened this issue 7 months ago • 0 comments

The table operation does not include the current font size in the calculation.

let result = encoder
    .size(2)
    .table(
        [
            { width: 36, marginRight: 2, align: 'left' },
            { width: 10, align: 'right' }
        ], 
        [
            [ 'Item 1', '€ 10,00' ],
            [ 'Item 2', '15,00' ],
            [ 'Item 3', '9,95' ],
            [ 'Item 4', '4,75' ],
            [ 'Item 5', '211,05' ],
            [ '', '='.repeat(10) ],
            [ 'Total', (encoder) => encoder.bold().text('€ 250,75').bold() ],
        ]
    )	
    .encode()

will produce an result with an outofbound table

Zetanova avatar Jul 27 '25 13:07 Zetanova