Skip to content
This repository was archived by the owner on Dec 18, 2022. It is now read-only.
This repository was archived by the owner on Dec 18, 2022. It is now read-only.

Line wrapping bug #52

Open
Open
@verdant-spark

Description

@verdant-spark

When creating a label with the below definition, the last char of a couple of lines wraps to the next line, with the next line overlapping that last/first char.

        basePdf: {width: 50, height: 25},
        schemas: [
            {
                'order_name': {
                    'type': 'text',
                    'position': {'x': 0, 'y': 1},
                    'width': 49,
                    'height': 2,
                    'alignment': 'right',
                    'fontSize': 5,
                    'characterSpacing': 0,
                    'lineHeight': 1,
                },
                'message': {
                    'type': 'text',
                    'position': {'x': 2, 'y': 3},
                    'width': 46,
                    'height': 17,
                    'alignment': 'left',
                    'fontSize': 10,
                    'characterSpacing': 0,
                    'lineHeight': 1,
                }
            }],
    };
    inputs = rows.map(row => ({
        order_name: row.order_name,
        message: row.message,
    }));

For testing:
row.order_name = ABC-1234
row.message = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec posuere nulla risus, eu suscipit ex imperdiet sed. Nam consectetur ullamcorper nibh, non.'

Resultant pdf: messages (7).pdf

Note that if font size is dropped to 9 then the issue doesn't appear, so I'm guessing it's just a magical combination of character line length and font size vs box width.

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