Web font not loading outside of Construct?

Get help using Construct 2

Post » Thu May 09, 2013 1:32 pm

I just put a web font in my game and upon uploading it to DropBox the webfont is replaced with what I imagine is a default serif font.
It worked totally fine when I ran the game in the editor, and it is registering that there should be a font (the editor text is in Arial).

I tried it in Mozilla and Chrome with the same result. Is this a known problem?

EDIT: Here's a link to the game.
https://dl.dropboxusercontent.com/u/72855875/TheCollector0.13/index.html

The font should be this: http://www.google.com/fonts/specimen/Geo but it looks like it's Times New Roman for me.Sushin2013-05-09 13:40:44
B
10
S
3
G
3
Posts: 234
Reputation: 3,467

Post » Thu May 09, 2013 2:20 pm

Just to see if I can help, did you create an "On start of layout" event with an "Add a Set web font" action? :)
B
12
Posts: 6
Reputation: 357

Post » Thu May 09, 2013 2:25 pm

Of course I did o_o
Like I said, the web font appears when I run the game from the editor. I can actually see it switch from Ariel to Times New Roman (or whatever) and to Geo in less than a second.
It doesn't go to Geo when I export it and play it in dropbox though.
B
10
S
3
G
3
Posts: 234
Reputation: 3,467

Post » Thu May 09, 2013 8:04 pm

Am I the only one with this problem..?
B
10
S
3
G
3
Posts: 234
Reputation: 3,467

Post » Thu May 09, 2013 8:43 pm

I had a lot of trouble with fonts in C2. The best solution I found was include the font (in .svg, .woff, .ttf formats) and a .css file to the project. At fontsquirrel.com there is an online service that can provide everything to you, just upload your font there. After upload your project at your dropbox folder, copy the .css file public url and paste it at the proper field in the C2's set web font function.
B
12
S
6
G
3
Posts: 100
Reputation: 3,836

Post » Fri May 10, 2013 7:22 pm

Ah. Thanks a lot. That did the trick.
B
10
S
3
G
3
Posts: 234
Reputation: 3,467

Post » Fri May 10, 2013 7:23 pm

@pcfernandesjr

You should make a tutorial of how you did =D
ImageImageImageImageImageImage
B
92
S
19
G
12
Posts: 1,192
Reputation: 18,276

Post » Fri May 10, 2013 8:12 pm

@TELLES0808

Good idea. I'll try to post it this weekend. =)
B
12
S
6
G
3
Posts: 100
Reputation: 3,836

Post » Fri May 10, 2013 8:25 pm

I guess the problem with the font is due the origin restriction of html5.
Google Font .ttf files are served with the "Access-Control-Allow-Origin: *" header, while CSS files are not. Maybe the original webfont was in a page that did not allow other origins to incorporate it.
B
39
S
11
G
5
Posts: 132
Reputation: 8,228

Post » Fri May 10, 2013 8:44 pm

@arcalaus also, this issue is about using WEBGL or not, because when you don't use, the font work fine.
ImageImageImageImageImageImage
B
92
S
19
G
12
Posts: 1,192
Reputation: 18,276

Next

Return to How do I....?

Who is online

Users browsing this forum: jeffige, TheHat, Yahoo [Bot] and 0 guests