freetype-devel
[Top][All Lists]
Advanced

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

Re: [Devel] Freetype 2.1.2 & rotated text


From: David Turner
Subject: Re: [Devel] Freetype 2.1.2 & rotated text
Date: Wed, 26 Jun 2002 22:35:15 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.0) Gecko/20020530

Hi Werner,

Werner LEMBERG wrote:
After I have switched to 2.1.2 (from 2.1.0) all rendered texts
that was rotated of 45 degrees, are rotated now of -45 degrees
(or 315 degrees).

Is it a bug or a planned future?


FT_Vector_Transform() was buggy.  We intermixed the xy and yx values
in the transformation matrix.  The rotation as done now is the correct
one.

It's probably something that I should have looked more deeply before
the release, but why do you consider the "old" implementation of
FT_Vector_Transform buggy ???

To me, it conformed to the definition of the FT_Matrix type, which
still is:

  /*************************************************************************/
  /*                                                                       */
  /* <Struct>                                                              */
  /*    FT_Matrix                                                          */
  /*                                                                       */
  /* <Description>                                                         */
  /*    A simple structure used to store a 2x2 matrix.  Coefficients are   */
  /*    in 16.16 fixed float format.  The computation performed is:        */
  /*                                                                       */
  /*       {                                                               */
  /*          x' = x*xx + y*xy                                             */
  /*          y' = x*yx + y*yy                                             */
  /*       }                                                               */
  /*                                                                       */
  /* <Fields>                                                              */
  /*    xx :: Matrix coefficient.                                          */
  /*                                                                       */
  /*    xy :: Matrix coefficient.                                          */
  /*                                                                       */
  /*    yx :: Matrix coefficient.                                          */
  /*                                                                       */
  /*    yy :: Matrix coefficient.                                          */
  /*                                                                       */
  typedef struct  FT_Matrix_
  {
    FT_Fixed  xx, xy;
    FT_Fixed  yx, yy;

  } FT_Matrix;

With this definition, an "oblique" transform can be written as:

   xx = 1.0
   xy = 0.2
   yx = 0
   yy = 1.0


I have just checked the Type1, CID, CFF and Type42 and they all load
a transform as [ xx yx xy yy dx dy ] which seems to correspond to
existing fonts...

Note also that the OpenType specification doesn't specify wether a
transformation matrix within a composite glyph is stored [ xx xy yx yy ]
or [ xx yx xy yy ] (according to the FT_Matrix definition)

The Apple TrueType specification suggests that it's really
[ xx yx xy yy ] however. The TrueType loader expects [ xx xy yx yy ]


So I think that FT_Vector_Transform wasn't buggy, the TrueType
composite loader was !!

I'll commit the fix right now..

Maybe 2.1.3 will be needed to avoid developers panic, hummm :-(


Regards,

- David Turner
- The FreeType Project  (www.freetype.org)





reply via email to

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