Skip to content

The space before line() after a another line() should use the font size of the next line not the current one #53

@ferminc

Description

@ferminc

I was having this issue where I would set a text to size 2, and the next one to size 1, the one with size one would have space above because the line() function expects a text of the same size as the current one when called

When using line()

const result = encoder
   .size(2, 2)
   .line(text) // TOTAL: ...
   .size(1, 1)
   .line(text2) // ==== ...
   .encode();

Image

When setting new line manually

const result = encoder
  .size(2, 2)
  .text(text) // TOTAL: ...
  .size(1, 1)
  .newline()
  .text(text2) // ==== ...
  .encode();

Image

IMO this should be the default behaviour of line(), I previously used the old "node-escpos" module and never had this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions