Changing game's font for NameInput

Hello RPG Maker Forums! I'm having a few issues with NameInput.

(Disclaimer: I'm using SumRndmDde's NameInput upgrade. The problem persists both WITH and WITHOUT the plugin).

mqKgw3J.png


As you can see by this picture, there's some overlap on the letters. I'm assuming this is related to font. I don't want to replace the font of the entire game (As it looks quite good elsewhere). But I would like to temporarily change the font of the game just for NameInput, so it won't do this anymore.

Thanks for your help guys!
Anyone?
The issue is that screen assumes every letter has the same width (which is true for the normal Game Font but not for most fonts).
I had to do a similar fix in my notepad plugin to properly account for the text width dynamically, and I could do the same thing here.
Or I could write something that changes the font in the Name Input screen like you originally suggested. Which would you prefer?
Simply something that changes the font would be fine, and would more than work for my purposes.
Save this code as a new .js file within your plugins folder, and install it below SRD's Name Input Upgrade plugin:

Spoiler
Code:
(function() {

    var dir = window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/'));
    Graphics.loadFont("StandardFont", dir + "/fonts/" + "mplus-1m-regular.ttf");

    //Use the mplus-1m-refular.ttf font for Window_NameEdit
    Window_NameEdit.prototype.standardFontFace = function() {
        return "StandardFont";
    };


    /*
    //Un-comment this section if you want the Input window to also use the standard font

    //Use the mplus-1m-refular.ttf font for Window_NameInput
    Window_NameInput.prototype.standardFontFace = function() {
        return "StandardFont";
    };
    */


    /*
    // Un-comment this section if you want SRD's explanation window to also use the standard font

    //Use the mplus-1m-refular.ttf font for Window_NameExplanation
    Window_NameExplanation.prototype.standardFontFace = function() {
        return "StandardFont";
    };
    */

})();

This assumes that:
  1. You already edited the gamefont.css file in the /fonts folder to change the src: url to your fancy font but the font-family is still 'GameFont'
  2. You didn't delete the mplus-1m-regular.ttf file from the /fonts folder
If so, should work no problem, it's a very simple code change.

EDIT: No credit is required for anyone who would like to use this.
Correct assumptions. Thank you so much. I will test this later today.

How would you like to be credited for your help? I'm making a text-based western fantasy game.
No credit required at all, enjoy!
Works exactly as intended. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/changing-games-font-for-nameinput.88721/