freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] Scaling of composite glyphs


From: Tuom Larsen
Subject: Re: [ft-devel] Scaling of composite glyphs
Date: Fri, 14 Jun 2013 20:27:39 +0200

Thank you! I totally missed the

      for ( i = num_base_points; i < num_points; i++ )
        FT_Vector_Transform( base_vec + i, &subglyph->transform );

lines.



On Fri, Jun 14, 2013 at 6:22 PM, Werner LEMBERG <address@hidden> wrote:

> It regards the "glyf" table and the scaling of composite glyphs.
> From what I understood the flags specify the magnitudes for scaling
> of all the points of the whole compontent/"subglyph".  By reading
> the code:
>
>   translate_array( num_points - num_base_points,
>                    base_vec + num_base_points,
>                    x, y );
>
> it seems that FT only offsets the component by "x" and "y".  The
> offset gets scaled, yes, but I cannot find where are the
> glyph-points scaled or rotated ("This could be used for 90-degree
> rotations, for example." - from the spec).

You can rotate a subglyph by setting the WE_HAVE_A_2X2 flag, see
`TT_Load_Composite_Glyph'.  The transformation matrix gets then
applied in function `TT_Process_Composite_Component'

> Please, what is the right way of doing this?  What should be scaled
> - only the offset or the whole component?

The subglyph itself gets scaled/rotated, then the offset gets
applied (scaled if the SCALED_COMPONENT_OFFSET flag is set).

> Does FT support this?

Certainly, since it is part of the TrueType specification.


    Werner


reply via email to

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