Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

[Editor] How to install and use a second font in MV

Status
Not open for further replies.

David FoxFire

Adventurer
Xy$
0.00
I don't know if someone found out how to do it, but there might be a need for me to use a second (or even third) font for text in my project. I'd like to be able to install and use them for special graphics (instead of using pictures) while still keeping the built-in font for the text of the game.

All assistance here will be greatly appreciated.
 

eivl

Local Hero
Xy$
0.00
Add the font to your font folder and edit the CSS file to have the font loaded when you start the game.
Then you call it from a script.
Not sure what method does this, try to search for it in your js folder.
 

Sly

Villager
Xy$
0.00
Ok, i'll try to explain with my poor english. Cross your fingers!PX

First of all, to have this control you need install and activate two Plugins, both of Yanfly:
YEP_CoreEngine
and
YEP_MessageCore

You can found both of in http://yanfly.moe/yep/

Now we can continue:
1 - Copy the .tff file of the new font to "\ProjectFolder\fonts". If the name of file is too complex, rename it to something more easy.
Ex.: Font2.tff

2 - In the same folder, open the file "gamefont.css" with notepad and add this to the end of the file. Change the names for your needs.

Code:
@font-face {
    font-family: FontName;
    src: url("FileName.ttf");
}
And save overwriting the original.

3 - Inside the RMMV, when you need to use your new font in the text you must put the escape code "\fn<x>". Where X is the name of the font, like you put in CSS file and in the plugin's config, Like that:
\fn<FontName> Hello World!
Other escape codes of YEP_MessageCore:
\fr - Reset the font to the default.
\fs[x] - Change the size of the font to x.
\fb - Change the font to bold, if possible.
\fi - Change the font to italic, if possible.
Well, thats all. You can repeat the process to put more fonts in the game.
Hope it can help you in your project.:thumbsup:

Seeya.8D
 
Last edited:

David FoxFire

Adventurer
Xy$
0.00
Well, since I'm using Yanfly for my messaging skills, this should be a no brainer. Thanks.

Oh, and Sly, :) Your English is working just fine!
 
  • Like
Reactions: Sly
Status
Not open for further replies.
Top