Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS letter-spacing not working #228

Closed
vfelberg opened this issue Jun 12, 2018 · 5 comments
Closed

CSS letter-spacing not working #228

vfelberg opened this issue Jun 12, 2018 · 5 comments

Comments

@vfelberg
Copy link

Hello,

I'm using following HTML:

<!DOCTYPE html>
<html>
<head>
    <style type="text/css">
        @page {
            size: 297mm 210mm;
            margin: 0;
        }

        html, body, div, span {
            margin: 0;
        }

        #main_container {
            position: relative;
            width: 297mm;
            height: 210mm;
        }

        #container1 {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 150mm;
            height: 105mm;
        }
    </style>
</head>
<body>
<div id="main_container">
    <div id="container1" style="font-family: Helvetica, sans-serif; font-size: 14px; letter-spacing: 1mm;">
        <div style="position: absolute; top: 22mm; left: 4mm;">ABCDEF GHIJKLMN</div>
        <div style="position: absolute; top: 30mm; left: 4mm;">01234567890123456789</div>
        <div style="position: absolute; top: 38mm; left: 4mm;">ABCDEFGHIJKLMN</div>
        <div style="position: absolute; top: 55mm; left: 4mm;">0123456789</div>
    </div>
</div>
</body>
</html>

Rendered by Chrome:
screen shot 2018-06-12 at 10 02 28

Rendered by HtmlToPdf:
screen shot 2018-06-12 at 10 17 37

Is letter-spacing not supported?

@mapleLeat
Copy link

mapleLeat commented Jun 14, 2018

Encountered the same problem and the log does not remind

@danfickle
Copy link
Owner

No, not currently supported.

@mapleLeat
Copy link

@danfickle
Whether to consider adding this support, because this is important for my project
Thank you very much

danfickle added a commit that referenced this issue Jul 28, 2018
Limitations:
+ Can't use percent units.
+ Can't be used with text justification.
@danfickle
Copy link
Owner

The CSS letter-spacing property is now implemented in RC15.

Limitations are:

  • Can't use percent units.
  • Can't be used with text justification.

Thanks everyone for requesting support.

danfickle added a commit that referenced this issue Jul 29, 2018
So now supports different letter-spacing values at the inline level rather than just at the block level. Also supports a letter-spacing on the first-letter psuedo element.
@danmaidesenling
Copy link

Is there any alternative css style ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants