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

Christophe Geuzaine cgeuzaine at ulg.ac.be
Fri Feb 27 22:26:07 CET 2009


Jean-Baptiste Silvy wrote:
> 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.

Hi Jean-Baptiste - Good catch! I've added a test for the composed 
names... A bit brutal but it should do the trick.

Thanks,

Christophe


> An other one would be to add more options on gl2psText.
> 
> Jean-Baptiste Silvy
> 
> 
> _______________________________________________
> gl2ps mailing list
> gl2ps at geuz.org
> http://www.geuz.org/mailman/listinfo/gl2ps
> 
> 


-- 
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science
http://www.montefiore.ulg.ac.be/~geuzaine