Font caching / Better sheet font loading

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

Font caching / Better sheet font loading

Postby Marisa Kirisame » Tue Apr 21, 2020 4:39 am

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
Marisa Kirisame
ZScript Crimester
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: 霧雨魔理沙#1666
Twitch ID: magusmarisa
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Font caching

Postby Graf Zahl » Tue Apr 21, 2020 4:48 am

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
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Font caching

Postby Marisa Kirisame » Tue Apr 21, 2020 5:08 am

They're sheet fonts. And I do believe that these are always loaded "in whole".
User avatar
Marisa Kirisame
ZScript Crimester
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: 霧雨魔理沙#1666
Twitch ID: magusmarisa
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Font caching

Postby Graf Zahl » Tue Apr 21, 2020 5:28 am

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
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Font caching

Postby Rachael » Tue Apr 21, 2020 5:50 am

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
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Font caching

Postby Graf Zahl » Tue Apr 21, 2020 7:51 am

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
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Font caching

Postby Marisa Kirisame » Tue Jun 30, 2020 3:55 pm

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 Kirisame
ZScript Crimester
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: 霧雨魔理沙#1666
Twitch ID: magusmarisa
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support


Return to Feature Suggestions

Who is online

Users browsing this forum: No registered users and 0 guests