Player to change the FONT of the game in the Options Menu?

Val

Veteran
Veteran
Joined
Oct 12, 2015
Messages
281
Reaction score
168
First Language
Français
Primarily Uses
Hello everyone,

I would like to know if someone know a plugin that can give the player the option to select between different FONT for the text of his game?

What I would like is to give an Option Menu with the Parameter Font and the player could scroll in this list to change the FONT of all
the text in the game.

Is this possible for someone here to make this small plugin available for all?
Giving more choice to the player to customize his experience is always a great addition.

Thanks!
 

Val

Veteran
Veteran
Joined
Oct 12, 2015
Messages
281
Reaction score
168
First Language
Français
Primarily Uses
Woahhhhh that would be awesome thanks for your help! I'm sure a lot of people will appreciate this game changing experience :)
 

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
875
Reaction score
591
First Language
English
Primarily Uses
RMMV
That dude's script will probably be better, but I just wanted to race him and see if I could make one first.

PHP:
// add your ttf names fonts to this array
ConfigManager._optionalFonts = [
   "mplus-1m-regular",
   "Arial Rounded MT Bold",
   "alphbeta"
];
var inlineFont = document.createElement("style");
inlineFont.type = "text/css";
inlineFont.id = "inline_font";
document.head.appendChild(inlineFont);
ConfigManager._currentGameFont = 0;
ConfigManager.setGameFont = function(fontName){
   document.getElementById("inline_font").innerHTML = '@font-face{'+
       'font-family:GameFont; src:url("fonts/' + fontName + '.ttf");'+
   '}';
};
Object.defineProperty(ConfigManager, 'gameFont', {
    get: function() {
        return true;
    },
    set: function(value) {
       if(SceneManager._scene._windowLayer !== undefined){
           this._currentGameFont = this._currentGameFont + 1 < this._optionalFonts.length ?
               this._currentGameFont + 1 : 0;
           var font = TextManager.gameFont = this._optionalFonts[
               this._currentGameFont
           ];
           TextManager.gameFont = font;
           this.setGameFont(font);
           SceneManager._scene._windowLayer.children[0].refresh();
       }
       return true;
    },
    configurable: true
});
ConfigManager.makeData1 = ConfigManager.makeData
ConfigManager.makeData = function() {
   var config = this.makeData1.apply(this, arguments);
   config.gameFont = this.gameFont;
   return config;
};
ConfigManager.applyData1 = ConfigManager.applyData;
ConfigManager.applyData = function(config) {
   this.applyData1.call(this, arguments);
};
Window_Options.prototype.addGeneralOptions1 = Window_Options.prototype.addGeneralOptions;
Window_Options.prototype.addGeneralOptions = function() {
   this.addGeneralOptions1.call(this, arguments);
   TextManager.gameFont = ConfigManager._optionalFonts[
       ConfigManager._currentGameFont
   ];
   this.addCommand(TextManager.gameFont, 'gameFont');
};
I only tested the main menu options and three fonts, but I already assume it's good to go.

Seriously, use the one made by @SumRndmDde though... I don't trust mine...
 
  • Like
Reactions: Val

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

@wrigty12 hi! thanks for showing interest in my work. Sadly the tablet I'm using broke, so I wasn't able to create anything for weeks. Got a new one with display, I'm still not used to it though, so I'm still practicing, doing basic drawings again. Also I'm in my last year of college. Thesis, projects and other activities takes most of my time ;_;.
I'll get back to it whenever I get a free time.
Any artists here planning on participating in the Inktober art prompts this October?
It's right around the corner.
It's rpg maker related so I'll post it here, I worked on a little free rpg maker zine and this was my piece. Play Grimm's Hollow if you haven't already, I liked it a lot. (i don't remember if posting a link to a product even if free is allowed via profile posts, so if anyone knows lemme know)

Suddenly arrived to work and got the pink slip on a contract O_O wait, did i forget something??? (sobbing in corner rn)

Forum statistics

Threads
103,024
Messages
996,747
Members
134,496
Latest member
MVMS
Top