MV YEP_MessageCore - change font in text window

Hello, I have an issue with the YEP_MessageCore plugin.

Using the command "/fn<x>, I can make two different fonts I have in the fonts folder work, one of which is the default font for the entire game. The point is, I would like to activate a third one, but for some reason, it doesn't work and shows the default RPG Maker MV font. Does anyone have any ideas?

I've also tried setting this last font as the general font, and in that case, it works (in the game windows and dialogues...), but it's precisely when the command /fn<x> is present that the font doesn't change. 🙁
Custom fonts require a few things to set them up. Which fonts exactly are you using? Have you added it to gamefont.css? Does it only break on the first message where it's used, or not work on subsequent ones too?
in use to use FN tag, you required to use YEP_LoadCustomFonts as well,
this loads the fonts correctly at the first time as the fonts aren't loaded
directly.

it is also in the loadCustomFonts video when using it as it is a bug/glitch
why YEP made that plugin to work correctly.
Custom fonts require a few things to set them up. Which fonts exactly are you using? Have you added it to gamefont.css? Does it only break on the first message where it's used, or not work on subsequent ones too?
I use fonts made by myself. The first two work perfectly. The third, if added in the CSS, works and appears in the entire game, but this was just a test. I just want to use this third font in text boxes, and it totally doesn't work (both in the first message and the subsequent). 🙁

in use to use FN tag, you required to use YEP_LoadCustomFonts as well,
this loads the fonts correctly at the first time as the fonts aren't loaded
directly.

it is also in the loadCustomFonts video when using it as it is a bug/glitch
why YEP made that plugin to work correctly.
Yes, I see the "load plugin", but why did they make it not free if the free MessageCore doesn't work >:(
there are some other plugins that loads it, but I do not now why that one is
not free though D:
The third, if added in the CSS, works and appears in the entire game, but this was just a test
Wait, so what exactly are you doing? You have to add it to that file, but it's not supposed to replace the regular font (I'm assuming this is what you mean by "appears in the entire game"). Can you show what changes you've made to it exactly?

And don't worry, you don't actually need any paid plugins to make this work, the tricky part is mostly just the gamefonts.css modification.
font can be installed on the user pc to show it correctly, with the LoadCustomFonts
is that avoided, only I dont know what other plugins can be used to load fonts only.
Wait, so what exactly are you doing? You have to add it to that file, but it's not supposed to replace the regular font (I'm assuming this is what you mean by "appears in the entire game"). Can you show what changes you've made to it exactly?

And don't worry, you don't actually need any paid plugins to make this work, the tricky part is mostly just the gamefonts.css modification.
Schermata 2024-03-22 alle 13.15.40.png


I'll try to explain myself better (if I can, lol).

The one in the CSS file was just a test; I don't want font number 3 as the default font for the game, but I want to use it only in some text boxes, as if a character were speaking using a different font.

In my 'Fonts' folder, I have three: 1, 2, and 3.

1 is the one set in the CSS file, which in the image is called 'TEST.ttf' For normal game dialogues, I always use number 1, but in some cases with the plugin command '/fn<x>', I change, exclusively during dialogues, to font 2 or 3. The 2 works without problems, but number 3 just doesn't work (it remains the default font of RPG Maker MV).
Ah, I see. You're not meant to modify that entry, just copy it and modify the copy. The url is the path to the file, and the font-family is just how you want to refer to it in game.
Spoiler: Example (this file in my game)
1711111884034.png

Then use those names in the command, e.g. I'd do \fn<Antar> to use the second font.
The reason your second font worked but third one didn't is likely because the second one was an existing system font and therefore didn't need to be loaded, but most fonts will require adding them here - in fact it's probably a good idea to add all of them here, since other people's systems might not have it.

Once you've got that sorted, you just need to make sure they're loaded - they'll automatically do so whenever used, but some text might already display before they're done. To avoid that, you can use a simple plugin to make sure they're all loaded at the start of the game, e.g.
JavaScript:
Graphics._createGameFontLoader = function () {
    this._createFontLoader('GameFont');
    this._createFontLoader('Chakra');
    this._createFontLoader('Antar');
    this._createFontLoader('Segment');
};
Use the same names as specified in font-family.
Ah, I see. You're not meant to modify that entry, just copy it and modify the copy. The url is the path to the file, and the font-family is just how you want to refer to it in game.
Spoiler: Example (this file in my game)

Then use those names in the command, e.g. I'd do \fn<Antar> to use the second font.
The reason your second font worked but third one didn't is likely because the second one was an existing system font and therefor didn't need to be loaded, but most font will require adding them here - in fact it's probably a good idea to add all of them here, since other people's systems might not have it.

Once you've got that sorted, you just need to make sure they're loaded - they'll automatically do so whenever used, but some text might already display before they're done. To avoid that, you can use a simple plugin to make sure they're all loaded at the start of the game, e.g.
JavaScript:
Graphics._createGameFontLoader = function () {
    this._createFontLoader('GameFont');
    this._createFontLoader('Chakra');
    this._createFontLoader('Antar');
    this._createFontLoader('Segment');
};
Use the same names as specified in font-family.
I understand and It worked, thank you so much!
JavaScript:
Graphics._createGameFontLoader = function () {
this._createFontLoader('GameFont');
this._createFontLoader('Chakra');
this._createFontLoader('Antar');
this._createFontLoader('Segment');
};
Use the same names as specified in font-family.
something I didn't know either, but this require to modify css as well,
small mediate user adjustment, but kind of brilliant otherwise.
@Mac15001900
Hello, your solution works.
However, now I have another issue that seems like you mentioned earlier.
Does it only break on the first message where it's used, or not work on subsequent ones too?

Essentially yes, the font doesn't change in the first line, but it works after. Is there any quick solution to prevent this from happening?
you can try to initilize it in the game.

function initFonts() {
return Graphics._createGameFontLoader()
}

than in a game, use initFonts() in parallel/autorun and erase event and it
should work afterwards directly.

this should be done only once per game boot.

another way is to use a function to boot it from the game start
so it will be loaded from there.
Essentially yes, the font doesn't change in the first line, but it works after. Is there any quick solution to prevent this from happening?
The script I've shown earlier is meant to prevent that, making sure that the font is ready when the game starts. Have you used something like it?
The script I've shown earlier is meant to prevent that, making sure that the font is ready when the game starts. Have you used something like it?
Schermata 2024-04-05 alle 21.07.21.png


I'm using this
I meant the JavaScript one, overwriting Graphics._createGameFontLoader. You need that to make the fonts load on startup.
I meant the JavaScript one, overwriting Graphics._createGameFontLoader. You need that to make the fonts load on startup.
Yes, it worked! Thank you so much!

Original thread: https://forums.rpgmakerweb.com/threads/yep_messagecore-change-font-in-text-window.167053/