Beta 1.1 Fonts
by Michael Cordner · in Torque Game Builder · 02/10/2006 (2:26 am) · 4 replies
Admittedly, none of this may actually be a bug, but the behaviour around the cached .uft files appeared bizarre enough to raise the possibility.
In trying to do a packaged release of my game yesterday, I was noticing strange issues with cached fonts... What I was doing what generating all of the cached .uft files for my game (by running all of the screens with different sized versions of the fonts,) then performing a packaging step (custom build script,) that copies all of the compiled files (as well as the cached .uft files) to another directory. Then I'd remove the font from my system font directory (windows,) and attempt to run the result. More often than not, I'd get very strange errors where only certain letters in a font would be missing... for instance, in the string 'Start Game,' the S and the A would be in the default Arial font, while the rest of the string was in the proper font. Now generally, either the font cached files exist or they don't, and if they don't, any text I try to render would appear in the default font. But why would only certain letters be missing from the cached .uft file, and the rest okay?
Can anyone explain to me why .uft files appear to be getting "touched" (that is to say, time stamps updated,) even when the font doesn't exist on the machine and T2D is simply supposed to be reading a cached version? Come to think of it, do the .uft files get cached letter by letter, and the fact that some letters weren't appearing the result of them never having been displayed by my game as the cache was being generated?
In trying to do a packaged release of my game yesterday, I was noticing strange issues with cached fonts... What I was doing what generating all of the cached .uft files for my game (by running all of the screens with different sized versions of the fonts,) then performing a packaging step (custom build script,) that copies all of the compiled files (as well as the cached .uft files) to another directory. Then I'd remove the font from my system font directory (windows,) and attempt to run the result. More often than not, I'd get very strange errors where only certain letters in a font would be missing... for instance, in the string 'Start Game,' the S and the A would be in the default Arial font, while the rest of the string was in the proper font. Now generally, either the font cached files exist or they don't, and if they don't, any text I try to render would appear in the default font. But why would only certain letters be missing from the cached .uft file, and the rest okay?
Can anyone explain to me why .uft files appear to be getting "touched" (that is to say, time stamps updated,) even when the font doesn't exist on the machine and T2D is simply supposed to be reading a cached version? Come to think of it, do the .uft files get cached letter by letter, and the fact that some letters weren't appearing the result of them never having been displayed by my game as the cache was being generated?
#2
02/10/2006 (9:10 am)
That one has been fixed in beta 1.1... the issue I'm describing is a different one. The .uft cached versions seem to work, however sometimes it appears that certain letters in the font do not.
#3
Now, if the glyphs that are missing are glyphs that were cached, then it's a bug, otherwise its by design :)
There are some functions that allow you to generate all the glyphs you're going to need to make a .uft for shipping. I forgot what they are now, have a look in gNewFont.cc. If you don't need unicode, then you could just disable it and go back to using the old font renderer (which it should do with Unicode disabled, unless Im mistaken), then you'll get .gft files as before.
T.
02/10/2006 (2:33 pm)
.uft files do not cache the whole font like .gft files did. It only caches glyphs that have actually been rendered. It needs the font available at run time for the missing glyphs, and it will always save the font because of this. The reason is simply that with Unicode, there are far too many codepoints to cache the entire font in a reasonable amount of memory.Now, if the glyphs that are missing are glyphs that were cached, then it's a bug, otherwise its by design :)
There are some functions that allow you to generate all the glyphs you're going to need to make a .uft for shipping. I forgot what they are now, have a look in gNewFont.cc. If you don't need unicode, then you could just disable it and go back to using the old font renderer (which it should do with Unicode disabled, unless Im mistaken), then you'll get .gft files as before.
T.
#4
02/13/2006 (7:12 am)
Strike what I said it is all good
Torque Owner Jason Cahill
Default Studio Name