From 53cab94924b8f5a711898a10ef848ecc15c707c8 Mon Sep 17 00:00:00 2001 From: Bixilon Date: Thu, 15 Jun 2023 16:11:34 +0200 Subject: [PATCH] build font cache on init (not post init) This should prevent hud from already using it --- .../bixilon/minosoft/gui/rendering/font/types/font/Font.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/bixilon/minosoft/gui/rendering/font/types/font/Font.kt b/src/main/java/de/bixilon/minosoft/gui/rendering/font/types/font/Font.kt index 939f58cb5..0086d8c34 100644 --- a/src/main/java/de/bixilon/minosoft/gui/rendering/font/types/font/Font.kt +++ b/src/main/java/de/bixilon/minosoft/gui/rendering/font/types/font/Font.kt @@ -26,6 +26,10 @@ class Font( ) : PostInitFontType { private val cache: Array = 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? {