View Issue Details

IDProjectCategoryView StatusLast Update
0035032LazarusLCLpublic2019-02-08 06:00
ReporterOndrej Pokorny Assigned ToMichl  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Target Version2.0.2Fixed in Version2.1 (SVN) 
Summary0035032: Missing TFPImageFreeTypeDrawer.DrawGlyph
DescriptionTFPImageFreeTypeDrawer doesn't overload the abstract method DrawGlyph.
Additional InformationPatch attached.
TagsNo tags attached.
Fixed in Revision60363
LazTarget2.0.2
Widgetset
Attached Files

Activities

Ondrej Pokorny

2019-02-07 11:50

developer  

lazfreetypefpimagedrawer.pas.patch (1,339 bytes)   
Index: components/lazutils/lazfreetypefpimagedrawer.pas
===================================================================
--- components/lazutils/lazfreetypefpimagedrawer.pas	(revision 60354)
+++ components/lazutils/lazfreetypefpimagedrawer.pas	(working copy)
@@ -53,6 +53,7 @@
     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 @@
   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);

Michl

2019-02-07 22:41

developer   ~0113938

Applied. Thank you!

Ondrej Pokorny

2019-02-08 06:00

developer   ~0113941

Thank you!

Issue History

Date Modified Username Field Change
2019-02-07 11:50 Ondrej Pokorny New Issue
2019-02-07 11:50 Ondrej Pokorny File Added: lazfreetypefpimagedrawer.pas.patch
2019-02-07 20:16 Michl Assigned To => Michl
2019-02-07 20:16 Michl Status new => assigned
2019-02-07 22:41 Michl Fixed in Revision => 60363
2019-02-07 22:41 Michl LazTarget => 2.0.2
2019-02-07 22:41 Michl Note Added: 0113938
2019-02-07 22:41 Michl Status assigned => resolved
2019-02-07 22:41 Michl Fixed in Version => 2.1 (SVN)
2019-02-07 22:41 Michl Resolution open => fixed
2019-02-07 22:41 Michl Target Version => 2.0.2
2019-02-08 06:00 Ondrej Pokorny Note Added: 0113941
2019-02-08 06:00 Ondrej Pokorny Status resolved => closed