freetype
[Top][All Lists]
Advanced

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

Re: [Freetype] Y advance when a glyph is rotated.


From: jonathan . foster
Subject: Re: [Freetype] Y advance when a glyph is rotated.
Date: Mon, 19 Aug 2002 10:43:23 +0100

Hi,

> But the values in aglyph->advance are really weird. For instance
> on the x axis the aglyph->advance.x is very different from
> int(slot->advance.x >> 6 ) ... I also tried to modify aglyph->advance.x
> with the >> operator but I had no success until now.

Try (aglyph->advance.x >> 16).

In FreeType 2.0.8, the X advance was (aglyph->advance.x >> 6) before the call 
to FT_Glyph_Transform, and (aglyph->advance.x >> 16) after the call.  This is 
probably a bug, but I haven't had chance to see if it's fixed in 2.1.2.

Kind Regards,

Jon Foster



Olivier Couet <address@hidden> wrote:

 Hi All,

 I am rotating a glyph with something like:

   FT_Glyph aglyph;
   FT_GlyphSlot slot = face->glyph;
   FT_Get_Glyph ( slot, &aglyph );
   FT_Glyph_Transform( aglyph, RotMatrix, NULL );
   FT_Glyph_To_Bitmap( &aglyph, ft_render_mode_normal, 0, 1);

 It seems not to bad, each glyph is rotated. Now to draw the characters
one after each other I need the x and y advance. I have no problem for the
x advance I get it via, int(slot->metrics.horiAdvance>>6) or
int(slot->advance.x>>6) both seems equivalent.

 But I have problems to get a proper y advance. I thought that
int(slot->advance.y>>6) is what I need but it is always equal to 0 ...

 I noticed that there is also "advance" values in: aglyph->advance.x and
aglyph->advance.y. The rotation seems to have some action on these 2
values. If I have no rotation the y value is zero, and it changes when I
rotate. But the values in aglyph->advance are really weird. For instance
on the x axis the aglyph->advance.x is very different from
int(slot->advance.x >> 6 ) ... I also tried to modify aglyph->advance.x
with the >> operator but I had no success until now.

Some body have an idea about that ?

 Cheers,       Olivier

--
Org:    CERN - European Laboratory for Particle Physics.
Mail:   1211 Geneve 23 - Switzerland
E-Mail: address@hidden                      Phone: +41 22 7676522
WWW:    http://cern.ch/Olivier.Couet/              Fax:   +41 22 7677155


_______________________________________________
Freetype mailing list
address@hidden
http://www.freetype.org/mailman/listinfo/freetype







reply via email to

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