From 09cb93c06202febc160b644b384a8d7d29978c04 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sat, 23 Feb 2013 15:47:29 +0000 Subject: medley mod: Themes modifications. This is considered the last part of the medley mod. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2946 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/base/TextGL.pas | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'src/base/TextGL.pas') diff --git a/src/base/TextGL.pas b/src/base/TextGL.pas index feca0974..7da1d558 100644 --- a/src/base/TextGL.pas +++ b/src/base/TextGL.pas @@ -56,6 +56,7 @@ const ftBold = 1; ftOutline1 = 2; ftOutline2 = 3; + ftBoldHighRes = 4; var Fonts: array of TGLFont; @@ -98,7 +99,7 @@ procedure AddFontFallbacks(FontIni: TMemIniFile; Font: TFont); var FallbackFont: IPath; IdentName: string; - I: Integer; + I: integer; begin // evaluate the ini-file's 'Fallbacks' section for I := 1 to 10 do @@ -117,8 +118,8 @@ begin end; const - FONT_NAMES: array [0..3] of string = ( - 'Normal', 'Bold', 'Outline1', 'Outline2' + FONT_NAMES: array [0..4] of string = ( + 'Normal', 'Bold', 'Outline1', 'Outline2', 'BoldHighRes' ); procedure BuildFonts; @@ -126,6 +127,8 @@ var I: integer; FontIni: TMemIniFile; FontFile: IPath; + FontMaxResolution: integer; + FontPreCache: integer; Outline: single; Embolden: single; OutlineFont: TFTScalableOutlineFont; @@ -144,12 +147,21 @@ begin FontFile := FindFontFile(FontIni.ReadString(SectionName , 'File', '')); + FontMaxResolution := FontIni.ReadInteger(SectionName, 'MaxResolution', 64); + FontPreCache := FontIni.ReadInteger(SectionName, 'PreCache', 1); + // create either outlined or normal font Outline := FontIni.ReadFloat(SectionName, 'Outline', 0.0); if (Outline > 0.0) then begin // outlined font - OutlineFont := TFTScalableOutlineFont.Create(FontFile, 64, Outline, True, True); + OutlineFont := TFTScalableOutlineFont.Create( + FontFile, + FontMaxResolution, + Outline, + True, + (FontPreCache <> 0) + ); OutlineFont.SetOutlineColor( FontIni.ReadFloat(SectionName, 'OutlineColorR', 0.0), FontIni.ReadFloat(SectionName, 'OutlineColorG', 0.0), @@ -163,7 +175,13 @@ begin begin // normal font Embolden := FontIni.ReadFloat(SectionName, 'Embolden', 0.0); - Fonts[I].Font := TFTScalableFont.Create(FontFile, 64, Embolden, True, True); + Fonts[I].Font := TFTScalableFont.Create( + FontFile, + FontMaxResolution, + Embolden, + True, + (FontPreCache <> 0) + ); Fonts[I].Outlined := false; end; -- cgit v1.2.3