Skip to content

Kerning & text spacing issues #2687

@GalaxyShard

Description

@GalaxyShard
<!DOCTYPE html>
<html>
    <title>Hello World</title>
    <style>
        body {
            text-align:justify;
            text-indent:0.25in;
            font-family:"Liberation Serif";
            font-size:16pt;
            background-color:#d0d0d0;
        }
    </style>

</html>
<body>
    <p>
        Repellat ut perspiciatis et magnam voluptas ea placeat. Incidunt debitis sit nemo et asperiores doloribus sequi dolor. Dolore laudantium sunt et qui. Blanditiis deserunt aut ullam. Sint at cumque soluta. Error est ut totam.
    </p>
</body>

When generating a PDF with weasyprint test.html test.pdf, the output looks like this in Firefox and Okular:

Image

When changing the command to weasyprint test.html test.pdf --full-fonts, it changes to this:

Image

Note how although the letter spacing appears to be fixed, the lines still wrap at the exact same characters as in the first image and the text-align:justify appears to calculate the word spacing based on the incorrect character spacing present in the first image.

The issue reproduces with the <style> removed. When using a monospace font, there appears to be an unusually large amount of character spacing, however there is no inconsistent spacing like in the first image above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugExisting features not working as expected

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions