Browse Source

lcl: fixed compile

mattias 1 year ago
parent
commit
9f20bd2056
1 changed files with 18 additions and 6 deletions
  1. 18 6
      src/lcl/fresnel.lcl.pas

+ 18 - 6
src/lcl/fresnel.lcl.pas

@@ -37,19 +37,21 @@ type
   public
   public
     Engine: TFresnelLCLFontEngine;
     Engine: TFresnelLCLFontEngine;
     Family: string;
     Family: string;
-    Kerning: string;
+    Kerning: TFresnelCSSKerning;
     Size: TFresnelLength;
     Size: TFresnelLength;
     Style: string;
     Style: string;
     Variant_: string;
     Variant_: string;
     Weight: TFresnelLength;
     Weight: TFresnelLength;
+    Width: TFresnelLength;
     LCLFont: TFont;
     LCLFont: TFont;
     destructor Destroy; override;
     destructor Destroy; override;
     function GetFamily: string;
     function GetFamily: string;
-    function GetKerning: string;
+    function GetKerning: TFresnelCSSKerning;
     function GetSize: TFresnelLength;
     function GetSize: TFresnelLength;
     function GetStyle: string;
     function GetStyle: string;
     function GetVariant: string;
     function GetVariant: string;
     function GetWeight: TFresnelLength;
     function GetWeight: TFresnelLength;
+    function GetWidth: TFresnelLength;
     function TextSize(const aText: string): TFresnelPoint; virtual;
     function TextSize(const aText: string): TFresnelPoint; virtual;
     function TextSizeMaxWidth(const aText: string; MaxWidth: TFresnelLength
     function TextSizeMaxWidth(const aText: string; MaxWidth: TFresnelLength
       ): TFresnelPoint; virtual;
       ): TFresnelPoint; virtual;
@@ -183,11 +185,13 @@ begin
   if Result<>0 then exit;
   if Result<>0 then exit;
   Result:=CompareText(Font1.Style,Font2.Style);
   Result:=CompareText(Font1.Style,Font2.Style);
   if Result<>0 then exit;
   if Result<>0 then exit;
+  Result:=CompareText(Font1.Variant_,Font2.Variant_);
+  if Result<>0 then exit;
   Result:=CompareValue(Font1.Weight,Font2.Weight);
   Result:=CompareValue(Font1.Weight,Font2.Weight);
   if Result<>0 then exit;
   if Result<>0 then exit;
-  Result:=CompareText(Font1.Variant_,Font2.Variant_);
+  Result:=CompareValue(Font1.Width,Font2.Width);
   if Result<>0 then exit;
   if Result<>0 then exit;
-  Result:=CompareText(Font1.Kerning,Font2.Kerning);
+  Result:=CompareValue(ord(Font1.Kerning),ord(Font2.Kerning));
 end;
 end;
 
 
 function CompareFresnelFontDescWithLCLFont(Key, Item: Pointer): integer;
 function CompareFresnelFontDescWithLCLFont(Key, Item: Pointer): integer;
@@ -203,9 +207,11 @@ begin
   if Result<>0 then exit;
   if Result<>0 then exit;
   Result:=CompareValue(Desc^.Weight,aFont.Weight);
   Result:=CompareValue(Desc^.Weight,aFont.Weight);
   if Result<>0 then exit;
   if Result<>0 then exit;
+  Result:=CompareValue(Desc^.Width,aFont.Width);
+  if Result<>0 then exit;
   Result:=CompareText(Desc^.Variant_,aFont.Variant_);
   Result:=CompareText(Desc^.Variant_,aFont.Variant_);
   if Result<>0 then exit;
   if Result<>0 then exit;
-  Result:=CompareText(Desc^.Kerning,aFont.Kerning);
+  Result:=CompareValue(ord(Desc^.Kerning),ord(aFont.Kerning));
 end;
 end;
 
 
 procedure FresnelRectToRect(const Src: TFresnelRect; out Dest: TRect);
 procedure FresnelRectToRect(const Src: TFresnelRect; out Dest: TRect);
@@ -717,6 +723,7 @@ begin
   aFont.Style:=Desc.Style;
   aFont.Style:=Desc.Style;
   aFont.Variant_:=Desc.Variant_;
   aFont.Variant_:=Desc.Variant_;
   aFont.Weight:=Desc.Weight;
   aFont.Weight:=Desc.Weight;
+  aFont.Width:=Desc.Width;
   FFonts.Add(aFont);
   FFonts.Add(aFont);
   Result:=aFont;
   Result:=aFont;
 end;
 end;
@@ -803,7 +810,7 @@ begin
   Result:=Family;
   Result:=Family;
 end;
 end;
 
 
-function TFresnelLCLFont.GetKerning: string;
+function TFresnelLCLFont.GetKerning: TFresnelCSSKerning;
 begin
 begin
   Result:=Kerning;
   Result:=Kerning;
 end;
 end;
@@ -828,6 +835,11 @@ begin
   Result:=Weight;
   Result:=Weight;
 end;
 end;
 
 
+function TFresnelLCLFont.GetWidth: TFresnelLength;
+begin
+  Result:=Width;
+end;
+
 function TFresnelLCLFont.TextSize(const aText: string): TFresnelPoint;
 function TFresnelLCLFont.TextSize(const aText: string): TFresnelPoint;
 var
 var
   p: TPoint;
   p: TPoint;