Re: From Luca, Maths In AbiWord.

From: Luca Padovani <lpadovan_at_cs.unibo.it>
Date: Tue May 17 2005 - 20:24:10 CEST

On Tue, 2005-05-17 at 13:44 +0100, Tomas Frydrych wrote:
> These are in font units, which are identical to layout units at 100%
> zoom (layout units are always scaled by the zoom factor). There are
> special ftlu() and ftluD() functions for converting these to layout units.

OK thanks for the clarification.

It's the metrics coming out of glyphBox that I need to use though. I
went through the code (and freetype documentation) and found out that
those metrics are the ones for the glyph set at 120pt. Basically the
same kind returned by

        measureUnremappedCharForCache

while the needed metrics should be of the same kind as the one returned
by

        measureUnRemappedChar

Looking at the code in XAP_UnixFont I understand that the metrics
returned by these two methods are indeed related, but the conversion
function

        fontPoints2float

in the same file is not a member of the Font class and is not exposed
(although technically speaking it is not declared static).

Thus I come to the conclusion that the hack of computing the ratio
between the values returned by the two measure* methods above is
unavoidable.

Cheers,
--luca

Received on Tue May 17 20:24:59 2005

This archive was generated by hypermail 2.1.8 : Tue May 17 2005 - 20:24:59 CEST