Wrong SVG width

Asked by Mohamed Sayed on 2015-11-26

while processing some DVI files using DVISVGM tool, i noticed that some characters are trimmed at it's end and after investigations i figured out that the SVG width created from DVISVGM is wrong and some characters' widths were not measured.

As Example:

<svg height='12.496pt' version='1.1' viewBox='-0.0498162 -12.4461 3.81852 12.496' width='3.81852pt' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>
<font horiz-adv-x='0' id='MinionMath-BoldCapt-T1--base'>
<font-face ascent='1041' descent='-369' font-family='MinionMath-BoldCapt-T1--base' units-per-em='1000'/>
<glyph d='M276 0V39C214 45 208 49 208 112V699C152 684 79 670 17 663V628C72 621 77 620 77 561V112C77 52 72 48 11 39V0H276Z' glyph-name='l' horiz-adv-x='285' unicode='l' vert-adv-y='285'/>
<font horiz-adv-x='0' id='MinionMath-Capt-MXP--base'>
<font-face ascent='3443' descent='-2856' font-family='MinionMath-Capt-MXP--base' units-per-em='1000'/>
<glyph d='M490 623L468 651C434 618 405 602 360 602C327 602 300 608 259 619C204 636 179 642 146 642C101 642 46 623 0 561L22 533C59 565 94 582 139 582C175 582 196 573 232 564C277 552 312 542 349 542C396 542 452 559 490 623Z' glyph-name='tildecomb.hsize1' horiz-adv-x='490' unicode='㐘' vert-adv-y='490'/>
<g id='page1'>
<text font-family='MinionMath-Capt-MXP--base' font-size='13' x='-1.3375' y='-3.37963'>㐘</text>
<text font-family='MinionMath-BoldCapt-T1--base' font-size='13' x='0' y='0'>l</text>

The width "3.81852pt" in the first line of code is not correct because after measuring the width of "~" character i found it equal to "6.73pt" while the SVG width is "3.81852pt" and after fixing the width to be "6.73pt" and fixing the viewbox also, the end result is correct SVG and no characters trimmed at the end.

Why this Happen and what can i do regarding such issues?


Question information

English Edit question
dvisvgm Edit question
Martin Gieseking Edit question
Last query:
Last reply:

This question was reopened

Please provide a minimal TeX/LaTeX file that can be used to reproduce the issue. The SVG file itself isn't of much help, unfortunately.
Do you get the correct result if you call dvisvgm with the additional option --exact?

Mohamed Sayed (mohamed-sayed) said : #2

Hi Martin,

Forgive my late response.
You made a great help to me figuring out the problem and finally i discovered that the problem was caused by LaTeX Preview Package and not because of the DVISVGM.
Thanks a lot and sorry for disturbance.

Glad to hear you could solve the issue. No need to apologize. Feel free to ask further questions if you have any problems with dvisvgm.

Mohamed Sayed (mohamed-sayed) said : #4

Thank You Martin, i need to ask if there is any solution for that issue caused by Preview package? because the \PreviewBorder length set to 0.05 causing this problem and if i increase it to a larger number that will affect other cases which will not need a larger number of \PreviewBorder

If the problem is caused by the preview package, I can't do anything against it. In this case you should ask the developer of the package whether this is a bug he can fix. Maybe someone at tex.stackexchange.com could help, too. Unfortunately, I don't know any details of the preview package and can't help you with this.

Can you help with this problem?

Provide an answer of your own, or ask Mohamed Sayed for more information if necessary.

To post a message you must log in.