WebGL + Chrome = broken webfonts?

Discussion and feedback on Construct 2

Post » Wed Feb 27, 2013 4:53 am

I'm not really sure why this would be a problem, but it would seem that enabling WebGL in C2 breaks webfonts in Chrome

I tried running the sample capx from this thread by lemo. The sample capx from that thread is: Capx

If I run the capx in Chrome (version 25) with WebGL enabled, the webfont never loads. If I disable WebGL it works fine.

Any idea why this would be happening? I'm not sure if this is a driver thing, a chrome thing or a construct thing. Does anyone else experience this issue? Any ideas what could be causing it?
B
24
S
4
G
1
Posts: 244
Reputation: 3,462

Post » Wed Feb 27, 2013 10:29 am

It loaded for me, Chrome Version 25.0.1364.97 m.
Arial in the editor, the serif font in Chrome.
B
201
S
52
G
30
Posts: 897
Reputation: 36,621

Post » Wed Feb 27, 2013 11:28 am

It happens for me too! works fine with webGL off.

@Paradox, the serif font isn't what he's setting! Turn off webGL and you will see.

That's why my webfonts haven't been working correctly!

@Ashley I'd suggest we move this to bugs?
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Wed Feb 27, 2013 2:50 pm

It looks like a Chrome bug. It works fine with WebGL on in Firefox Nightly. Also in WebGL mode the text object actually uses the same canvas 2D drawing function, and then copies the canvas to the WebGL view. So our code is even more or less identical in both renderers. I'll try repro it and report to Google.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Wed Feb 27, 2013 3:05 pm

I can't find a way to reproduce it from scratch (without C2's engine). No idea what's going on here, but it does seem to be a Chrome bug; you could try reporting it to Google anyway, but they might just ask for a simpler repro...
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Wed Feb 27, 2013 5:56 pm

Hmm... If it can't be reproduced from scratch, wouldn't this indicate a C2 bug? I'd just hate for a bug this significant to go ignored as it affects basically all projects.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Thu Feb 28, 2013 3:29 am

I've been poking around the internet and I can't seem to dig up any info on this

The closest I could find was a bug ticket for GameMaker. The admin responded by saying that the fonts have to be fully loaded before WebGL kicks in. I tried playing about with the runtime.js file to simulate this but there's just a bit too much code to shuffle around. Could this be anything even close to what might be causing it in C2?

One other note: Webfonts with WebGL do seem to work in other games in Chrome. Example. In all the WebGL enabled HTML5 demos I could find that use webfonts, Chrome seems to load the fonts fine.boolean2013-02-28 04:10:12
B
24
S
4
G
1
Posts: 244
Reputation: 3,462

Post » Thu Feb 28, 2013 12:02 pm

If it works in one browser (Firefox) but not another (Chrome) generally it's an indication our code is correct because it works in one browser. But it could be an accidental reliance on something non-standards compliant...
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Fri Mar 01, 2013 2:45 am

@sqiddster

I might have figured out what the problem is. Can you do a quick test?

1) Run the font .capx I linked to in preview mode with WebGL enabled.
2) Change "localhost:5000" to "http://localhost:5000".

Do the webfonts suddenly work for you then?

Edit - Curious, this works if you have WebGL turned on and you are loading the font from an external source. I changed mine to point to a google font and the trick above allows it to work. However it's still not allowing local fonts to load. boolean2013-03-01 03:04:13
B
24
S
4
G
1
Posts: 244
Reputation: 3,462

Post » Fri Mar 01, 2013 11:29 am

Interesting - not working for me though, changing to http makes it act strangely and default back. Then it starts going to 50000 and 50001 :P
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Next

Return to Construct 2 General

Who is online

Users browsing this forum: Eisenhans, ijust8, saiyadjin and 10 guests