RMMZ - CHANGE FONT ON GAMEPLAY

Only Rpg Maker MZ

In RMMZ the font is loaded in a different way than RMMV, probably because we have two types of fonts:
  • One for texts like dialogs and terms in menus
  • And another for numbers like HP, MP, time, money, etc


First you must copy the font files to your project's fonts folder.

To change the font of text before or after a dialog box, execute this code via the Script (Last Page) event command:
FontManager._urls["rmmz-mainfont"]="";
FontManager._states["rmmz-mainfont"]="";
FontManager.load("rmmz-mainfont","MyPersonalizedFont.ttf");


Replace MyPersonalizedFont.ttf with the name of the copied font in the folder, enclosed in quotation marks.

To restore the font of the texts to the one defined in the database, use the following command without changing anything:
FontManager._urls["rmmz-mainfont"]="";
FontManager._states["rmmz-mainfont"]="";
FontManager.load("rmmz-mainfont",$dataSystem.advanced.mainFontFilename);


To change the font of the numbers, which are likely to be less used, the command is similar:
FontManager._urls["rmmz-numberfont"]="";
FontManager._states["rmmz-numberfont"]="";
FontManager.load("rmmz-numberfont","MyPersonalizedFont.ttf");


To restore the font of the texts to the one defined in the database, use the following command without changing anything:
FontManager._urls["rmmz-numberfont"]="";
FontManager._states["rmmz-numberfont"]="";
FontManager.load("rmmz-numberfont",$dataSystem.advanced.numberFontFilename);


To understand, the _urls and _states objects serve to memorize the loaded fonts, so it is necessary to delete them to reload the new fonts.

If you prefer a simple plugin ready to work follow this link:
Download