neocotic / convert-svg

Node.js packages for converting SVG into other formats using headless Chromium
MIT License
198 stars 45 forks source link

Overall width of Text "IIIIIIIIIIII" in png of svg doesn't match Chrome desktop Version 69.0.3497.100 (Official Build) (64-bit) #49

Closed simonwilbert closed 2 years ago

simonwilbert commented 6 years ago

I'm struggling with an svg with a line of text in a roboto font taken more width in a png of an svg using this library compared to showing the svg within normal chrome desktop version. same issue on windows and mac.

<text class="_1601ee__text-static_noselect" id="Hy2vHgBtX-Roboto-text" letter-spacing="1" x="144.5" y="46.512" fill="black" fill-opacity="1" text-anchor="start" font-family="Roboto" font-size="60" font-weight="400" visibility="visible" style="opacity: 1; fill: rgb(0, 0, 0); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-width: 1;"><tspan id="Roboto-0">IIIIIIIIIIIIIIIIII</tspan></text>

any suggestions appreciated. i'm not using any clever svg attributes. i'm loading the correct font. i'm using a font weight which the font file states is correct.

neocotic commented 5 years ago

Sorry for the late respons but I'm not entirely sure what's going on. How are you loading the Roboto font in the SVG, a cleaner and more complete example of an SVG that can reproduce this problem would be helpful in debugging this issue.