Change font size of ONLY the Actor_CommandWindow?

Can anyone help me in changing the font size of ONLY the Actor Command Window? The context is that I want to show all the skills and spells in the actor command window (iow the SKILLS and SPELLS commands will be removed). Skill and spell names tend to be longer, and I also don't want to increase the width of the command window.
Code:
Window_ActorCommand.prototype.resetFontSettings = function() {
    this.contents.fontFace = "Arial";
    this.contents.fontSize = $gameSystem.mainFontSize();
    this.resetTextColor();
};
The laziest method would just to save the above text as a .js and install it as a plugin. Replace Arial with whatever is the name of your font. Be sure that it's wrapped around " marks
Thanks, tweaked it slightly because it was the font size I wanted to change. Interestingly it does not change the font size of the skill cost... ah well.

Okay so it's Window_Base >>> Window_Selectable >>> Window_Command >>> Window_ActorCommand... I really need some extra RAM installed in my brain.

EDIT: tidied it up with a plugin parameter so it may benefit some other lost soul in the future...
Btw, should someone also know how to vert-align this text in the center... I would be much obliged.

JavaScript:
/*:en
 * @target MZ
 * @plugindesc Changes font size of Actor Command Window
 * @url https://forums.rpgmakerweb.com/index.php?threads/change-font-size-of-only-the-actorcommandwindow.164444/
 * @author Gensun, werzaque
 * @param ACW_FontSize
 * @desc Actor Command Window Font Size
 * @type Number
 * @default 26
 * @help
 * As the description implies, changes the font size of the texts shown
 * in the actor command window. Only has one plugin parameter.
 *
 */
const pluginName = document.currentScript.src.match(/^.*\/(.*).js$/)[1];
let parameters = PluginManager.parameters(pluginName);
ACW_FontSize = Number(parameters['ACW_FontSize']);
 
Window_ActorCommand.prototype.resetFontSettings = function() {
    this.contents.fontFace = $gameSystem.mainFontFace();
    this.contents.fontSize = ACW_FontSize;
//    this.contents.fontSize = $gameSystem.mainFontSize();
    this.resetTextColor();
};
Horizontal align can be changed to centered with this piece of code:
Code:
Window_ActorCommand.prototype.itemTextAlign = function() {
    return "center";
};

There's nothing for vertical align so we'd likely just have to mess around more directly with the code that handles drawing the options here:
Code:
Window_ActorCommand.prototype.drawItem = function(index) {
    const rect = this.itemLineRect(index);
    const align = this.itemTextAlign();
    const offsetY = n;
    this.resetTextColor();
    this.changePaintOpacity(this.isCommandEnabled(index));
    this.drawText(this.commandName(index), rect.x, rect.y + offsetY, rect.width, align);
};
We can just change offsetY to whatever we want
I wouldn't reset the fontsize in resetFontSettings setting though as it can target
the rest of the game/windows.

resetFontSettings is to bring back the fontsize/fontface used in that command.
so you need to set the fontsize in the draw section of those with:

this.content.fontsize = yoursize;

then it reset back to normal when not needed (same can be done for fontface
so you need to set the fontsize in the draw section of those with:
The only part in the code that I could find was this... confused as to where contents.drawText is defined.
JavaScript:
Window_Base.prototype.drawText = function(text, x, y, maxWidth, align) {
    this.contents.drawText(text, x, y, maxWidth, this.lineHeight(), align);
};

We can just change offsetY to whatever we want
This works, but it causes the icons to not be rendered any longer, showing the escape characters (e.g. \I[76]) instead. As the cost of the skills is similarly not rendered, this might be because of a conflict with BattleCore.
The only part in the code that I could find was this... confused as to where contents.drawText is defined.
JavaScript:
Window_Base.prototype.drawText = function(text, x, y, maxWidth, align) {
    this.contents.drawText(text, x, y, maxWidth, this.lineHeight(), align);
};


This works, but it causes the icons to not be rendered any longer, showing the escape characters (e.g. \I[76]) instead. As the cost of the skills is similarly not rendered, this might be because of a conflict with BattleCore.
This is where it gets complicated because there are two methods for drawing text. The one that supports icons does not support horizontal align. The one that supports horizontal align does not support icons and other escape codes. You have to make a choice here now which method you want to use.

It is possible to have a text rendering method that supports both escape codes and horizontal align but with the way the text rendering code works, it literally means that you draw the text once to get a measurement of its width, then draw it again at its final calculated position.

A more complicated solution would involve drawing that text on its own independent bitmap but that's getting to even more advanced plugin design I have not even attempted yet..
Thanks for all the input. I was staring at Bitmap.prototype.drawText in rmmz_core.js which I think is the function being called by this.contents.drawText(). But my brain froze... I guess I'll give up on it for now.

I suppose that an alternative approach would be to leave the font size as is, and look into the scaling of the UI (increase width of UI componenet and scale by 0.8 or something).
before drawing the text is set with the fontsize, it might be even higher than that.
before the function is even called, as it can be set there as well.

some even set an font cache and reset it back whatever that cache was,
useful for size/fontface of it.

as I dont own MZ, I cannot really check how its done or work, but you can figure it
out hopefully 🙂

Original thread: https://forums.rpgmakerweb.com/threads/change-font-size-of-only-the-actor_commandwindow.164444/