diff options
author | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2009-07-23 18:09:11 +0000 |
---|---|---|
committer | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2009-07-23 18:09:11 +0000 |
commit | 21c1082f916cc9a4d7be625c132e02b1fc1d8012 (patch) | |
tree | cf3c705058db9839ba80cebfaf0fe69086fa38f2 /unicode/src/base/TextGL.pas | |
parent | 446eec893b7915d80a4504d40bbfc6f77cafa550 (diff) | |
download | usdx-21c1082f916cc9a4d7be625c132e02b1fc1d8012.tar.gz usdx-21c1082f916cc9a4d7be625c132e02b1fc1d8012.tar.xz usdx-21c1082f916cc9a4d7be625c132e02b1fc1d8012.zip |
- 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
Diffstat (limited to 'unicode/src/base/TextGL.pas')
-rw-r--r-- | unicode/src/base/TextGL.pas | 22 |
1 files changed, 12 insertions, 10 deletions
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 |