mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-08 14:35:58 +02:00
Implements a default font size for non-native text platforms
git-svn-id: trunk@35700 -
This commit is contained in:
parent
3e083b0851
commit
0fd18b3788
@ -178,6 +178,8 @@ type
|
||||
// For generic methods added in customdrawn
|
||||
// They are used internally in LCL-CustomDrawn, LCL app should not use them
|
||||
public
|
||||
DefaultFontSize: Integer;
|
||||
//
|
||||
AccumulatedStr: string;
|
||||
// The currently focused control
|
||||
FocusedControl: TWinControl;
|
||||
|
@ -92,6 +92,7 @@ begin
|
||||
|
||||
CDWidgetSet := Self;
|
||||
FTerminating := False;
|
||||
DefaultFontSize := 10;
|
||||
|
||||
BackendCreate;
|
||||
end;
|
||||
|
@ -2195,7 +2195,7 @@ begin
|
||||
if not IsValidDC(DC) then Exit;
|
||||
lDestIntfImage := TLazIntfImage(lDestCanvas.Image);
|
||||
|
||||
if (lDestCanvas.Font = nil) or (lDestCanvas.Font.Size = 0) then lFontSize := 10
|
||||
if (lDestCanvas.Font = nil) or (lDestCanvas.Font.Size = 0) then lFontSize := DefaultFontSize
|
||||
else lFontSize := Abs(lDestCanvas.Font.Size);
|
||||
|
||||
// Preparations finished, draw it using LazFreeType
|
||||
@ -4110,6 +4110,7 @@ begin
|
||||
ftFont := TFreeTypeFont(LazDC.ExtraFontData);
|
||||
Size.cx := Round(ftFont.TextWidth(Str));
|
||||
Size.cy := LazDC.AssignedFont.Size;
|
||||
if Size.cy = 0 then Size.cy := DefaultFontSize;
|
||||
|
||||
Result := True;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user