From 21c1082f916cc9a4d7be625c132e02b1fc1d8012 Mon Sep 17 00:00:00 2001 From: tobigun Date: Thu, 23 Jul 2009 18:09:11 +0000 Subject: - IPath integration - BASS is now unicode compatible git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@1875 b956fd51-792f-4845-bead-9b4dfca2ff2c --- unicode/src/base/TextGL.pas | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'unicode/src/base/TextGL.pas') diff --git a/unicode/src/base/TextGL.pas b/unicode/src/base/TextGL.pas index 65d716c2..7fe98d29 100644 --- a/unicode/src/base/TextGL.pas +++ b/unicode/src/base/TextGL.pas @@ -37,9 +37,10 @@ uses gl, glext, SDL, + Classes, UTexture, UFont, - Classes, + UPath, ULog; type @@ -75,26 +76,26 @@ uses UMain, UPathUtils; -function FindFontFile(FontIni: TCustomIniFile; Font: string): string; +function FindFontFile(FontIni: TCustomIniFile; Font: string): IPath; var - Filename: string; + Filename: IPath; begin - Filename := FontIni.ReadString(Font, 'File', ''); - Result := FontPath + Filename; + Filename := Path(FontIni.ReadString(Font, 'File', '')); + Result := FontPath.Append(Filename); // if path does not exist, try as an absolute path - if (not FileExists(Result)) then + if (not Result.IsFile) then Result := Filename; end; procedure BuildFont; var FontIni: TMemIniFile; - FontFile: string; + FontFile: IPath; begin ActFont := 0; SetLength(Fonts, 4); - FontIni := TMemIniFile.Create(FontPath + 'fonts.ini'); + FontIni := TMemIniFile.Create(FontPath.Append('fonts.ini').ToNative); try @@ -117,8 +118,9 @@ begin FontFile := FindFontFile(FontIni, 'Outline2'); Fonts[3].Font := TFTScalableOutlineFont.Create(FontFile, 64, 0.08); - except on E: Exception do - Log.LogCritical(E.Message, 'BuildFont'); + except + on E: Exception do + Log.LogCritical(E.Message, 'BuildFont'); end; // close ini-file -- cgit v1.2.3