Jump to content

Cannot overwrite new fonts as the oldest ones


Lukasz16a
  • Fixed

While developing mod for Persian Language, I found some inconsistency in game font behavior. I wanted to overwrite all font files and I found that new font files can not be overwritten as before.

Long story short: assume that we created mod, which only consist of:

local OldRegisterPrefabs = GLOBAL.ModManager.RegisterPrefabs
local function NewRegisterPrefabs(self)
	OldRegisterPrefabs(self)
  
	local varNames = { "DEFAULTFONT","DIALOGFONT","TITLEFONT","UIFONT","BUTTONFONT",
	                   "NEWFONT", "NEWFONT_SMALL","NEWFONT_OUTLINE","NEWFONT_OUTLINE_SMALL",
	                   "NUMBERFONT","TALKINGFONT",
	                   "CHATFONT","HEADERFONT","CHATFONT_OUTLINE",
	                   "SMALLNUMBERFONT","BODYTEXTFONT","CODEFONT"
	                 }
	for _,f in pairs(varNames) do
		GLOBAL[f] = "emoji"
	end
end
GLOBAL.ModManager.RegisterPrefabs=NewRegisterPrefabs

We set all global non-fallback font variables to "emoji". "emoji" contains no ascii characters, so I expect that every boxes and dialog in the game will be empty (or filled with ???), but actually it is no true (see pictures). All boxes, which I found not empty, have one of the new fonts: "CHATFONT","HEADERFONT","CHATFONT_OUTLINE".

Przechwycenie obrazu ekranu_2018-03-09_01-27-15.png

Przechwycenie obrazu ekranu_2018-03-09_01-27-42.png


Steps to Reproduce
1. Create mod with the code in modmain.lua as above. 2. Expected: everything is empty 3. Some boxes are not.



User Feedback


A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.

The font for the filters was getting cached before the mods were loaded. I've removed the caching, and your expected results are showing up now. This will go out in the next update. Thanks for pointing it out!

  • Thanks 1

Share this comment


Link to comment
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...