freetype-devel
[Top][All Lists]
Advanced

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

Re: [Devel] a simple question


From: David Turner
Subject: Re: [Devel] a simple question
Date: Thu, 19 Dec 2002 15:36:50 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2a) Gecko/20020910

Hello,

Steve Claridge wrote:
Apologies in advance if this question is a little to simple, I
have been reading through the FreeType docs but cannot sort this
problem out.

I am using Freetype to calculate font metrics for creating a PDF
document, here is a sample code segment (in pascal):

  err := FT_New_Face(FT_Library, 'MyFont', 0, face);
  if (err = 0) then
  begin
    FT_Set_Char_Size(face, 0, 33 * 64, 72, 72);

    aHeight := face.size.metrics.Height div 64; //includes leading.
    aAscent := face.size.metrics.Ascender div 64;
    aDescent := face.size.metrics.Descender div 64;
  end;

From my input height of 33 I get the following results:

aHeight = 45
aAscent = 30 aDescent = -7

I would've thought that aAscent + absolute(aDescent) would've equalled
the original height of 33, why doesn't it?


Because they're not directly related. Please read:

  http://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html#section-1

Regards,

- David Turner
- The FreeType Project  (www.freetype.org)




reply via email to

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