Changing Main Menu Command Font Size

So I'd like to increase the font size of the list of commands on the main menu. I'm referring to the commands like: Items, Equip, Skills, Options, Save, etc...

How would I go about changing it? I tried adding "\{" to the front of the text in "Menu # Name" within YEP_MainMenuManager's plugin options, but it threw an error.

For the record, I only want to change the font size there and not for the rest of the game, so changing the font size in YEP_CoreEngine wouldn't work.
The drawText call doesn't process escape codes, so that's why \{ didn't work for this case; but if you can find the specific drawText call you want to change the size of, then it's as simple as this:

JavaScript:
var saveSize = this.contents.fontSize;
this.contents.fontSize = 18; // whatever font size you want, I assume it's in points but I could be wrong.
// any calls to drawText with the larger font size
this.contents.fontSize = saveSize;
Oooh in that case, couldn't I also just change drawText -> drawTextEx? I'll try your method 1st though.

Edit: I couldn't find any instance of "drawText" in YEP_MainMenuManager.js. Where would it be?

Edit2: Ok, I found this in rpg_windows.js
Spoiler: Menu Command
JavaScript:
//-----------------------------------------------------------------------------
// Window_MenuCommand
//
// The window for selecting a command on the menu screen.

function Window_MenuCommand() {
    this.initialize.apply(this, arguments);
}

Window_MenuCommand.prototype = Object.create(Window_Command.prototype);
Window_MenuCommand.prototype.constructor = Window_MenuCommand;

Window_MenuCommand.prototype.initialize = function(x, y) {
    Window_Command.prototype.initialize.call(this, x, y);
    this.selectLast();
};

Window_MenuCommand._lastCommandSymbol = null;

Window_MenuCommand.initCommandPosition = function() {
    this._lastCommandSymbol = null;
};

Window_MenuCommand.prototype.windowWidth = function() {
    return 240;
};

Window_MenuCommand.prototype.numVisibleRows = function() {
    return this.maxItems();
};

Window_MenuCommand.prototype.makeCommandList = function() {
    this.addMainCommands();
    this.addFormationCommand();
    this.addOriginalCommands();
    this.addOptionsCommand();
    this.addSaveCommand();
    this.addGameEndCommand();
};

Window_MenuCommand.prototype.addMainCommands = function() {
    var enabled = this.areMainCommandsEnabled();
    if (this.needsCommand('item')) {
        this.addCommand(TextManager.item, 'item', enabled);
    }
    if (this.needsCommand('skill')) {
        this.addCommand(TextManager.skill, 'skill', enabled);
    }
    if (this.needsCommand('equip')) {
        this.addCommand(TextManager.equip, 'equip', enabled);
    }
    if (this.needsCommand('status')) {
        this.addCommand(TextManager.status, 'status', enabled);
    }
};

Window_MenuCommand.prototype.addFormationCommand = function() {
    if (this.needsCommand('formation')) {
        var enabled = this.isFormationEnabled();
        this.addCommand(TextManager.formation, 'formation', enabled);
    }
};

Window_MenuCommand.prototype.addOriginalCommands = function() {
};

Window_MenuCommand.prototype.addOptionsCommand = function() {
    if (this.needsCommand('options')) {
        var enabled = this.isOptionsEnabled();
        this.addCommand(TextManager.options, 'options', enabled);
    }
};

Window_MenuCommand.prototype.addSaveCommand = function() {
    if (this.needsCommand('save')) {
        var enabled = this.isSaveEnabled();
        this.addCommand(TextManager.save, 'save', enabled);
    }
};

Window_MenuCommand.prototype.addGameEndCommand = function() {
    var enabled = this.isGameEndEnabled();
    this.addCommand(TextManager.gameEnd, 'gameEnd', enabled);
};

Window_MenuCommand.prototype.needsCommand = function(name) {
    var flags = $dataSystem.menuCommands;
    if (flags) {
        switch (name) {
        case 'item':
            return flags[0];
        case 'skill':
            return flags[1];
        case 'equip':
            return flags[2];
        case 'status':
            return flags[3];
        case 'formation':
            return flags[4];
        case 'save':
            return flags[5];
        }
    }
    return true;
};

Window_MenuCommand.prototype.areMainCommandsEnabled = function() {
    return $gameParty.exists();
};

Window_MenuCommand.prototype.isFormationEnabled = function() {
    return $gameParty.size() >= 2 && $gameSystem.isFormationEnabled();
};

Window_MenuCommand.prototype.isOptionsEnabled = function() {
    return true;
};

Window_MenuCommand.prototype.isSaveEnabled = function() {
    return !DataManager.isEventTest() && $gameSystem.isSaveEnabled();
};

Window_MenuCommand.prototype.isGameEndEnabled = function() {
    return true;
};

Window_MenuCommand.prototype.processOk = function() {
    Window_MenuCommand._lastCommandSymbol = this.currentSymbol();
    Window_Command.prototype.processOk.call(this);
};

Window_MenuCommand.prototype.selectLast = function() {
    this.selectSymbol(Window_MenuCommand._lastCommandSymbol);
};
Yeah, you could, but I don't think I'd recommend it. There's probably a reason why windows don't just use drawTextEx everywhere. I don't know exactly what the reason is, but some possibilities are:

  • drawTextEx has no width management - it'll happily draw right off the edge of the window if you give it a long enough string.
  • drawTextEx draws the text one character at a time, which means it's inevitably slower than drawing it all in one go; I doubt that makes a difference in practice, but if you were drawing all text with drawTextEx, maybe there could be a noticeable drop in performance.

You're welcome to try it, however. Using it only for the experience text is unlikely to hit either of the above issues, at least. I don't know if there's other reasons not to use it though.

I'll note that when I wanted skill names to process text codes, I stuck to drawText but substituted the escape codes in beforehand using the convertEscapeCharacters function. That wouldn't work for this use case, mind you; only codes like \n or \v that get replaced with an actual value are handled there, because they're a simple find and replace operation.
Yea, I just tried changing drawText to drawTextEx and you're right it messed up the alignment. So that's a no go... This is where I changed it (reverted back to default now).
JavaScript:
Window_Command.prototype.drawItem = function(index) {
    var rect = this.itemRectForText(index);
    var align = this.itemTextAlign();
    this.resetTextColor();
    this.changePaintOpacity(this.isCommandEnabled(index));
    this.drawText(this.commandName(index), rect.x, rect.y, rect.width, align);
};

Edit: So I just tried adding your code, but it threw an error: "Window_TitleCommand.initCommandPosition is not a function"
JavaScript:
var saveSize = this.contents.fontSize;
this.contents.fontSize = 33; // whatever font size you want, I assume it's in points but I could be wrong.
// any calls to drawText with the larger font size
this.contents.fontSize = saveSize;
Where do you suggest I put it? I pasted it in rpg_windows.js at the beginning of this:
JavaScript:
//-----------------------------------------------------------------------------
// Window_MenuCommand
//
// The window for selecting a command on the menu screen.
The idea was to "wrap" the drawText call:

Yea, I just tried changing drawText to drawTextEx and you're right it messed up the alignment. So that's a no go... This is where I changed it (reverted back to default now).
JavaScript:
Window_Command.prototype.drawItem = function(index) {
    var rect = this.itemRectForText(index);
    var align = this.itemTextAlign();
    this.resetTextColor();
    this.changePaintOpacity(this.isCommandEnabled(index));
    var saveSize = this.contents.fontSize;
    this.contents.fontSize = 33;
    this.drawText(this.commandName(index), rect.x, rect.y, rect.width, align);
    this.contents.fontSize = saveSize;
};
I believe that would affect everything throughout the game, instead of just the main menu's command list, but I'll try it.

Edit: Actually it'll suffice! It affects pretty much every command menu, but I can live with that lol.
Yes, you're correct. You could however make a copy of the function but change Window_Command to Window_MenuCommand or Window_TitleCommand or whichever window you need it to apply to, and then make the change only in the copy.
Btw, what is the purpose of var saveSize = this.contents.fontSize and this.contents.fontSize = saveSize;?
That just makes sure that any other drawText calls in the same window are drawn at the normal size. In your specific case they might not matter, as the commands are the only text in the window.
Spoiler: OBSOLETE
Hmm, it's not having any effect (when I tried to make a copy like you suggested)...
JavaScript:
Window_MenuCommand.prototype.drawItem = function(index) {
    var rect = this.itemRectForText(index);
    var align = this.itemTextAlign();
    this.resetTextColor();
    this.changePaintOpacity(this.isCommandEnabled(index));
    this.contents.lineHeight = 40;
    this.contents.fontSize = 33;
    this.drawText(this.commandName(index), rect.x, rect.y, rect.width, align);
};

Does placement matter? I placed this chunk right after the original.

Edit: Oh wait, I think I have to change Window_MenuCommand.prototype = Object.create(Window_Command.prototype); -> Window_MenuCommand.prototype = Object.create(Window_MenuCommand.prototype);
However, when I did, it gave me an error: "this.clearCommandList is not a function"

Edit2: I had to change Window_Command.prototype.initialize.call(this, x, y); -> Window_MenuCommand.prototype.initialize.call(this, x, y);

But now it gives me "RangeError: Maximum call stack size exceeded"

Edit3: Ok, I think it's cause we named the copy Window_MenuCommand so this function is running in an endless loop:
JavaScript:
Window_MenuCommand.prototype.initialize = function(x, y) {
    Window_MenuCommand.prototype.initialize.call(this, x, y);
    this.selectLast();
};
Edit4: Sweet, I got it working! I had to make a copy of the ALL the Window_Command functions and named it Window_MainCommand then adjusted accordingly in Window_MenuCommand. My only gripe now is: How do I increase line-height? I tried: this.contents.lineHeight = 40; but it has no effect...
Okay, so I think the way you resolved the issues with my suggestion is probably wrong? There shouldn't be any reason to duplicate functions other than drawItem and (if I recall the name correctly) itemHeight. I mean, if it works for you, okay, fine; but there should've been a simpler way to get it working.

Anyway, I already stealth-answered your last question, but let me say it again: the itemHeight function is what controls the height of a command, so I think that's what you'd need to override to fix your line height issue.
Yea, there's definitely redundancies with the way I did it. But I wasn't sure what exactly had to be duplicated and when I tried duplicating only the bare minimums (or what I thought would be) I kept getting errors. That's why I just said screw it and duplicated the whole thing. It was an inefficient but "better safe than sorry" approach lol.

Original thread: https://forums.rpgmakerweb.com/threads/changing-main-menu-command-font-size.123988/