letter spacing issue
after generate pdf, letter spacing is incorrect.
http://prntscr.com/llofjg
Absolutely. Same problem. Just using Arial Font. The bug appears to be independent of the css.
I also run into the same issue, using Arial, on Windows 10.
html-pdf : 2.2.0 phantomjs-prebuilt : 2.1.16
Noticing horrible spacing issues with "T" and "C" T has negative kerning it seems as it is right up to the letter that comes after it, and C has too much, it seems there is almost a space worth between it and the next letter.
I'm facing a similar issue, where the pdf gets generated absolutely fine on local machine but has weird spacing issues on ubuntu server. Any updates yet?
OMG! I am facing the SAME issue. My ubuntu server is having these weird spacings with different letter combinations, but MY machine (macOS High Sierra) is working just fine with no spacing issues. I noticed that this started to happen when I switched to font Avenir.
Switching the Font helped. I am using this font: font-family: 'Sackers Gothic Std';
Not at pretty.
I am having the same issue. My observations
- Works fine on macOS(local machine) with both default and custom fonts
- Works fine on Amazon AWS Lambda with default fonts
- DOES NOT Work on Amazon AWS Lambda with custom fonts
I am using https://fonts.google.com/specimen/Source+Sans+Pro?selection.family=Open+Sans font and the output spacing is not correct. See the below text
Please let me know if any solution for this
Hi @anuj-cfra , am also facing same issue . did you fount any solution for this font spacing error .
Have you tried just changing the font?
fonts.txt Mentioned all changes what i did to workout the custom fonts in lambda without any letter spacing issue . its working 100%
I did what it says in that .txt but didn't work. I have to mention that my app in production is in EB, not in Lambda. Even so, I did this:
- downloaded a .woff font file in a folder

- In styles.js, I'm bringing the files so the generated HTML receive the corresponding style
export default styles => {
const extraStyles = styles ? styles.map(s => files[s]).join('') : ''
return `<style>
@font-face {
src: url(/fonts/NunitoSans-Regular.woff) format('woff');
font-family: 'Nunito Sans', sans-serif;
}
@font-face {
src: url(/fonts/NunitoSans-Black.woff) format('woff');
font-family: 'Nunito Sans', sans-serif;
font-weight: 900;
}
body {
color: #00171f;
font-family: 'Nunito Sans', sans-serif;
}
[...]
- Deploy into EB
The generated PDF still has letter separation issues.
Anyone find a solution for this issue?