MZ (VisuStella Options Core) Fonts in different sizes

With VS Options Core, you can offer the player a choice of different fonts in the options menu.
Is there any possibility to attribute different font sizes to these fonts?
I don't want the player to choose the size themselves, instead each font gets an individual size every time it is chosen from the menu. (e.g. always 24 for Calibri, always 20 for Arial, etc.)

The background is that the design of my game is very much focussed on a specific font. Unfortunately, this font isn't all that readable with dyslexia, so I want to offer options -- but every other font comes out more or less too big. :/
VS Core Engine has plugin command to change main font size. If you check the console, the code seems to be like $gameSystem.setMainFontSize(font size)
So go to options core settings for the fonts and to that JS when you press left/right/action button and make it change the font size with that script there.
@rpgLord69

Sorry again for the additional questions ...



If I understand the settings of VS Options Core correctly, this happens when you press "left" ...

Code:
// Declare Constants
const symbol = arguments[0];
let value = this.getConfigValue(symbol);
const lastValue = value;

// Perform Actions
const length = TextManager.optionsCoreFonts.length - 1;
value -= 1;
value = value.clamp(0, length);
this.setConfigValue(symbol, value);
this.redrawItem(this.findSymbol(symbol));
if (lastValue !== value) {
    this.playCursorSound();
    this.refreshWindows();
}

If I inserted your code here, wouldn't it change the font size EVERY time you click left, no matter which font is active at a specific moment?
Is it possible to make the code dependant on the active font?

(I could also reduce the font selection down to 2 though! If that helps.)



Thanks again, it's appreciated a lot!! And while the other question is just aesthetics, this one could make a serious difference for some people.
I haven't used that, but looking at that code it looks like you have set up a list somewhere of fonts you can select. So make conditionals (for example after that setConfigValue) of:

if (value === X) {
$gameSystem.setMainFontSize(font size)
}

And so on. Change X to the index. The first index in your list is 0.

EDIT: And of course change if for 'cursor left', 'cursor right' and 'ok button' settings.
Okay, I got it! In the end, I reduced the choices down to one alternative font, as to keep weird formatting problems to a minimum.
Thanks a bunch again!

Edit: Welp, there's ONE more problem, I think ... xD'
@rpgLord69
If I start a new game, the size always reverts to the standard (which is too big for the alternative font). Is this something that can be changed with a script? Perhaps something that checks the font when a new game is started and adjusts the size again?
Cool.

For your new problem, I guess even though the font size is saved in save games, it resets it at new game.

Just put in an event at your game start (or VS Core Engine New Game Common Event) a conditional using the script line, with like (change the font name to whatever you use):
$gameSystem.mainFontFace() === "Garamond"
--->
$gameSystem.setMainFontSize(font size)
Okay, I think I have it! It did the same when loading a game, but I do have a galv plugin to trigger stuff on load, so no problem there.
And if something else comes up with this issue, I should be able to handle it myself. 😀

Thanks!!
Okay, there is after all one more problem with this ...
The size is alright INSIDE (meaning after starting/loading a game), but after booting up, it always snaps back to the original size for the title menu, and the options menu if you use it at this point. This isn't game breaking because the font is alright for the actual game, but seeing a wrong size in the title menu is starting to get on my nerves.
Hmmm you can make a check for the font I think and change it with a plugin:

const myEdit1_SceneTitle_Create = Scene_Title.prototype.create;
Scene_Title.prototype.create = function() {
if ($gameSystem.mainFontFace() === "Garamond");
$gameSystem.setMainFontSize(60);
myEdit1_SceneTitle_Create.call(this);
};
Okay, woah ...
I THINK there might have been a mistake in your plugin (it didn't really work), but following the stuff you gave me in this thread before, I tried to fix it, and I think I got it ...?
Which is kind of wild because I really only know the absolute basics of JavaScript! 😮 Either way, the one below works, at least for now! Thanks a lot!!


const myEdit1_SceneTitle_Create = Scene_Title.prototype.create;
Scene_Title.prototype.create = function() {
if ($gameSystem.mainFontFace() === "Garamond") {
$gameSystem.setMainFontSize(60);
}
myEdit1_SceneTitle_Create.call(this);
};
Ah yeah, I accidentally put a semicolon there where it wasn't supposed to be. (The brackets aren't necessary if the IF only controls 1 line.)

Original thread: https://forums.rpgmakerweb.com/threads/visustella-options-core-fonts-in-different-sizes.180337/