freetype-devel
[Top][All Lists]
Advanced

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

Re: [Devel] FIX? [was: Non-integer bbox for T1 font?]


From: Tom Kacvinsky
Subject: Re: [Devel] FIX? [was: Non-integer bbox for T1 font?]
Date: Wed, 7 Mar 2001 06:17:47 -0500 (EST)

The functions {T1,CID}_ToFixedArray are #defined'd to be the function
T1_ToFixedArray (which calls t1_tofixedarray). These latter two
functions are already in the psaux module.

Yes, the values for root->ascender, etc... should be rounded to the
larger (or, if negative, smaller) integer.  But what is an easy way of
rounding a 16.16 fixed to the larger integer?  Shifting right 16 bits
truncates, not rounds.  Perhaps adding 1, then shifting right 16 bits.
That will work for positive fixed values.  A corresponding operation
holds for negative fixed values.  Pehaps this should be an exportable
function like FT_DivFix.  We could call these functions FT_Ceil_Fix
and FT_Floor_Fix, because "rounding" to the smallest (largest) integer
not less (greater, resp.) than a given integer is really a ceiling
(floor, resp.)  operation.

Tom

On Wed, 7 Mar 2001, Werner LEMBERG wrote:

>
> > I just looked at the use of T1_CoordArray: it was only used in
> > parse_font_bbox.  The same function (under a different name:
> > CID_ToFixedArray) is used in only parse_font_bbox from the cid
> > module.  So I think these can be replaced to calls of
> > {T1,CID}_ToFixedArray.
>
> Without looking into the code: Can this be unified and moved to PSaux?
>
> > These values are FT_Shorts, and as type1.font_bbox.yMax is an
> > FT_Fixed, the cast is *bad* thing to do.  The least significant byte
> > (the fractional part) is used, when the most significant byte (the
> > integer part) should be used instead.  Perhaps root->ascender should
> > be assigned as follows:
> >
> >   root->ascender     = face->type1.font_bbox.yMax >> 16;
> >
> > etc...
>
> Looks better.  But shouldn't bbox values always be rounded to the
> larger integer?
>




reply via email to

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