Easy optimization for the fonts of your project

ScSWinter

Veteran
Veteran
Joined
Jan 8, 2018
Messages
58
Reaction score
65
First Language
Spanish
Primarily Uses
RMMZ
Brief description

Taking advantage of new web technologies we can optimize the fonts of our game (or, at least, in most of them, the main font) so that it takes up less space (> 1MB to 0.016MB) and loads much faster , showing exactly the same quality. The woff2 font format is wide supported in all browsers (https://caniuse.com/#search=woff2).

Legal requirement

The license of the font must allow you to do this modification to the font. In the case of default game font I believe that this is the license, so we can do it.

These fonts are free software.
Unlimited permission is granted to use, copy, and distribute them, with or without modification, either commercially or noncommercially.
THESE FONTS ARE PROVIDED "AS IS" WITHOUT WARRANTY.
http://mplus-fonts.osdn.jp/about-en.html#license

Tutorial
For the default game font.​

You can change the default font TTF (1Mb ) to their WOFF2 western-optimized version (16Kb ).
  1. Put the attached file (woff2 extension) in the font directory
  2. Remove the previous font that has ttf extension.
  3. Change the gamefont.css first-part to (changes in bold).
CSS:
@font-face {
    font-family: GameFont;
    src: url("mplus-1m-regular.woff2") format('woff2');
}


You can do it yourselft with your own fonts custom game fonts using https://www.fontsquirrel.com/tools/webfont-generator to generate the woff2 files.

Extra

For advanced stuff please refer to the Google deep explanation: https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/webfont-optimization?hl=en
 

Attachments

  • mplus-1m-regular.woff2.zip
    16.5 KB · Views: 9
Last edited:

KotoYama

Veteran
Veteran
Joined
Apr 20, 2019
Messages
358
Reaction score
51
First Language
Spanish
Primarily Uses
RMMV
I assume it doesn't fix the "blurry" fonts problem? :D
 

Latest Threads

Latest Profile Posts

I've decided to try and be more social and less nervous about engaging. I'm always over thinking things - from now on when I'm worried or don't get something I'll just ask.
Sometimes a mechanic that is meant to add challenge is just annoying. Even the Final Fantasy games did not completely escape this pitfall of design. (FF8 draw system I'm looking at you - grrrr)
starting working on the sprites for one of my games major antagonists finally. here's the first frame of his chanting motion in battle.
Have spent too much time hammering out with a friend just how to make a reoccurring enemy that permanently learns skills you use against her.
I know what I want in a loose sense. Maybe I should just make a post asking for opinions and suggestions.

Forum statistics

Threads
113,742
Messages
1,077,115
Members
147,766
Latest member
imfayzer
Top