Anisoft

Great Desu King
Veteran
Joined
Jun 17, 2015
Messages
97
Reaction score
86
First Language
English
Primarily Uses
So I've been trying to load my own custom font for a while. I've followed many guides online, as well as actually gotten a few fonts working. But I've seem to noticed that not all fonts are supported, at least after a lot of testing, and I was hoping to find out why. 

The current font I'm trying to use Circo (link to font http://www.dafont.com/circo.font ) Has been impossible for me to load. I've tried all kinds of things from renaming the actual font file, to checking and looking at the actual font name from within the file, but haven't gotten anything to work. 


My current setup for loading the font is 

13e4de4f8e.png



So far the only way I've been able to get the font to load correctly is by using an incorrect IE based format (EOT). (I did this by converting the font into all possible font types, and then testing each one. (I used this site to convert it btw http://www.font2web.com/)

dbb28ebee6.png





But from what I've read this format shouldn't even work on chrome (which is what MV runs off if I'm not mistaken), and has LOTS of limitations. So I'd rather not use something that just seems to work now without a reason for it too, and instead find a solution. I have no idea if its how fonts are loaded or not, but I'd love to have some insight as to why this isn't working, and if there is a possible fix and or workaround (that doesn't just work when it shouldn't.) 


Any help is really appreciated. 
 

Zalerinian

Jack of all Errors
Veteran
Joined
Dec 17, 2012
Messages
4,699
Reaction score
940
First Language
English
Primarily Uses
N/A
Are there any messages in the console regarding the font? It looks like it's loaded fine, but then again it doesn't look like you tell any Windows or anything to actually use that font, so that might be part of it. 
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,812
Reaction score
889
First Language
German
Primarily Uses
RMMZ
You also need to register the font via JavaScript, as using it inside the canvas doesn't actually cause the browser (even local play is in fact a Chrome instance) to load the font.


There are multiple plugins, that can be used to load the font, one of which is linked in my signature.
 

Anisoft

Great Desu King
Veteran
Joined
Jun 17, 2015
Messages
97
Reaction score
86
First Language
English
Primarily Uses
Are there any messages in the console regarding the font? It looks like it's loaded fine, but then again it doesn't look like you tell any Windows or anything to actually use that font, so that might be part of it. 



Well I am loading the font in and running it. As that's how I'm testing if its working or not... if this is what you mean. There aren't any console messages tho.

 

64ac8a24de.png



Don't mind the random stuff, it was to just test it if changes, as I run the drawStatusName function inside an update function.

You also need to register the font via JavaScript, as using it inside the canvas doesn't actually cause the browser (even local play is in fact a Chrome instance) to load the font.


There are multiple plugins, that can be used to load the font, one of which is linked in my signature.



Register the font via Javascript? What exactly do you mean by this? I also just noticed your font script, so I would like to know what exactly it does to fix this problem.  Like I've said previously, I've gotten other fonts to work before, but this one (and a few others.) If I can simply just "register" it, and that fixes the problem then this helps my case a lot! (haven't tested but will soon)

EDIT*

Lavra I actually noticed the way I had gotten fonts to work in the past was loading them (similar to your plugin.)  I added my font object to it, and it loaded fine! 

 

29c0ef4ef8.png



My question now is I've noticed you load it via Graphics.loadFont, I'd like to assume that's a better way to load the font. Would I be assuming correctly? And why is it you have to load it this way vs CSS. 

Again, thanks for the help you've already provided, this is just to get more information as to why this stuff works.  
 
Last edited by a moderator:

Anisoft

Great Desu King
Veteran
Joined
Jun 17, 2015
Messages
97
Reaction score
86
First Language
English
Primarily Uses
Well its been a few days since I've had it working. Anything left to share here would be explanations as why you need to do some of this stuff. Thanks everyone for your help! I think this can be closed (if even needed to be closed.)
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,812
Reaction score
889
First Language
German
Primarily Uses
RMMZ
_createFontLoader is called by loadFont, which also dynamically edits the stylesheet included with the game. I expected plugin users to not want to edit a css file in addition to using the plugin, so i wrote it that way.
 

Latest Threads

Latest Posts

Latest Profile Posts

"16. Do NOT contact other members by private message, on the forum or status feed, inviting them to put additional tools (such as leaderboards, ads, etc - whether yours or another person's) into their game."
Oh no. Necessity is the mother of invention. Do I want to know what happened?
Early WIP for my next entry. Since it's early you're going to need to wait a little longer than usual. What's that? You'll find out in my next update!
12.PNG
20 festive cards can now be unlocked in BiteMe!

The cards are permanent, but can only be unlocked in December!
Once the year is over, you won't be able to unlock the cards, or to upgrade it.
https://johndoenews.itch.io/biteme-storymodeCard141-160-Ad.png
Finally showing some updates again

Forum statistics

Threads
117,181
Messages
1,105,245
Members
153,307
Latest member
nyhkkbjyek
Top