letter-spacing seriously broken #3256

Open
msmuenchen opened this Issue Dec 19, 2016 · 0 comments

Projects

None yet

1 participant

@msmuenchen
msmuenchen commented Dec 19, 2016 edited

When compared with Google Chrome, letter-spacing is badly broken in both 12.3 and 12.4.

In 12.3, positive letter-spacing is not handled correctly (the spacing is far bigger than 1/2 px), while negative letter-spacing results in the text being reversed/not printed at all. See test_old_letterspacing.pdf.

In 12.4, in addition to the sizing bug in #3255, the 2px letterspacing text exceeds the boundary box compared to Chrome.

The command used is in both cases wkhtmltopdf --page-width 80 --page-height 80 -T 0 -L 0 -B 0 -R 0 test_old_letterspacing.html test_old_letterspacing.pdf, the platform is OS X 10.11, using the official binaries.

Source code:

<!doctype html>
<html lang="de">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style type="text/css">
*,html {
        margin:0;
        padding:0;
        font-size:5mm;
        font-family:monospace;
}
body {
        width:8cm;
        box-sizing:border-box;
        outline:1px solid black;
}
    </style>
    <title>Lorem Ipsum</title>
</head>
<body>
<p>This is a test.</p>
<p style="letter-spacing:2px">2:1234567890123456789</p>
<p style="letter-spacing:1px">1:1234567890123456789</p>
<p style="letter-spacing:0px">0:1234567890123456789</p>
<p style="letter-spacing:-1px">-1:1234567890123456789</p>
<p style="letter-spacing:-2px">-2:1234567890123456789</p>

</body>
</html>

test_new_letterspacing.pdf
test_old_letterspacing.pdf

Reference:
![bildschirmfoto 2016-12-19 um 17 28 33]
(https://cloud.githubusercontent.com/assets/2284268/21320242/977ecba0-c610-11e6-8d5e-3f5b8b679acc.png)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment