mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-25 18:01:53 +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);
|
Result := TextWidth(Text);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TFPCustomCanvas.TextExtent(const Text: string): TSize;
|
||||||
|
begin
|
||||||
|
GetTextSize(Text, Result.cx, Result.cy);
|
||||||
|
end;
|
||||||
|
|
||||||
function TFPCustomCanvas.TextHeight(const Text: string): Integer;
|
function TFPCustomCanvas.TextHeight(const Text: string): Integer;
|
||||||
begin
|
begin
|
||||||
if Font is TFPCustomDrawFont then
|
if Font is TFPCustomDrawFont then
|
||||||
|
|||||||
@ -17,7 +17,7 @@ unit FPCanvas;
|
|||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
uses Math, sysutils, classes, FPImage;
|
uses Math, sysutils, classes, FPImage, Types;
|
||||||
|
|
||||||
const
|
const
|
||||||
PatternBitCount = sizeof(longword) * 8;
|
PatternBitCount = sizeof(longword) * 8;
|
||||||
@ -296,6 +296,7 @@ type
|
|||||||
procedure GetTextSize (text:string; var w,h:integer);
|
procedure GetTextSize (text:string; var w,h:integer);
|
||||||
function GetTextHeight (text:string) : integer;
|
function GetTextHeight (text:string) : integer;
|
||||||
function GetTextWidth (text:string) : integer;
|
function GetTextWidth (text:string) : integer;
|
||||||
|
function TextExtent(const Text: string): TSize; virtual;
|
||||||
function TextHeight(const Text: string): Integer; virtual;
|
function TextHeight(const Text: string): Integer; virtual;
|
||||||
function TextWidth(const Text: string): Integer; virtual;
|
function TextWidth(const Text: string): Integer; virtual;
|
||||||
// using pen and brush
|
// using pen and brush
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user