[gl2ps] SVG / bitmaps

barrand barrand at lal.in2p3.fr
Wed May 2 13:52:55 CEST 2007


On May 2, 2007, at 1:34 PM, Christophe Geuzaine wrote:

> 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"

  I have changed my version with the upper. Much better now.

    Thanks

      Guy

>
> 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
>
>
>
> <onx_crisp.svg>