freetype-devel
[Top][All Lists]
Advanced

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

[ft-devel] Normalize the font matrix in cffobjs.c


From: Ning Dong
Subject: [ft-devel] Normalize the font matrix in cffobjs.c
Date: Wed, 11 Mar 2009 17:28:58 +0800

Hi, Werner
 
I'm reading the codes of FT2. In cffobjs.c, it said that "Normalize the font matrix so that `matrix->xx' is 1 ...", but the code is
     {
        FT_Matrix*  matrix = &dict->font_matrix;
        FT_Vector*  offset = &dict->font_offset;
        FT_ULong*   upm    = &dict->units_per_em;
        FT_Fixed    temp   = FT_ABS( matrix->yy );         //Why is yy? Should be matrix->xx?
 
        if ( temp != 0x10000L )
        {
          *upm = FT_DivFix( *upm, temp );
          matrix->xx = FT_DivFix( matrix->xx, temp );
          matrix->yx = FT_DivFix( matrix->yx, temp );
          matrix->xy = FT_DivFix( matrix->xy, temp );
          matrix->yy = FT_DivFix( matrix->yy, temp );
          offset->x  = FT_DivFix( offset->x,  temp );
          offset->y  = FT_DivFix( offset->y,  temp );
        }
        offset->x >>= 16; 
        offset->y >>= 16;
      }
 
In most case, it wouldn't cause error. But if yy != xx, the matrix is normalized that matrix->yy is 1.
 
BTW, this CFF_MAX_CID_FONTS limit in cfftypes.h is not mentioned in tn5176. Is it only a real-life limit?
As descibed in tn5176, it's possible to let each glyph has it's own Font DICT.
 
 
2009-03-11

Ning Dong

reply via email to

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