[gl2ps] SVG / bitmaps

Christophe Geuzaine cgeuzaine at ulg.ac.be
Wed May 2 13:34:46 CEST 2007


barrand wrote:
> 
> On May 1, 2007, at 5:06 PM, Christophe Geuzaine wrote:
> 
>   Hello Christophe
> 
>> barrand wrote:
>>>     Hello
>>>    Else, I have tried the SVG file production by using the 1.3.2  
>>> version.
>>>   But I have only partial output of my things. I clearly miss all things
>>>   related to bitmaps.  (Then, for me, the visualization of TTF fonts
>>>   and the polymarkers).
>>>    Then the question, are the bitmaps  handled with SVG ?
>>
>> Hi Guy - to handle bitmaps with SVG your app needs to be linked with
>> libpng, and you need to compile gl2ps.c with "GL2PS_HAVE_LIBPNG" defined
>> (this gets defined automatically in certain cases: look at gl2ps.h).
>>
>> GL2PS then automatically embeds little base64-encoded PNG versions of
>> your bitmaps in the SVG file.
> 
>   Ok. Then I have build with GL2PS_HAVE_LIBPNG and arrange my things
>  to link with libpng. Fine. Now I can produce .svg files and the bitmaps 
> are
>  now ok. Progress.
> 
>   But incidently, by playing with the SVG on 3D scenes, I see that for 
> solids
>  rendered with lightening and PHONG, I see the "wires/edges" of the 
> polygons.
>  (It is similar to what we get when viewing the .ps with ghostview but by
>  having the state/antialias menu item).
>   Do I have to set some option in order to correct that ?
>   Or is it related to the viewer program ? I use Firefox 1.5.0.11.

Indeed, it's an antialiasing problem. I just googled this a little bit, 
and I found a decent fix: we should specify

   shape-rendering="crispEdges"

in the SVG file (see attachement). I will change GL2PS so that we always 
add this attribute in the top-level group.

> 
>   I have put an example under :
>      http://openscientist.lal.in2p3.fr/download/tmpup
>  There is three files : onx.svg, onx.ps, onx.pdf.
>  (Incidently the onx.pdf shows no primitives by doing "open onx.pdf"

Yes, that's a know bug in Apple's Preview.app :-(

Christophe






>  on my Mac...). The onx.ps is ok with ghostview, but the onx.svg
>  shows polygon edges by viewing with Firefox.
> 
>     Cheers
> 
>       Guy
> 
>>
>> Cheers,
>> Christophe
>>
>>
>>>      Regards
>>>        Guy Barrand
>>> _______________________________________________
>>> 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
>>
> 
> 
> 


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



-------------- next part --------------
A non-text attachment was scrubbed...
Name: onx_crisp.svg
Type: image/svg+xml
Size: 36135 bytes
Desc: not available
URL: <http://www.geuz.org/pipermail/gl2ps/attachments/20070502/4d4531bd/attachment.svg>