|
@@ -93,6 +93,8 @@ type
|
|
FCanvas: ISkCanvas;
|
|
FCanvas: ISkCanvas;
|
|
protected
|
|
protected
|
|
procedure DrawElBorder(El: TFresnelElement; Params: TBorderAndBackground); override;
|
|
procedure DrawElBorder(El: TFresnelElement; Params: TBorderAndBackground); override;
|
|
|
|
+ procedure DrawImage(const aLeft, aTop, aWidth, aHeight: TFresnelLength;
|
|
|
|
+ const aImage: TFPCustomImage); override;
|
|
procedure FillRect(const aColor: TFPColor; const aRect: TFresnelRect); override;
|
|
procedure FillRect(const aColor: TFPColor; const aRect: TFresnelRect); override;
|
|
procedure Line(const aColor: TFPColor; const x1, y1, x2, y2: TFresnelLength); override;
|
|
procedure Line(const aColor: TFPColor; const x1, y1, x2, y2: TFresnelLength); override;
|
|
procedure TextOut(const aLeft, aTop: TFresnelLength;
|
|
procedure TextOut(const aLeft, aTop: TFresnelLength;
|
|
@@ -358,9 +360,9 @@ begin
|
|
SkFamily:=aTypeFace.CSSFamily;
|
|
SkFamily:=aTypeFace.CSSFamily;
|
|
if SkFamily='' then
|
|
if SkFamily='' then
|
|
SkFamily:=SkDefaultFamilyname;
|
|
SkFamily:=SkDefaultFamilyname;
|
|
- aTypeface.SKTypeFace := TSkTypeface.MakeFromName(SkFamily, aFontStyle);
|
|
|
|
|
|
+ aTypeface.SKTypeFace := TSkTypeface.MakeFromName(UnicodeString(SkFamily), aFontStyle);
|
|
if aTypeface.SKTypeFace=nil then
|
|
if aTypeface.SKTypeFace=nil then
|
|
- aTypeface.SKTypeFace := TSkTypeface.MakeFromName(SkDefaultFamilyname, aFontStyle);
|
|
|
|
|
|
+ aTypeface.SKTypeFace := TSkTypeface.MakeFromName(UnicodeString(SkDefaultFamilyname), aFontStyle);
|
|
end;
|
|
end;
|
|
|
|
|
|
aFont:=TFresnelSkiaFont.Create;
|
|
aFont:=TFresnelSkiaFont.Create;
|
|
@@ -442,6 +444,8 @@ var
|
|
SkCorner: TSkRoundRectCorner;
|
|
SkCorner: TSkRoundRectCorner;
|
|
Side: TFresnelCSSSide;
|
|
Side: TFresnelCSSSide;
|
|
begin
|
|
begin
|
|
|
|
+ if El=nil then ;
|
|
|
|
+
|
|
if (Params.Box.Width<=MinStrokeWidth)
|
|
if (Params.Box.Width<=MinStrokeWidth)
|
|
or (Params.Box.Height<=MinStrokeWidth) then
|
|
or (Params.Box.Height<=MinStrokeWidth) then
|
|
begin
|
|
begin
|
|
@@ -521,6 +525,12 @@ begin
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TFresnelSkiaRenderer.DrawImage(const aLeft, aTop, aWidth,
|
|
|
|
+ aHeight: TFresnelLength; const aImage: TFPCustomImage);
|
|
|
|
+begin
|
|
|
|
+ writeln('ToDo: TFresnelSkiaRenderer.DrawImage ',aLeft,' ',aTop,' ',aWidth,' ',aHeight,' ',aImage<>nil);
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TFresnelSkiaRenderer.FillRect(const aColor: TFPColor;
|
|
procedure TFresnelSkiaRenderer.FillRect(const aColor: TFPColor;
|
|
const aRect: TFresnelRect);
|
|
const aRect: TFresnelRect);
|
|
var
|
|
var
|
|
@@ -554,12 +564,12 @@ var
|
|
X, Y: TFresnelLength;
|
|
X, Y: TFresnelLength;
|
|
begin
|
|
begin
|
|
if not TFresnelSkiaFontEngine.GetFont(aFont,FreSkiaFont) then exit;
|
|
if not TFresnelSkiaFontEngine.GetFont(aFont,FreSkiaFont) then exit;
|
|
- //writeln('TFresnelSkiaRenderer.TextOut Origin=',Origin.ToString,' LeftTop=',aLeft,',',aTop,' FontSize=',FreSkiaFont.SKFont.Size,' Col=',dbgs(aColor),' "',aText,'" Top=',FreSkiaFont.SKMetrics.Top,' Ascent=',FreSkiaFont.SKMetrics.Ascent,' Descent=',FreSkiaFont.SKMetrics.Descent,' Bottom=',FreSkiaFont.SKMetrics.Bottom,' CapHeight=',FreSkiaFont.SKMetrics.CapHeight);
|
|
|
|
|
|
+ //writeln('TFresnelSkiaRenderer.TextOut Origin=',Origin.ToString,' Left=',aLeft,' Top=',aTop,' FontSize=',FreSkiaFont.SKFont.Size,' Color=',dbgs(aColor),' "',aText,'" FontTop=',FreSkiaFont.SKMetrics.Top,' Ascent=',FreSkiaFont.SKMetrics.Ascent,' Descent=',FreSkiaFont.SKMetrics.Descent,' FontBottom=',FreSkiaFont.SKMetrics.Bottom,' CapHeight=',FreSkiaFont.SKMetrics.CapHeight);
|
|
SkPaint:=TSkPaint.Create;
|
|
SkPaint:=TSkPaint.Create;
|
|
SkPaint.setColor(FPColorToSkia(aColor));
|
|
SkPaint.setColor(FPColorToSkia(aColor));
|
|
aTextBlob:=TSkTextBlob.MakeFromText(UnicodeString(aText),FreSkiaFont.SKFont);
|
|
aTextBlob:=TSkTextBlob.MakeFromText(UnicodeString(aText),FreSkiaFont.SKFont);
|
|
X:=FOrigin.X+aLeft;
|
|
X:=FOrigin.X+aLeft;
|
|
- Y:=FOrigin.Y+aTop + FreSkiaFont.SKMetrics.CapHeight;
|
|
|
|
|
|
+ Y:=FOrigin.Y+aTop - FreSkiaFont.SKMetrics.Ascent;
|
|
Canvas.DrawTextBlob(aTextBlob, X, Y, SkPaint);
|
|
Canvas.DrawTextBlob(aTextBlob, X, Y, SkPaint);
|
|
end;
|
|
end;
|
|
|
|
|