Use the GetKerningPairs function (Views: 704)
Problem/Question/Abstract: 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: { ... } type TKerningpairarray = array[0..600] of Kerningpair; { ... } var kpa: TKerningpairarray; { ... } var i, Num: Integer; begin Canvas.Font.Name := 'Arial'; Num := GetKerningPairs(Canvas.Handle, 600, kpa); Memo1.Text := ''; for i := 0 to Num - 1 do Memo1.Lines.Add(IntToStr(kpa[i].wfirst) + ', ' + IntToStr(kpa[i].wsecond) + ', ' + IntToStr(kpa[i].ikernamount)); end; |