Closed GoogleCodeExporter closed 9 years ago
The bug is with TextWidth Function, that is returning the wrong size (Try to
draw a FrameRect in the font, and you will see that the framerect is smaller
than the Font).
Parcial fix for this is :
function TPHXFont.TextExtent(const Text: AnsiString): TVector2i;
var Index : Cardinal;
var Character: Integer;
var LineWidth: Integer;
begin
// No text
if Length(Text) = 0 then
begin
Result.X:= 0;
Result.Y:= 0;
Exit;
end;
// Get the first character
Character:= CharacterMap[ Ord( Text[1] ) ];
// Compensate for the offset of the first character
Result.X:= FCharacters.List^[Character].Width - FCharacters.List^[Character].XAdvance - FCharacters.List^[Character].XOffset;
Result.Y:= Metric.Height;
Original comment by wagenhei...@gmail.com
on 14 Oct 2010 at 2:58
LineWidth:= Result.X;
Original comment by wagenhei...@gmail.com
on 14 Oct 2010 at 2:58
Original comment by andreas....@gmail.com
on 21 Oct 2010 at 6:00
Original issue reported on code.google.com by
wagenhei...@gmail.com
on 23 Sep 2010 at 2:37