mgieseki / dvisvgm

A fast DVI, EPS, and PDF to SVG converter
https://dvisvgm.de
GNU General Public License v3.0
294 stars 28 forks source link

PDF -> SVG: Pixels cut-off on right border #256

Closed MagielBruntink closed 6 months ago

MagielBruntink commented 6 months ago

In the generated test.svg from the attached test.pdf, the closing parenthesis ) has a few pixels cut-off.

image

Command used:

dvisvgm.exe --pdf -o test.svg --exact-bbox --no-fonts test.pdf

Version of the program (compiled on MSYS2/ucrt):

dvisvgm 3.1.2 (x86_64-w64-mingw32)
----------------------------------
brotli:      1.1.0
clipper:     6.2.1
freetype:    2.13.2
Ghostscript: 10.02.1
kpathsea:    6.3.5
mutool:      1.23.7
potrace:     1.16
xxhash:      0.8.2
zlib:        1.3

What could be the source of this issue?

MagielBruntink commented 6 months ago

The same happens without --exact-bbox

mgieseki commented 6 months ago

This seems to be a rounding issue regarding font sizes. I'll have a look at it later today. --exact-bbox only works with DVI files. EPS and PDF files contain bounding box information which are directly applied to the generated SVG files without computing the extents of the graphic objects.

MagielBruntink commented 6 months ago

Thanks for the fix!

mgieseki commented 6 months ago

You're welcome.