freetype
[Top][All Lists]
Advanced

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

[ft] FT_Get_Kerning


From: Graham MacDonald
Subject: [ft] FT_Get_Kerning
Date: Tue, 12 Dec 2006 09:50:51 +0000

Hi,
I've been using freetype to get the kerning pairs of a font.  This
font was initially OpenType, but I was having trouble gettting the
pairs I wanted, so I converted it to TrueType - this had the same
problems, but FT_HAS_KERNING() returned true in this case, so I kept
the ttf.

The problem I'm seeing is that FT_Get_Kerning returns a kern value of
0 for the pair í,d, where í is a latin small i with acute (0x00ed).
This results in a large gap between the characters.  Word and Gimp
both seem to have a negative kern to reduce the gap.

The code I use is:
        FT_UInt iGlyphIdx = FT_Get_Char_Index(m_Face, 205);
        FT_UInt dGlyphIdx = FT_Get_Char_Index(m_Face, 100);

        FT_Get_Kerning(m_Face, iGlyphIdx, dGlyphIdx, FT_KERNING_UNSCALED, &vec);

I have also tried default & unfitted modes with the same result (vec = 0,0).

First, is this the correct way of getting the kern info?  Second, if I
call GetKerningPairs in win32, I get 5973 pairs, even though the font
has 246 glyphs - I would expect more pairs.  Am I correct?

I'm a little rough on how kerning data is accessed in freetype, so
bear with me and apologies for any confusion in this email.  Finally,
nice library!

Thanks
--graham




reply via email to

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