[gl2ps] Impossible to set bold or italic fonts in SVG.

Jean-Baptiste Silvy jean-baptiste.silvy at scilab.org
Tue Feb 24 15:44:49 CET 2009


Hello,

I found a bug in SVG export related to fonts. GL2PS is supposed to
support the 14 Type 1 fonts, such  as "Times-BoldItalic".
The text export works well for Postscript and PDF outputs with these
fonts. However, for SVG output the Bold and Italic informations are not
used.

The problem is that the font name specified in gl2psText is directly
copied as the "font-family" in the SVG text markup.
This gives a text markup like this one:
<text fill="#000000" x="85" y="395" font-size="74"
font-family="Times-BoldItalic">foo</text>

However, it should be:
<text fill="#000000" x="85" y="395" font-size="74" font-family="Times"
font-style="italic" font-weight="bold">foo</text>

A possible solution to fix the bug could be to parse the font name to
retrieve the 3 SVG properties.
An other one would be to add more options on gl2psText.

Jean-Baptiste Silvy