build font cache on init (not post init)

This should prevent hud from already using it
This commit is contained in:
Bixilon 2023-06-15 16:11:34 +02:00
parent 81ff9c9f7a
commit 53cab94924
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4

View File

@ -26,6 +26,10 @@ class Font(
) : PostInitFontType {
private val cache: Array<CodePointRenderer?> = arrayOfNulls(CACHE_SIZE)
init {
buildCache()
}
private fun postInitFonts(latch: AbstractLatch) {
val fontLatch = ParentLatch(1, latch)
@ -49,7 +53,6 @@ class Font(
override fun postInit(latch: AbstractLatch) {
postInitFonts(latch)
buildCache()
}
fun forceGet(codePoint: Int): CodePointRenderer? {