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: Detlef Würkner
Subject: Re: [Devel] Freetype 2.1.2 & rotated text
Date: Wed, 26 Jun 2002 12:41:53 +0200

address@hidden (Werner LEMBERG) wrote:

> > Its a problem... The latest fix of FT_Vector_Transform() swapped
> > xy and yx of the input matrix. Now the rotation has changed direction,
> > and the shearing has changed the axis. We'll have to check all calls
> > to FT_Vector|Outline|Glyph_Transform()...?
[...]
> > while the source code (src/base/ftsynth.c) uses the old behaviour
> > (yx = 0 for horizontal shear)
> > ----8<----
> >     /* For italic, simply apply a shear transform, with an angle */
> >     /* of about 12 degrees.                                      */
> > 
> >     transform.xx = 0x10000L;
> >     transform.yx = 0x00000L;
> > 
> >     transform.xy = 0x06000L;
> >     transform.yy = 0x10000L;
> > 
> >     FT_Outline_Transform( outline, &transform );
> > ----8<----

here xy and yx have to be swapped IMHO.

> > Just looked into the source code of ttf.library which uses
> > old FreeType 1.3.1 and found it uses yx = 0 for horizontal shear
> > (old behaviour).
> 
> I fear even in the 1.3.1 it is (partially) incorrect.  This is the right
> way to muliply a vector with a transformation matrix:
[...]
> Boys, boys, I really wonder why *nobody* has noticed this for such a
> long time...

:-)

> I fear we have to add a big exclamation mark that the transformation
> functions were incorrect in previous versions.  Still using the
> incorrect functions is perhaps not a good idea...

IMHO the Type1/Type42/CFF drivers of FT2 must be broken either before or
after the FT_Vector_Transform() fix. They parse the font transformation
matrix stored in the font file:

---- src/cff/cffparse.c line 329 ----
      matrix->xx = cff_parse_fixed_thousand( data++ );
      matrix->yx = cff_parse_fixed_thousand( data++ );
      matrix->xy = cff_parse_fixed_thousand( data++ );
      matrix->yy = cff_parse_fixed_thousand( data++ );
----8<----

---- src/type42/t42parse.c line 340 ----
    matrix->xx = temp[0];
    matrix->yx = temp[1];
    matrix->xy = temp[2];
    matrix->yy = temp[3];
----8<----

---- src/type1/t1load.c line 921 ----
    matrix->xx = temp[0];
    matrix->yx = temp[1];
    matrix->xy = temp[2];
    matrix->yy = temp[3];
----8<----

Could someone please check whether xy and yx have to be swapped here?

> Alternatively, we could introduce new functions for `correct'
> multipication.  While this may be backwards compatible, it is really
> extremely bizarre IMHO.
> 
> Opinions, please.

Can speak for Amiga only. No problem with that since everything that uses
FreeType is "statically linked" (thats the correct term?) so the
application always "knows" whether the linked FreeType version did rotate
clockwise or counter-clockwise, so stay with the fixed correct version.

Ciao, Detlef
-- 
_ // address@hidden
\X/  Detlef Wuerkner, Langgoens/Germany



reply via email to

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