mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-01 21:40:25 +02:00
LazReport, fix problem on preview with zoom level<>100% sometimes a different font size was used for text objects (mostly non-windows targets)
git-svn-id: trunk@28806 -
This commit is contained in:
parent
92a22bdc4c
commit
3fe140b210
@ -2471,17 +2471,21 @@ end;
|
|||||||
|
|
||||||
procedure TfrMemoView.AssignFont(aCanvas: TCanvas);
|
procedure TfrMemoView.AssignFont(aCanvas: TCanvas);
|
||||||
begin
|
begin
|
||||||
with aCanvas do
|
{$IFDEF DebugLR}
|
||||||
begin
|
DebugLnEnter('AssignFont (%s) INIT: Self.Font.Size=%d aCanvas.Font.Size=%d',
|
||||||
{$IFDEF DebugLR}
|
[self.Font.Name,Self.Font.Size,ACanvas.Font.Size]);
|
||||||
DebugLn('AssignFont(%s)',[self.Font.Name]);
|
{$ENDIF}
|
||||||
{$ENDIF}
|
//** Brush.Style := bsClear;
|
||||||
//** Brush.Style := bsClear;
|
aCanvas.Font.Assign(Self.Font);
|
||||||
Font.Assign(Self.Font);
|
if Self.Font.Name='' then
|
||||||
//Font := Self.Font;
|
aCanvas.Font.Name := 'default';
|
||||||
if not IsPrinting and (ScaleY<>0) then
|
//Font := Self.Font;
|
||||||
Font.Height := -Round(Font.Size * 96 / 72 * ScaleY);
|
if not IsPrinting and (ScaleY<>0) then
|
||||||
end;
|
ACanvas.Font.Height := -Round(Self.Font.Size * 96 / 72 * ScaleY);
|
||||||
|
{$IFDEF DebugLR}
|
||||||
|
DebugLnExit('AssignFont (%s) DONE: Self.Font.Size=%d aCanvas.Font.Size=%d',
|
||||||
|
[self.Font.Name,Self.Font.Size,ACanvas.Font.Size]);
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -2773,7 +2777,6 @@ var
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// handle any alignment with same code
|
// handle any alignment with same code
|
||||||
AssignFont(Canvas);
|
|
||||||
Ts := Canvas.TextStyle;
|
Ts := Canvas.TextStyle;
|
||||||
Ts.Layout :=tlTop;
|
Ts.Layout :=tlTop;
|
||||||
Ts.Alignment :=self.Alignment;
|
Ts.Alignment :=self.Alignment;
|
||||||
@ -2898,6 +2901,10 @@ var
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF DebugLR}
|
||||||
|
DebugLnEnter('TfrMemoView.ShowMemo INIT Font.Size=%d Canvas.Font.Size=%d',
|
||||||
|
[Font.Size, Canvas.Font.Size]);
|
||||||
|
{$ENDIF}
|
||||||
AssignFont(Canvas);
|
AssignFont(Canvas);
|
||||||
SavX:=X;
|
SavX:=X;
|
||||||
SavY:=Y;
|
SavY:=Y;
|
||||||
@ -2918,6 +2925,9 @@ begin
|
|||||||
finally
|
finally
|
||||||
X:=SavX;
|
X:=SavX;
|
||||||
Y:=SavY;
|
Y:=SavY;
|
||||||
|
{$IFDEF DebugLR}
|
||||||
|
DebugLnExit('TfrMemoView.ShowMemo DONE Font.Size=%d Canvas.Font.Size=%d',[Font.Size, Canvas.Font.Size]);
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
(*
|
(*
|
||||||
if (Adjust and $18) <> 0 then
|
if (Adjust and $18) <> 0 then
|
||||||
|
Loading…
Reference in New Issue
Block a user