|
@@ -876,7 +876,6 @@ type
|
|
procedure ComputeCSSValues; virtual; // call resolver to collect CSS values and resolve shorthands
|
|
procedure ComputeCSSValues; virtual; // call resolver to collect CSS values and resolve shorthands
|
|
procedure ComputeCSSAfterLayoutNode(Layouter: TFresnelLayouter); virtual; // after layouter node, before layouter traverse children
|
|
procedure ComputeCSSAfterLayoutNode(Layouter: TFresnelLayouter); virtual; // after layouter node, before layouter traverse children
|
|
function GetCSSString(AttrID: TCSSNumericalID; Compute: boolean; out Complete: boolean): string; virtual;
|
|
function GetCSSString(AttrID: TCSSNumericalID; Compute: boolean; out Complete: boolean): string; virtual;
|
|
- function GetComputedFontSize: TFresnelLength; virtual;
|
|
|
|
function GetComputedLength(Attr: TFresnelCSSAttribute; UseNaNOnFail: boolean = false): TFresnelLength; virtual; // on fail returns NaN
|
|
function GetComputedLength(Attr: TFresnelCSSAttribute; UseNaNOnFail: boolean = false): TFresnelLength; virtual; // on fail returns NaN
|
|
function GetComputedString(Attr: TFresnelCSSAttribute): string; virtual;
|
|
function GetComputedString(Attr: TFresnelCSSAttribute): string; virtual;
|
|
function GetComputedCSSString(AttrID: TCSSNumericalID): string; virtual; overload;
|
|
function GetComputedCSSString(AttrID: TCSSNumericalID): string; virtual; overload;
|
|
@@ -1019,7 +1018,6 @@ type
|
|
procedure DomChanged; override;
|
|
procedure DomChanged; override;
|
|
procedure Disconnecting; virtual;
|
|
procedure Disconnecting; virtual;
|
|
function AllocateFont(const Desc: TFresnelFontDesc): IFresnelFont; virtual;
|
|
function AllocateFont(const Desc: TFresnelFontDesc): IFresnelFont; virtual;
|
|
- function GetComputedFontSize: TFresnelLength; override;
|
|
|
|
function GetCSSString(AttrID: TCSSNumericalID; Compute: boolean; out Complete: boolean): string; override;
|
|
function GetCSSString(AttrID: TCSSNumericalID; Compute: boolean; out Complete: boolean): string; override;
|
|
class function CSSTypeID: TCSSNumericalID; override;
|
|
class function CSSTypeID: TCSSNumericalID; override;
|
|
class function CSSTypeName: TCSSString; override;
|
|
class function CSSTypeName: TCSSString; override;
|
|
@@ -2688,7 +2686,7 @@ end;
|
|
|
|
|
|
function TFresnelCSSRegistry.GetFontSize(El: TFresnelElement): string;
|
|
function TFresnelCSSRegistry.GetFontSize(El: TFresnelElement): string;
|
|
begin
|
|
begin
|
|
- Result:=FloatToCSSPx(El.GetComputedFontSize);
|
|
|
|
|
|
+ Result:=FloatToCSSPx(El.Font.GetSize);
|
|
end;
|
|
end;
|
|
|
|
|
|
function TFresnelCSSRegistry.GetMargin(El: TFresnelElement): string;
|
|
function TFresnelCSSRegistry.GetMargin(El: TFresnelElement): string;
|
|
@@ -3770,11 +3768,6 @@ begin
|
|
raise EFresnelFont.Create('TFresnelViewport.AllocateFont no FontEngine');
|
|
raise EFresnelFont.Create('TFresnelViewport.AllocateFont no FontEngine');
|
|
end;
|
|
end;
|
|
|
|
|
|
-function TFresnelViewport.GetComputedFontSize: TFresnelLength;
|
|
|
|
-begin
|
|
|
|
- Result:=FresnelDefaultFontSize;
|
|
|
|
-end;
|
|
|
|
-
|
|
|
|
function TFresnelViewport.GetCSSString(AttrID: TCSSNumericalID; Compute: boolean; out
|
|
function TFresnelViewport.GetCSSString(AttrID: TCSSNumericalID; Compute: boolean; out
|
|
Complete: boolean): string;
|
|
Complete: boolean): string;
|
|
var
|
|
var
|
|
@@ -3796,6 +3789,8 @@ begin
|
|
fcaZIndex: Result:='0';
|
|
fcaZIndex: Result:='0';
|
|
fcaWidth: Result:=FloatToCSSStr(Width)+'px';
|
|
fcaWidth: Result:=FloatToCSSStr(Width)+'px';
|
|
fcaHeight: Result:=FloatToCSSStr(Height)+'px';
|
|
fcaHeight: Result:=FloatToCSSStr(Height)+'px';
|
|
|
|
+ fcaFontSize: Result:=FloatToCSSStr(FresnelDefaultFontSize)+'px'; // todo use system font
|
|
|
|
+ fcaFontWeight: Result:=FloatToCSSStr(FresnelFontWeightNormal); // todo use system font
|
|
else
|
|
else
|
|
Result:=inherited;
|
|
Result:=inherited;
|
|
end;
|
|
end;
|
|
@@ -4420,11 +4415,6 @@ begin
|
|
Result:=true;
|
|
Result:=true;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function TFresnelElement.GetComputedFontSize: TFresnelLength;
|
|
|
|
-begin
|
|
|
|
- Result:=GetFont.GetSize;
|
|
|
|
-end;
|
|
|
|
-
|
|
|
|
function TFresnelElement.GetDPI(IsHorizontal: boolean): TFresnelLength;
|
|
function TFresnelElement.GetDPI(IsHorizontal: boolean): TFresnelLength;
|
|
begin
|
|
begin
|
|
if Parent<>nil then
|
|
if Parent<>nil then
|
|
@@ -5133,15 +5123,15 @@ begin
|
|
cu_pt: Result:=Viewport.DPI[IsHorizontal]/72; // 1pt = 1/72 in
|
|
cu_pt: Result:=Viewport.DPI[IsHorizontal]/72; // 1pt = 1/72 in
|
|
cu_pc: Result:=Viewport.DPI[IsHorizontal]/6; // 1pc = 12 pt
|
|
cu_pc: Result:=Viewport.DPI[IsHorizontal]/6; // 1pc = 12 pt
|
|
// relative to element's font
|
|
// relative to element's font
|
|
- cu_em: Result:=GetComputedFontSize; // todo
|
|
|
|
- cu_ex: Result:=GetComputedFontSize/2; // todo
|
|
|
|
- cu_cap: Result:=GetComputedFontSize; // todo
|
|
|
|
- cu_ch: Result:=GetComputedFontSize; // todo
|
|
|
|
|
|
+ cu_em: Result:=Font.GetSize; // todo
|
|
|
|
+ cu_ex: Result:=Font.GetSize/2; // todo
|
|
|
|
+ cu_cap: Result:=Font.GetSize; // todo
|
|
|
|
+ cu_ch: Result:=Font.GetSize; // todo
|
|
// relative to root's font
|
|
// relative to root's font
|
|
- cu_rem: Result:=Viewport.GetComputedFontSize; // todo
|
|
|
|
- cu_rex: Result:=Viewport.GetComputedFontSize/2; // todo
|
|
|
|
- cu_rcap: Result:=Viewport.GetComputedFontSize; // todo
|
|
|
|
- cu_rchh: Result:=Viewport.GetComputedFontSize; // todo
|
|
|
|
|
|
+ cu_rem: Result:=Viewport.Font.GetSize; // todo
|
|
|
|
+ cu_rex: Result:=Viewport.Font.GetSize/2; // todo
|
|
|
|
+ cu_rcap: Result:=Viewport.Font.GetSize; // todo
|
|
|
|
+ cu_rchh: Result:=Viewport.Font.GetSize; // todo
|
|
// relative to default viewport size
|
|
// relative to default viewport size
|
|
cu_vw,cu_svw,cu_lvw,cu_dvw: Result:=Viewport.Width/100;
|
|
cu_vw,cu_svw,cu_lvw,cu_dvw: Result:=Viewport.Width/100;
|
|
cu_vh,cu_svh,cu_lvh,cu_dvh: Result:=Viewport.Height/100;
|
|
cu_vh,cu_svh,cu_lvh,cu_dvh: Result:=Viewport.Height/100;
|
|
@@ -5307,7 +5297,7 @@ begin
|
|
end else if aComp.FloatUnit=cuPercent then
|
|
end else if aComp.FloatUnit=cuPercent then
|
|
begin
|
|
begin
|
|
if Parent<>nil then
|
|
if Parent<>nil then
|
|
- FFontDesc.Size:=aComp.Float*Parent.GetComputedFontSize/100;
|
|
|
|
|
|
+ FFontDesc.Size:=aComp.Float*Parent.Font.GetSize/100;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|