LazUtils: Missing TFPImageFreeTypeDrawer.DrawGlyph added. Issue #35032. Patch from Ondrej Pokorny

git-svn-id: branches/fixes_2_0@60389 -
This commit is contained in:
mattias 2019-02-09 08:49:18 +00:00
parent 5fba012ef1
commit c3d904cd87

View File

@ -53,6 +53,7 @@ type
procedure DrawHorizLine(x1,y,x2: integer; const c: TFPColor);
procedure FillPixels(const c: TFPColor);
procedure DrawText(AText: string; AFont: TFreeTypeRenderableFont; x,y: single; AColor: TFPColor); override;
procedure DrawGlyph(AGlyph: integer; AFont: TFreeTypeRenderableFont; x,y: single; AColor: TFPColor); override;
destructor Destroy; override;
property Image: TFPCustomImage read FImage;
end;
@ -455,6 +456,21 @@ begin
inherited Destroy;
end;
procedure TFPImageFreeTypeDrawer.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, GetClipRect, @RenderDirectlyClearType)
else
f.RenderGlyph(AGlyph, x, y, GetClipRect, @RenderDirectly);
end;
end;
{ TFPImageWithScanlineFreeTypeDrawer }
procedure TFPImageWithScanlineFreeTypeDrawer.MoveToPixel(x, y: integer);