freetype
[Top][All Lists]
Advanced

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

Re: [ft] Drawing unfilled shapes with FreeType2


From: Marco Wertz
Subject: Re: [ft] Drawing unfilled shapes with FreeType2
Date: Sat, 8 Nov 2014 12:38:26 +0100

> I think this is impossible to do.  Having a stroked object,
> transformation *must* change the outline strokes, too, or you get
> unstable results.  Just think of a square rotated by 45 degrees that
> gets scaled by (100,1) to make it extremely broad: Following your
> idea, the strokes would no longer be properly connected in the top and
> bottom corners because the angle between the square edges changes a
> lot (from 90 degrees to almost 180 degrees).
> 
> In other words, strokes must always be applied to the final shape.  A
> transformation matrix must be applied to the object before the
> stroking process starts.
> 
> What about using `FT_Stroker_ParseOutline' after transformation of the
> outline?

I've tried that of course but it doesn't make a difference and I don't 
understand
why. The shape looks exactly the same if FT_Outline_Transform() is called
before FT_Stroker_ParseOutline(). See the attached example code. I've modified
the example code to dump the shape into a BMP image so you can immediately see 
the
results. In the image you can see that the stroke size is 8 pixels on the x-axis
but only 4 pixels on the y-axis although the transformation matrix is applied
before calling FT_Stroker_ParseOutline().

Marco

Attachment: test.c
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]