piqnt / svgexport

SVG to PNG/JPEG command-line tool and Node.js module
927 stars 85 forks source link

Fix font spacing in docker environments #90

Closed manuelroth closed 3 years ago

manuelroth commented 3 years ago

Dear @shakiba, Thank you for this amazing project. It makes exporting svgs to pngs so much easier. I found an issue with font spacing in docker environments and created this PR to fix it. I would very much appreciate if you could have a look at this.

This PR adds the --font-render-hinting=none argument when launching puppeteer. This fixes font spacing issues when running chrome in headless mode in docker environments. See this thread in the puppeteer issue tracker for more details.

Before this change: Spacing between single characters are off (see 9 or 0 in the example below)

mw-legend

After this change: Spacing between single characters looks organic

mw-after

MichaelRoosz commented 3 years ago

Hello @manuelroth ,

thank you for your contribution.

MichaelRoosz commented 3 years ago

Merged

manuelroth commented 3 years ago

Hello @MichaelRoosz

Thank you very much for having a look at this. Would it be possible to push a new release with this change to npm?- This would allow us to use svgexport again in our package.json. Currently I am using my feature-branch that I created for this PR.

Kind regards, Manuel