[Top][All Lists]

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

Re: [Devel] Suspected error in cff_parse_font_matrix

From: Sander van der Wal
Subject: Re: [Devel] Suspected error in cff_parse_font_matrix
Date: Fri, 4 May 2001 16:18:32 +0200

What is interesting about this, Sander, is that the code you are
commenting out
to "fix" things is code I added to fix the exact smae problem that
fellow (Eric Blinn) was having. ;)

I think the real problem is here:

       *upm = (FT_UShort)( FT_DivFix( 0x10000L,
                           FT_DivFix( temp, 1000 ) ) >> 16 );

and in cffload.c where units_per_EM is assigned the value of
(if it is not zero) and 1000 otherwise.

>       temp = ABS( matrix->yy );
>       *upm = (FT_UShort)( FT_DivFix( 0x10000L,
>                           FT_DivFix( temp, 1000 ) ) >> 16 );
>       if ( temp != 0x10000L )
>       {
> >>>>> /* if I comment this code out, it appears to work
>         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 );
> >>>> */
>       }

The font when rendered was actually thice as big as it should be.

To me it apperas that the commente dout code will turn the matrix into
an identity matrix if xx and yy are equal. I don't know how to
formulate this better, but it looks a bit suspicious.

I would need to see the font that is causing the problem.  But from
what you
have written, the units per em of the font is supposed to be 2048, and
if the
font is showing up at half size, that is indicative of the units per
em being
set to 1000 or so.  Which is why I think the problem is with the units
per em
code, not the font matrix code.

I'll try to extract the font from the pdf file.


reply via email to

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