diff --git a/LuaMenu/widgets/chobby/core.lua b/LuaMenu/widgets/chobby/core.lua index 8a8dac830..cddd7a650 100644 --- a/LuaMenu/widgets/chobby/core.lua +++ b/LuaMenu/widgets/chobby/core.lua @@ -47,6 +47,9 @@ for _, file in ipairs(includes) do end function Chobby:_Initialize() + -- Invalidate the chili font cache. Without this certain font sizes + -- will be invisible after Spring.Reload on many systems. + Chili.FontHandler.InvalidateFontCache() self:WrapCall(function() WG.Delay(function() lobby:AddListener("OnJoinBattle", diff --git a/libs/chiliui/luamenu/chili/chili/handlers/fonthandler.lua b/libs/chiliui/luamenu/chili/chili/handlers/fonthandler.lua index 195d31b30..7667f18c1 100644 --- a/libs/chiliui/luamenu/chili/chili/handlers/fonthandler.lua +++ b/libs/chiliui/luamenu/chili/chili/handlers/fonthandler.lua @@ -13,7 +13,7 @@ local refCounts = {} --// maximum fontsize difference --// when we don't find the wanted font rendered with the wanted fontsize --// (in respect to this threshold) then recreate a new one -local fontsize_threshold = 2 +local fontsize_threshold = 0 -- who thought this was ever a good idea? --//============================================================================= --// Destroy @@ -81,4 +81,8 @@ function FontHandler.LoadFont(fontname,size,outwidth,outweight) loadedFonts[idx] = font refCounts[idx] = 1 return font -end \ No newline at end of file +end + +function FontHandler.InvalidateFontCache() + loadedFonts = {} +end