[reportlab-users] renderSVG bug

Dinu Gherman reportlab-users@reportlab.com
Thu, 17 Oct 2002 09:45:22 +0200


Robin Becker:

> Eric Johnson <eggsy@gmx.de> writes
>> There appears to be a bug in the renderSVG code that handles paths.
>> The problem arises in the _fillAndStroke method when used with a path 
>> that
>> is not
>> closed.  The problem appears to be that the renderer does uses the 
>> default
>> fill
>> in this case rather than setting "fill: none"
>>
>> A simple fix for this is to add the following line as the first line 
>> in
>> the
>> _fillAndStroke method in renderSVG.py.
>>        self.setFillColor(self._fillColor)
>>
>> It may be more elegant to use the applyStateChange method.
>>
>> Attached is a simple example illustrating the bug.
>>
>> Eric
>>
>>
> I'm not the expert here as Dinu wrote this module, but I would expect
> that _fillAndStroke would do exactly that and given that there are
> default fill and stroke colours those would then be used.
>
> I think the real problem here is what constitutes a 'closed' path. I
> know that renderPM has to be fairly explicit about closing a path,
> perhaps SVG is more forgiving.

Sorry for the delay in responding, but I was travelling. Eric, would
you mind to make up some sample code snippets and output files show-
casing the bug? I'm not saying you don't have a point, but I can not
dedicate much effort to this issue at the moment and reusing your
samples might help to save time.

Regards,

Dinu

--
Dinu C. Gherman
......................................................................
"The British army is going all hi-tech. Now when you phone them up you
get a disjointed digital recording saying: "Thank you for phoning the
Ministry of Defence. If you wish to declare war on the United Kingdom,
please press one. If you are the American president and require Brit-
ish forces to join your own to give the spurious impression of inter-
national cooperation, please press two. If you wish to register a com-
plaint about the massacre of innocent civilians press three or hold
for an operator." (John O'Farrell, Guardian, Sat 20th July, 2002)