Jump to content
Sign in to follow this  
Dev_With_Coffee

RMMZ - Easy text font switching

Recommended Posts

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:

https://github.com/BossRpg/RMMZ-SimpleFontManager

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted