Re: [LIBART] problem with art_rgb_svp_alpha



In article <20010426163719 C27215 levien com>, Raph Levien
<raph levien com> writes
>On Thu, Apr 26, 2001 at 04:42:13PM +0100, Robin Becker wrote:
>> I'm trying to understand how and why art_rgb_svp_alpha should give such
>> different results for reflected vector paths
>> 
>> I have two paths 0 and 1 which are y symmetric around y=128 (They are
>> actually letter A from Adobe's Times-Roman font (as rendered by libgt1)
>> 
>> to each I'm doing
>> 
>>         svp = art_svp_from_vpath(vpath);
>> 
>>         art_rgb_svp_alpha(svp,
>>                         0,0,
>>                         width, height,
>>                         _RGBA(self->fillColor.value, self->fillOpacity),
>>                         buf,
>>                         rowstride,
>>                         NULL);
>> 
>> one appears to come out nicely aliased and the other appears completely
>> unaliased and horrible. Clearly this is something to do with winding
>> numbers or some such, but why and what can I do to get my characters to
>> go the right way up on my pixmaps and get the correct angular behaviour.
>
>Yeah, this is like the number one libart FAQ. art_rgb_svp_alpha only
>accepts paths with 0/1 winding numbers. If you reflect it, it will have
>-1/0 winding numbers. The art_svp_rewind functions can change an
>arbitrary path into one with 0/1 winding, but are right now fairly
>buggy.
>
>In the meantime, if you know that the path is either 0/1 or -1/0, then
>you can compute the area of the path, then if it's negative, reflect
>it. You can take a look at compute_area in gill's svg.c for an example
>implementation. It will need to be adapted slightly to work with vpath.
>
>Hope this helps,
>
>Raph
>
>

Thanks a lot that certainly allows me to fix up my glyphs and they now
look fine when plotted normally; effectively I'm just reversing the path
segment order.

Unfortunately I'm running into numerical problems with one of my test
cases and it seems that this occurs in art_svp_wind.c and in fact one
run seems to be looping forever. Is there any way to try and fix this?

I haven't had time yet to figure out the exact paths which are
problematic as I need to go through my code inserting flushes to ensure
stuff is written out before the looping starts.

Is libart being actively developed? It seems quite easy for an amateur
to bust/do silly things.
-- 
Robin Becker




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]