Slow font load to scene, how make if fast?

I tried about a dozen different fonts and found that they all load for a long time at first use, from 200 to 300 ms. additionally. And they give +20 ms per scene with future use.

If my scene loads 200 ms, then this is very sensitive. Is it possible to speed up the download? I don’t really like the native font.

You need to preload your fonts. On some platforms, like Windows, the fonts can take a long while to load for the first time. I’ll upload my font preloader plugin to GitHub early next week and you can give it a try.

1 Like

So any news about preload plugin?

Sorry about that, I’ve been flooded with projects and forgot to upload the plugin.

You can check it out at https://github.com/SpyricGames/Font-Loader.

All you need to do to use it require it and run it once:

local fontLoader = require("spyricFontLoader")
-- Use case #1: checks only the given folder (the #2 argument table is optional)
fontLoader.preload( "fonts" )
-- Use case #2: checks the given folder and all of its subfolders.
fontLoader.preload( "fonts", {deepScan=true} )
-- Use case #3: also provides console output of what it finds and how long it takes, etc.
fontLoader.preload( "fonts", {consoleOutput=true, deepScan=true} )

There are some more instructions in the main.lua file. I’ll be writing more clear docs and descriptions for it during the weekend.

1 Like

Thank you! Will try it soon!