Umm ... strange ... in the code it doesn't seam to draw them according to the width, but in my test some chars are drawn near and some are drawn far ...
Here is my code:
// Now draw the avatar nickname and it's inplay amount
try
// initialize free type font manager
ftfont.InitEngine;
Str := GetSkins().GetFontPath();
FontMgr.SearchPath := Str;
AFont := TFreeTypeFont.Create;
// create the canvas with the drawing operations
ImgCanvas:=TFPImageCanvas.create(AIntfImage);
// paint text
ImgCanvas.Font:=AFont;
ImgCanvas.Font.FPColor := colYellow;
ImgCanvas.Font.Name := 'ARIALN';
ImgCanvas.Font.Size := 10;
lNickName := FModel^.Seats[i].Avatar.NickName;
lTextWidth := AFont.GetTextWidth(lNickName);
lTextPosX := lPos.X + (Image.Width div 2) - lTextWidth div 2;
ImgCanvas.TextOut(lTextPosX, lPos.Y + 20, lNickName);
lInplayAmount := FModel^.Seats[i].Avatar.InplayAmount;
lTextWidth := AFont.GetTextWidth(lInplayAmount);
lTextPosX := lPos.X + (Image.Width div 2) - lTextWidth div 2;
ImgCanvas.TextOut(lTextPosX, lPos.Y + 35, lInplayAmount);
finally
if AFont nil then AFont.Free;
if ImgCanvas nil then ImgCanvas.Free;
end;
It should just draw "alfa" and "beta", there should be no such spaces.
Felipe Monteiro de Carvalho