MV Changing game font during gameplay?

Hi!

Is there an event command, script call or plugin command that lets you change the game's font during gameplay?

Essentially, I would like to create an event that, once interacted with by the player, does the following:

1. Change the primary font to a secondary font.
2. Bring up the Character Name Input screen (via event command).
3. Change the secondary font back to the primary font.

I found the following scriptlet in a Steam community post from 2016 by a user named Mystix, but it isn't working:

Code:
# use the following in a scriptcall command:
# change_font("fontname")
# where "fontname" is the name of the font.
class Scene_Map < Scene_Base
  attr_accessor :message_window
end

class Game_Interpreter
  def change_font(fontname)
    SceneManager.scene.message_window.contents.font.name = fontname
  end
end

Any help or pointers would be greatly appreciated!
Thanks!
Your code is for different version of rpg maker, but for MV this will do:

Yanfly's Load Custom Font plugin + Yanfly's Message Core and you can use in message window tag:
\fn<font name> wich will be defined in Yanfly's Load Custom font plugin parameters
Isn't the message window tag \fn<font name> only to change the font of the current message window?

If that's the case, it won't affect the Character Name Input screen, will it?
Let me check, but I think it should
edit: no... It's not working there...
Do you only want the font of the Character Name Input screen to be different, or also have the option of changing it for the text in other windows?
I think this is what you're looking for -> ODW - Custom Font Message Plugin
Do you only want the font of the Character Name Input screen to be different, or also have the option of changing it for the text in other windows?
Yes, that's right! I would like the font of the Character Name Input screen to be different, I don't really mind being able to change the font elsewhere or not.

I think this is what you're looking for -> ODW - Custom Font Message Plugin
I think that plugin is for RPG Maker MZ, not MV. Thanks, though!
Oh my bad I didn't notice it was MZ, well you can still try RETRO to use it on MV if you can't find any other solutions.
I ended up writing a small plugin (attached to this post) since I realized I might need this too. For it to work, you need to copy the secondary font you want to use into your project's fonts folder and add it in the gamefont.css file as "NameInputFont" like this:

Code:
@font-face {
    font-family: NameInputFont;
    src: url("mplus-1m-regular.ttf");
}

Replace "mplus-1m-regular.ttf" with the name of the secondary font file. Make sure to keep everything else that's already written in the css file; only add to it, don't replace it.

There's still a small issue with the letters in the name input screen not being evenly spaced in some cases that I haven't been able to fix so far, but otherwise it should be functional.
Moved to: Plugin Requests

Original thread: https://forums.rpgmakerweb.com/threads/changing-game-font-during-gameplay.140953/