mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 10:47:58 +02:00
LCL: Glyph drawer for LazFreeType. Issue #28079, patch from Johann.
git-svn-id: trunk@49106 -
This commit is contained in:
parent
09eff40893
commit
09ad3abd3c
@ -47,7 +47,8 @@ type
|
||||
procedure DrawHorizLine(x1,y,x2: integer; const c: TFPColor);
|
||||
procedure FillRect(x,y,x2,y2: integer; const c: TFPColor; ASetPixels: boolean = True);
|
||||
procedure FillPixels(const c: TFPColor; ASetPixels: boolean = True);
|
||||
procedure DrawText(AText: string; AFont: TFreeTypeRenderableFont; x,y: single; AColor: TFPColor); override;
|
||||
procedure DrawText(AText: string; AFont: TFreeTypeRenderableFont; x,y: single; AColor: TFPColor); override; overload;
|
||||
procedure DrawGlyph(AGlyph: integer; AFont: TFreeTypeRenderableFont; x,y: single; AColor: TFPColor); override; overload;
|
||||
property Destination: TLazIntfImage read FDestination write SetDestination;
|
||||
destructor Destroy; override;
|
||||
end;
|
||||
@ -723,6 +724,21 @@ begin
|
||||
AFont.RenderText(AText, x, y, rect(0,0,Destination.Width,Destination.Height), @RenderDirectly);
|
||||
end;
|
||||
|
||||
procedure TIntfFreeTypeDrawer.DrawGlyph(AGlyph: integer;
|
||||
AFont: TFreeTypeRenderableFont; x, y: single; AColor: TFPColor);
|
||||
var f: TFreeTypeFont;
|
||||
begin
|
||||
if AFont is TFreeTypeFont then
|
||||
begin
|
||||
f := TFreeTypeFont(AFont);
|
||||
FColor := AColor;
|
||||
if AFont.ClearType then
|
||||
f.RenderGlyph(AGlyph, x, y, rect(0,0,Destination.Width,Destination.Height), @RenderDirectlyClearType)
|
||||
else
|
||||
f.RenderGlyph(AGlyph, x, y, rect(0,0,Destination.Width,Destination.Height), @RenderDirectly);
|
||||
end;
|
||||
end;
|
||||
|
||||
destructor TIntfFreeTypeDrawer.Destroy;
|
||||
begin
|
||||
inherited Destroy;
|
||||
|
Loading…
Reference in New Issue
Block a user