freetype
[Top][All Lists]
Advanced

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

Re: Trouble with kerning


From: Werner LEMBERG
Subject: Re: Trouble with kerning
Date: Thu, 08 Jun 2000 20:54:48 +0000 (GMT)

> The problem: In my test - example, I want to render to word "PAIN".
> Between the 'P' and the 'A', kerning should be done. The piece of
> code above actually gives a (negative [of course]) value: -3. It
> looks good, when the font height is 12, but I always get this -3,
> even font height is 60, and then you see nothing about that kerning
> between these to characters.
> 
> How do I have to do it, that I get always a correct value back?

Kerning values are always returned in font units and must be scaled
afterwards.  From FT2's ftstring.c:

  FT_Get_Kerning( face, prev_index, glyph->glyph_index, &kern );
  kern.x = FT_MulFix( kern.x, face->size->metrics.x_scale );
  if ( hinted )
    kern.x = ( kern.x + 32 ) & -64;
  origin_x += kern.x;


      Werner



reply via email to

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