diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2009-10-13 16:19:11 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2009-10-13 16:19:11 +0200 |
commit | c735c25674376e3c35d1ba3067e9c7463cfa25e3 (patch) | |
tree | 5bbe5b707ea187ecae79a493a54bca0d3d9bbad8 | |
parent | ff43bd3cbaa0434e66e4326b11b6b18016adf1a8 (diff) | |
download | fpGUI-c735c25674376e3c35d1ba3067e9c7463cfa25e3.tar.xz |
Lookup of fonts now actually work.
No more creating new fonts for every style change. :-/
Signed-off-by: Graeme Geldenhuys <graeme@mastermaths.co.za>
-rwxr-xr-x | components/richtext/CanvasFontManager.pas | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/components/richtext/CanvasFontManager.pas b/components/richtext/CanvasFontManager.pas index bd8e2cb9..efc84e2e 100755 --- a/components/richtext/CanvasFontManager.pas +++ b/components/richtext/CanvasFontManager.pas @@ -416,6 +416,7 @@ Var fl: TStringList; f: TfpgFont; begin + fl := nil; FontFaces := TList.Create; fl := fpgApplication.GetFontFaceList; @@ -428,8 +429,7 @@ begin Font := TLogicalFont.Create( nil ); Font.FaceName := fl[T]; f := fpgGetFont(Font.FaceName + '-10'); -// FamilyName := pfm^[ T ].szFamilyName; - if (pos('Courier', Font.FaceName) > 0) or (pos('Mono', Font.FaceName) > 0) then + if (pos('COURIER', UpperCase(Font.FaceName)) > 0) or (pos('MONO', UpperCase(Font.FaceName)) > 0) then Font.FixedWidth := True; Font.lAveCharWidth := f.TextWidth('g'); Font.lMaxbaselineExt := f.Height; @@ -456,10 +456,6 @@ begin // pick some for defaults GetDefaultFonts; - - //FontWindow := TFontWindow.Create( Nil ); - //FontWindow.OwnerDraw := True; - //FontWindow.CreateWnd; end; // Add .subscript to font name for attributes |