The best time to load image fonts

Member
Posts: 67
Joined: 2006.07
Post: #1
My game's loading sequence currently consists of a simple loading image and custom progress bar with some explanatory text above it (such as "Loading sounds"). I do this after switching the resolution or showing the display window, depending on the user's display mode preference. The only problem is that I have to load an image-based font in order to show the loading labels, and loading the font takes a while. (I'm using OpenGL through AGL. DrawString() doesn't work, and I don't want to fiddle with GlyphTool/FTGL/whatever.) Here are some ways I've tried to handle this:

- Load the image font before fading in. This, however, results in a long pause in blackness, which looks bad.
- Draw an empty progress bar with no label while the font loads. However, this results in a delay where nothing happens (empty/still progress bar), which could be disconcerting for an inexperienced user.

Anyone have any ideas for handling this? Is there a preferred way that I'm not aware of?
Quote this message in a reply
Sage
Posts: 1,403
Joined: 2005.07
Post: #2
Create a texture that says, loading fonts. Load that before loading fonts..

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
Member
Posts: 110
Joined: 2002.07
Post: #3
Wowbagger Wrote:My game's loading sequence currently consists of a simple loading image and custom progress bar with some explanatory text above it (such as "Loading sounds"). I do this after switching the resolution or showing the display window, depending on the user's display mode preference. The only problem is that I have to load an image-based font in order to show the loading labels, and loading the font takes a while. (I'm using OpenGL through AGL. DrawString() doesn't work, and I don't want to fiddle with GlyphTool/FTGL/whatever.) Here are some ways I've tried to handle this:

- Load the image font before fading in. This, however, results in a long pause in blackness, which looks bad.
- Draw an empty progress bar with no label while the font loads. However, this results in a delay where nothing happens (empty/still progress bar), which could be disconcerting for an inexperienced user.

Anyone have any ideas for handling this? Is there a preferred way that I'm not aware of?

i think you ask the wrong question. Blink
there is no reason why your font texure loading is slow , are you using a G3 ?


++
Dan
Quote this message in a reply
Member
Posts: 67
Joined: 2006.07
Post: #4
The reason my image font takes so long to load is because I don't pack all my font characters into a single texture and load that. Rather, I have around 80 PNGs, each representing one character in the font, and load all of those. I know it takes longer and may, theoretically, take up more memory, but I chose this method because it's easier to draw variable-width fonts this way and because it gives me more flexibility in terms of modifying characters when I want to (not to mention adding new characters, since right now I use only uppercase characters).

However, I have indeed noticed that it is a long-standing tradition among Mac game programmers to pack tons of separate images into one image. Personally, I got headaches trying to use this system simply because of its inflexibility. But if it is generally advisable (for image fonts, at least) to use only one texture, I'd like to know, first of all, the benefits compared to using lots of images, and secondly, an easy way to keep the font variable-width.
Quote this message in a reply
Moderator
Posts: 771
Joined: 2003.04
Post: #5
If I recall correctly, Danlab also uses the "one file per char" method, yet it still is fast enough. I prefer to keep everything in one texture myself, along with a simple text file that specifies the position/size of each char (generated automatically).
Quote this message in a reply
Member
Posts: 110
Joined: 2002.07
Post: #6
yup its also fast loading all small texture for font, now im using a single big texture because the new mac mini dont like texture swaping and if you start to write 2 or 3 lines of text the fps go near ZERO :-(

big texture is the key
now loading a lot of small texture shouldn be a big problem too (speed)
Quote this message in a reply
Member
Posts: 320
Joined: 2003.06
Post: #7
what unknown said would work, make an image that says "loading fonts" and show that first.

Best option would be to do it properly using freetype, but you said you don't want to do that... this is one of the problems you get as a result.

Chopper, iSight Screensavers, DuckDuckDuck: http://majicjungle.com
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  load times skyhawk 20 7,570 May 22, 2003 01:45 PM
Last Post: w_reade