Font caching / Better sheet font loading

Moderator: GZDoom Developers

User avatar
Marisa the Magician
Banned User
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia

Font caching / Better sheet font loading

Post by Marisa the Magician »

I have a mod with very... large unicode fonts, and it's kind of an annoyance that whenever those fonts are first loaded they cause a very noticeable freeze. (which in one case happens when first opening the mod's options menu).

Was wondering if it was possible to add a mapinfo/gameinfo parameter for this, just like the ones for caching actor sprites, sounds, etc.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49223
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Font caching

Post by Graf Zahl »

Considering that fonts can have many color translations this can turn out very expensive. What kind of font is this? So far I never experienced delays from this with existing fonts.
You are also forgetting that in any normal session only a small subset of the font's characters get used, so this kind of caching would create huge delays.
User avatar
Marisa the Magician
Banned User
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia

Re: Font caching

Post by Marisa the Magician »

They're sheet fonts. And I do believe that these are always loaded "in whole".
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49223
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Font caching

Post by Graf Zahl »

It's not a caching issue, but an efficiency issue. The sheet fonts currently load the entire sheet for each needed character and that simply adds up.
It might be a good idea to let them extract the needed character data and store it locally instead.
User avatar
Rachael
Posts: 13914
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: Font caching

Post by Rachael »

Graf Zahl wrote:It's not a caching issue, but an efficiency issue. The sheet fonts currently load the entire sheet for each needed character and that simply adds up.
Yiiikes!
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49223
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Font caching

Post by Graf Zahl »

It was meant to handle the old console font, I just implemented it as a multipatch texture with the whole image being offset so that the character is selected.
Yeah, not the best idea, probably, but for the intended purpose it was enough.
User avatar
Marisa the Magician
Banned User
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia

Re: Font caching

Post by Marisa the Magician »

Bumping this. Any interest in changing how sheet fonts are handled? It's kind of a pain to have over 50k tiny files for 3 variants of 4 fonts. It makes SLADE take ages to load up the project and also causes bloat due to "size on disk" inflation.
User avatar
Marisa the Magician
Banned User
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia

Re: Font caching / Better sheet font loading

Post by Marisa the Magician »

I'd like this thread to be closed, I want to suggest an alternative to this.
Gez
 
 
Posts: 17938
Joined: Fri Jul 06, 2007 3:22 pm

Re: Font caching / Better sheet font loading

Post by Gez »

The alternative being: bundling them in wad files.

Return to “Closed Feature Suggestions [GZDoom]”