You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now, the problem is the "font-size:10". It causes the SVG-Viewer in Safari-based browsers (Mac, iOS) to display the fonts incorrectly. The problem disappears, when it is replaced by "font-size:10px".
I tracked this down and according to the SVG specification for the font-size attribute:
"This property refers to the size of the font from baseline to baseline when multiple lines of text are set solid in a multiline layout environment. For SVG, if a is provided without a unit identifier (e.g., an unqualified number such as 128), the SVG user agent processes the as a height value in the current user coordinate system.
If a is provided with one of the unit identifiers (e.g., 12pt or 10%), then the SVG user agent converts the into a corresponding value in the current user coordinate system by applying the rules described in Units."
Now, it seems to me that in "font-size:10" causes "10" to be interpreted in some strange user coordinate system (or not at all since it makes no difference which size is provided), while "10px" is interpreted correctly in the correct system.
Thanks for reporting this issue. Since I don't have any Apple device available, I can't reproduce the bug on it. However, the missing unit specifier affects the text rendering in Opera too.
I've added the "px" unit to the font-size attribute. As far as my recent tests can tell, it works fine and doesn't break the text layout created by SVG renderers that also create correct results without the additional unit (e.g. Squiggle).
Launchpad Details: #LPC Martin Gieseking - 2013-08-23 14:25:52 +0200
For a minimal document like this:
\documentclass{article}
\begin{document}
Hallo Welt.
\end{document}
dvisvgm produces an svg like this:
...
<style type='text/css'> </style>...
Now, the problem is the "font-size:10". It causes the SVG-Viewer in Safari-based browsers (Mac, iOS) to display the fonts incorrectly. The problem disappears, when it is replaced by "font-size:10px".
I tracked this down and according to the SVG specification for the font-size attribute:
"This property refers to the size of the font from baseline to baseline when multiple lines of text are set solid in a multiline layout environment. For SVG, if a is provided without a unit identifier (e.g., an unqualified number such as 128), the SVG user agent processes the as a height value in the current user coordinate system.
If a is provided with one of the unit identifiers (e.g., 12pt or 10%), then the SVG user agent converts the into a corresponding value in the current user coordinate system by applying the rules described in Units."
Now, it seems to me that in "font-size:10" causes "10" to be interpreted in some strange user coordinate system (or not at all since it makes no difference which size is provided), while "10px" is interpreted correctly in the correct system.
I suggest changing line 292 of SVGTree.cpp from
to
<< ";font-size:" << it->second->scaledSize() << "px}\n";
That should fix the problem.
Launchpad Details: #LP1215857 Till Tantau - 2013-08-23 12:18:35 +0200
The text was updated successfully, but these errors were encountered: