Name Input font size problem

Hi guys,
I have a problem with the font when changing a player name (in the name input command).
I'm using a custom font for my game, but now, in the input name window, the font is too crowded where the name appears.
Is there a way to change the font size only for the name input window?
I don't want to change the size for the entire game, just for the name input.
Save, name and plug in your plugin. I'm not sure if this helps but it will leave a gap.

JavaScript:
Window_NameEdit.prototype.charWidth = function() {
    const text = $gameSystem.isJapanese() ? "\uff21" : "A ";
    return this.textWidth(text);
};
Save, name and plug in your plugin. I'm not sure if this helps but it will leave a gap.

JavaScript:
Window_NameEdit.prototype.charWidth = function() {
    const text = $gameSystem.isJapanese() ? "\uff21" : "A ";
    return this.textWidth(text);
};

THANKS A LOT MAN!!! Worked like a charm 🙂
Any credit you want me to add?

One more question please, do you know if it's also possible to align the characters to the center of the underline (instead of it align to the left)?
It's ok either way, but if possible it will look even better I think.
This might help.
Add this to
+10 or less as needed

Code:
Window_NameEdit.prototype.drawChar = function(index) {
    const rect = this.itemRect(index);
    this.resetTextColor();
    this.drawText(this._name[index] || "", rect.x+10, rect.y);
};
This might help.
Add this to
+10 or less as needed

Code:
Window_NameEdit.prototype.drawChar = function(index) {
    const rect = this.itemRect(index);
    this.resetTextColor();
    this.drawText(this._name[index] || "", rect.x+10, rect.y);
};

Amazing, I've adjusted it to +5, and now it looks very good!
Thanks again, saved me!
a better solution than "x+5" = the one in MV also have
JavaScript:
 Window_NameEdit.prototype.drawChar = function(index) {
 CONST rect = this.itemRect(index);
 this.resetTextColor();
 this.drawText(this._name[index] || "", rect.x, rect.y, rect.width, "center");
        };

This center all characters in the center without offset requirements.
a better solution than "x+5" = the one in MV also have
JavaScript:
 Window_NameEdit.prototype.drawChar = function(index) {
 CONST rect = this.itemRect(index);
 this.resetTextColor();
 this.drawText(this._name[index] || "", rect.x, rect.y, rect.width, "center");
        };

This center all characters in the center without offset requirements.

Ideally, I do prefer to center it, it's even better than pushing it by 5, however, I think MZ don't support this code.
I just tried to copy it, and the game cannot load.

Would you know maybe how to adjust it so it would work on MZ?
I dont know if MZ has the "center" alignment property like MZ does.
can press console log? as I dont have MZ, I dont know if it has that option
or able to add it for nameEdit alignment.
I dont know if MZ has the "center" alignment property like MZ does.
can press console log? as I dont have MZ, I dont know if it has that option
or able to add it for nameEdit alignment.
Sorry for the noob question (I'm new to RPG maker), how do I find console log?
F8 or F12 to console tab you see on top
F8 or F12 to console tab you see on top

Thanks.
Would that be it?
upon looking, this should work or I'm out of options:
JavaScript:
Window_NameEdit.prototype.drawChar = function(index) {
    const rect = this.itemRect(index);
    this.resetTextColor();
    this.drawText(this._name[index] || "", rect.x, rect.y, rect.width, "center");
};

as drawtext seems to have another option to it, it does have an alignment,
but I dont get "maxWidth" which MV doesn't have, so this should work, else
maybe someone have a solution for it.
It is a management that It's a little messy. You might need +4.5 or 4.3 instead to get the center. Fixing the edges based on your font is difficult with your thick Or the proportion size is not normal.
I see, thanks again guys!
upon looking, this should work or I'm out of options:
JavaScript:
Window_NameEdit.prototype.drawChar = function(index) {
    const rect = this.itemRect(index);
    this.resetTextColor();
    this.drawText(this._name[index] || "", rect.x, rect.y, rect.width, "center");
};

as drawtext seems to have another option to it, it does have an alignment,
but I dont get "maxWidth" which MV doesn't have, so this should work, else
maybe someone have a solution for it.

It is a management that It's a little messy. You might need +4.5 or 4.3 instead to get the center. Fixing the edges based on your font is difficult with your thick Or the proportion size is not normal.




OK, great news, I managed to get it centred combining both of your solutions 🙂

What I did was, instead of copy the entire code for centering over of the previous version with the '+5', I just replaced the last part (the last row), and it worked this time.

So, the final solution for my problem was, to combine the gap fix, and the centered fix, so the final version of the code, that really brings it home, is this, in case someone else need it:

Code:
Window_NameEdit.prototype.charWidth = function() {
    const text = $gameSystem.isJapanese() ? "\uff21" : "A  ";
    return this.textWidth(text);
};
Window_NameEdit.prototype.drawChar = function(index) {
    const rect = this.itemRect(index);
    this.resetTextColor();
    this.drawText(this._name[index] || "", rect.x, rect.y, rect.width, "center");
};

If you'd like any credit, let me know.
I dont think you need the gap, because it can mess up the code,
but if it works for your font and use no other fonts, you can keep it.

I dont know if A can be "W" if its wider and "I" because its smaller or "M"
you can try to play with it as W and M are the widest characters as I the smallest.

I dont need any credit though, as anyone can use it, but your feel to choose.

Original thread: https://forums.rpgmakerweb.com/threads/name-input-font-size-problem.167534/