Author: Lou Adler
I want to display text with the correct kerning (spacing). GetKerningPairs is a
function I need for that, but I have no clue how to use it.
Answer:
1 { ... }2 type3 TKerningpairarray = array[0..600] of Kerningpair;
4 { ... }5 6 var7 kpa: TKerningpairarray;
8 9 { ... }10 var11 i, Num: Integer;
12 begin13 Canvas.Font.Name := 'Arial';
14 Num := GetKerningPairs(Canvas.Handle, 600, kpa);
15 Memo1.Text := '';
16 for i := 0 to Num - 1 do17 Memo1.Lines.Add(IntToStr(kpa[i].wfirst) + ', ' + IntToStr(kpa[i].wsecond) + ', '
18 + IntToStr(kpa[i].ikernamount));
19 end;