freetype
[Top][All Lists]
Advanced

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

Re: [ft] Examples?


From: Werner LEMBERG
Subject: Re: [ft] Examples?
Date: Sun, 26 Aug 2012 21:29:24 +0200 (CEST)

> > (1) Shift the glyph so that the new origin is the glyphs' center.
> > (2) Rotate it.
> > (3) Shift the glyph back to the previous origin.
>
> Do you have an example of rotating an individual glyph? I'm not sure
> how to implement that based on the high level description.

Sorry, no.  But the calls are something like

  FT_Vector to       = { -x, -y };
  FT_Vector from     = {  x,  y };
  FT_Matrix rotation = { ... };


  /* shift glyph from position (x,y) back to origin */
  FT_Glyph_Transform( glyph, 0, &to );

  /* rotate it */
  FT_Glyph_Transform( glyph, &rotation, 0 );

  /* shift glyph back to old position */
  FT_Glyph_Transform( glyph, 0, &from );


    Werner



reply via email to

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