fpcanvas: Adds TextExtent

git-svn-id: trunk@19767 -
This commit is contained in:
sekelsenmat 2011-12-07 07:50:59 +00:00
parent cca5ff0807
commit 6e481b3a73
2 changed files with 7 additions and 1 deletions

View File

@ -331,6 +331,11 @@ begin
Result := TextWidth(Text);
end;
function TFPCustomCanvas.TextExtent(const Text: string): TSize;
begin
GetTextSize(Text, Result.cx, Result.cy);
end;
function TFPCustomCanvas.TextHeight(const Text: string): Integer;
begin
if Font is TFPCustomDrawFont then

View File

@ -17,7 +17,7 @@ unit FPCanvas;
interface
uses Math, sysutils, classes, FPImage;
uses Math, sysutils, classes, FPImage, Types;
const
PatternBitCount = sizeof(longword) * 8;
@ -296,6 +296,7 @@ type
procedure GetTextSize (text:string; var w,h:integer);
function GetTextHeight (text:string) : integer;
function GetTextWidth (text:string) : integer;
function TextExtent(const Text: string): TSize; virtual;
function TextHeight(const Text: string): Integer; virtual;
function TextWidth(const Text: string): Integer; virtual;
// using pen and brush