--bbox=min bounding box too tight, cropping issue

Bug #925196 reported by hlynd
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
dvisvgm
Invalid
Undecided
Martin Gieseking

Bug Description

when running the dvisvgm with the --bbox=min option,

Sometimes the resulting .svg file is cropped at the top and bottom. It depends on the font size and expression, for example, a mathematical formula.

In the attached example the top part of the digit 3 in the expression (-2)^3+2(-2^3) is cropped, unlike the 3 in the first expression.

changing the values in the generated .svg file viewBox='53.82 109.02 628.827 50.5117' to viewBox='53.82 108.02 628.827 50.5117'
moves the expression down, and the resulting .svg is not cropped.

The following expression was used to generate the example:
\begin{equation*}
\\lim_{x\rightarrow-2}\frac{x^{3}+2x^{3}-1}{5-3x}=\lim_{x\rightarrow-2}f\left(x\right)=f\left(-2\right)=\frac{\left(-2\right)^{3}+2\left(-2\right)^{3}-1}{5-3\left(-2\right)}=-\frac{1}{11}
\end{equation*}

Revision history for this message
hlynd (hlynd) wrote :

The file bounding box problem.svg was added: Example of the --bbox=min cropping problem

Revision history for this message
Martin Gieseking (martin-gieseking) wrote :

Thanks for your feedback. Your observation is correct. Some characters might be cropped sometimes. This isn't a bug, though. Since dvisvgm uses the TFM data by default to compute the bounding boxes and since some glyphs exceed their character box, cropped SVGs are the result.
If you want dvisvgm to compute the exact box of each glyph, use command-line option --exact. It should solve your problem.

Changed in dvisvgm:
status: Fix Released → Invalid
assignee: nobody → Martin Gieseking (martin-gieseking)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.