mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-01 15:50:16 +02:00
fpcanvas: Adds TextExtent
git-svn-id: trunk@19767 -
This commit is contained in:
parent
cca5ff0807
commit
6e481b3a73
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user