diff options
-rw-r--r-- | docview/components/richtext/CanvasFontManager.pas | 4 | ||||
-rw-r--r-- | docview/components/richtext/RichTextStyleUnit.pas | 2 | ||||
-rw-r--r-- | extras/contributed/nicegrid/fpg_nicegrid.pas | 2 | ||||
-rw-r--r-- | src/corelib/fpg_base.pas | 2 | ||||
-rw-r--r-- | src/corelib/fpg_main.pas | 5 | ||||
-rw-r--r-- | src/gui/fpg_editbtn.pas | 8 |
6 files changed, 9 insertions, 14 deletions
diff --git a/docview/components/richtext/CanvasFontManager.pas b/docview/components/richtext/CanvasFontManager.pas index edeb8cb9..e650141b 100644 --- a/docview/components/richtext/CanvasFontManager.pas +++ b/docview/components/richtext/CanvasFontManager.pas @@ -222,7 +222,7 @@ begin // if nothing found, use default font of fpGUI if FontDesc = '' then - FontDesc := fpgApplication.DefaultFont.FontDesc; + FontDesc := fpgStyle.DefaultFont.FontDesc; end; @@ -242,7 +242,7 @@ destructor TCanvasFontManager.Destroy; var i: Integer; begin - FCanvas.Font := fpgApplication.DefaultFont; + FCanvas.Font := fpgStyle.DefaultFont; FDefaultFont.Free; for i := 0 to FFontCache.Count-1 do diff --git a/docview/components/richtext/RichTextStyleUnit.pas b/docview/components/richtext/RichTextStyleUnit.pas index e0cc3b62..f6582802 100644 --- a/docview/components/richtext/RichTextStyleUnit.pas +++ b/docview/components/richtext/RichTextStyleUnit.pas @@ -470,7 +470,7 @@ end; Procedure TRichTextSettings.AssignFont(var AFont: TfpgFont; NewFont: TfpgFont ); begin If NewFont = Nil Then - NewFont := fpgApplication.DefaultFont; + NewFont := fpgStyle.DefaultFont; if FontSame( NewFont, AFont ) then begin diff --git a/extras/contributed/nicegrid/fpg_nicegrid.pas b/extras/contributed/nicegrid/fpg_nicegrid.pas index a65448fb..233f9962 100644 --- a/extras/contributed/nicegrid/fpg_nicegrid.pas +++ b/extras/contributed/nicegrid/fpg_nicegrid.pas @@ -3417,7 +3417,7 @@ end; constructor TfpgMergeCell.Create; begin inherited Create; - Font := fpgApplication.DefaultFont.FontDesc; + Font := fpgStyle.DefaultFont.FontDesc; end; destructor TfpgMergeCell.Destroy; diff --git a/src/corelib/fpg_base.pas b/src/corelib/fpg_base.pas index e6e3ab7e..365ca20a 100644 --- a/src/corelib/fpg_base.pas +++ b/src/corelib/fpg_base.pas @@ -1864,7 +1864,7 @@ begin SetColor(clText1); SetTextColor(clText1); - SetFont(fpgApplication.DefaultFont); + SetFont(fpgStyle.DefaultFont); SetLineStyle(0, lsSolid); FBeginDrawCount := 0; diff --git a/src/corelib/fpg_main.pas b/src/corelib/fpg_main.pas index d74a9be4..1bdbff2e 100644 --- a/src/corelib/fpg_main.pas +++ b/src/corelib/fpg_main.pas @@ -275,7 +275,6 @@ type FDisplayParams: string; FScreenWidth: integer; FScreenHeight: integer; - FDefaultFont: TfpgFont; FFontResList: TList; FMessageHookList: TFPList; procedure FreeFontRes(afontres: TfpgFontResource); @@ -297,7 +296,6 @@ type procedure SetMessageHook(AWidget: TObject; const AMsgCode: integer; AListener: TObject); procedure ShowException(E: Exception); procedure UnsetMessageHook(AWidget: TObject; const AMsgCode: integer; AListener: TObject); - property DefaultFont: TfpgFont read FDefaultFont; property HintPause: Integer read FHintPause write SetHintPause; property HintWindow: TfpgWindow read FHintWindow; property ScreenWidth: integer read FScreenWidth; @@ -1384,8 +1382,6 @@ begin TfpgTimer(fpgTimers[i]).Free; fpgTimers.Free; - FDefaultFont.Free; - for i := FFontResList.Count-1 downto 0 do begin TfpgFontResource(FFontResList[i]).Free; @@ -1671,7 +1667,6 @@ end; procedure TfpgApplication.InternalInit; begin - FDefaultFont := GetFont(FPG_DEFAULT_FONT_DESC); fpgInitTimers; fpgNamedFonts := TList.Create; diff --git a/src/gui/fpg_editbtn.pas b/src/gui/fpg_editbtn.pas index 65417efd..6c871806 100644 --- a/src/gui/fpg_editbtn.pas +++ b/src/gui/fpg_editbtn.pas @@ -183,7 +183,7 @@ begin Canvas.Clear(clBoxColor); fpgStyle.DrawControlFrame(Canvas, 0, 0, Width - Height, Height); fpgStyle.DrawButtonFace(Canvas, Width - Height, 0, Height, Height, [btfIsEmbedded]); - Canvas.SetFont(fpgApplication.DefaultFont); + Canvas.SetFont(fpgStyle.DefaultFont); if Text <> '' then begin Canvas.TextColor := clText3; @@ -354,7 +354,7 @@ begin Canvas.Clear(clBoxColor); fpgStyle.DrawControlFrame(Canvas, 0, 0, Width - Height, Height); fpgStyle.DrawButtonFace(Canvas, Width - Height, 0, Height, Height, [btfIsEmbedded]); - Canvas.SetFont(fpgApplication.DefaultFont); + Canvas.SetFont(fpgStyle.DefaultFont); if Filename <> '' then begin Canvas.TextColor := clText3; @@ -439,7 +439,7 @@ begin Canvas.Clear(clBoxColor); fpgStyle.DrawControlFrame(Canvas, 0, 0, Width - Height, Height); fpgStyle.DrawButtonFace(Canvas, Width - Height, 0, Height, Height, [btfIsEmbedded]); - Canvas.SetFont(fpgApplication.DefaultFont); + Canvas.SetFont(fpgStyle.DefaultFont); if Directory <> '' then begin Canvas.TextColor := clText3; @@ -502,7 +502,7 @@ begin fpgStyle.DrawControlFrame(Canvas, 0, 0, Width - Height, Height); fpgStyle.DrawButtonFace(Canvas, Width - Height, 0, Height, Height, [btfIsEmbedded]); Canvas.TextColor := clShadow1; - Canvas.SetFont(fpgApplication.DefaultFont); + Canvas.SetFont(fpgStyle.DefaultFont); Canvas.DrawText(0, 0, Width - Height, Height, ClassName, [txtHCenter, txtVCenter]); img := fpgImages.GetImage('stdimg.font'); // don't free the img instance - we only got a reference if img <> nil then |