You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Font cannot be rendered on canvas after active event on Safari #370
@belartodmarinus Try this: https://jsfiddle.net/hjqtqyvx/2/ -> If it fails in Safari, then its a problem with Safari itself.
This example use the native font loading api without Web Font Loader library.
Hi @nextend thanks for your reply, this doesn't seems to use the right font on Safari or Chrome...
I'm pretty sure this is a bug in Safari, my fiddle works on the developer preview of Safari (Release 33 (Safari 11.0)). If I remove the fillText line I don't see "Gloria Hallelujah" loading in the network inspector (although the active event is trigged).
I've also went ahead and tried using the native font loader from Safari and it's exactly failing in the same way; the promise is triggered but the font isn't loaded.
I also experience this issue using custom fonts in Safari - and it doesn't matter if you clear the cache. The issue occurs consistently when you have a local declaration in the src list. e.g.
In this case the font isn't fetched up front at all - even though active event is triggered. Remove the local src and it works fine. See fiddle: https://jsfiddle.net/mlev/4w6jweo2/
The same thing happens with FontFaceObserver so guessing it's a Safari issue.
I'm experiencing this bug, and I do not use local() at all. Yes, seems like in High Sierra beta the bug is fixed, but I can't force all users to update to a beta OS, so still looking for a workaround (we have a plenty of users with this exact version of safari)
@bramstein WebKit nightly supports the document.fonts.load API and don't require the fontwatchrunner workaround. This is (for me) the most important feature in webfontloader.
I'm guessing it is a bug related to url loading+local src. (Safari/iOS only)
If the font from url is not fully loaded and the local() is not installed, the issue happened.
I'm making a html5 game using webfont. In the beginning, all characters I've tried to render are question marks. But later it will be rendered correctly.
The bigger font file size, the more question marks I got. I use fontmin to reduce the size of font file, then I got less question marks. It seems the slower networking could also cause more question marks be rendered.
Anyway, remove the local() and only set url src could resolve the issue.
I still see this issue even after removing local() references - but does seem harder to trigger.
So can I clarify where we think the problem is? AFAIK webfontloader doesn't use the native loader for Safari 10 so this isn't a native loading issue. Is this just something the fontwatchrunner can't detect at the moment?
Ok that makes sense - just a few different things mentioned in this thread.
I realised that my jsfiddle above was using 1.6.26 - which is still using native loader for Safari and works fine once I remove any local() refs. Given that the fontwatchrunner doesn't work for Safari 10 I'm tempted to rollback to that version. Is there any benefit of still using fontwatchrunner for Safari 10?
This happened to me with safari 10.1. Things working fine in safari 11 for me. I am using google Roboto font and the font is not picked up by canvas at all.
Activity
nextend commentedon Jun 19, 2017
@belartodmarinus Try this: https://jsfiddle.net/hjqtqyvx/2/ -> If it fails in Safari, then its a problem with Safari itself.
This example use the native font loading api without Web Font Loader library.
belartodmarinus commentedon Jun 19, 2017
Hi @nextend thanks for your reply, this doesn't seems to use the right font on Safari or Chrome...
I'm pretty sure this is a bug in Safari, my fiddle works on the developer preview of Safari (Release 33 (Safari 11.0)). If I remove the fillText line I don't see "Gloria Hallelujah" loading in the network inspector (although the active event is trigged).
I've also went ahead and tried using the native font loader from Safari and it's exactly failing in the same way; the promise is triggered but the font isn't loaded.
mlev commentedon Jul 6, 2017
I also experience this issue using custom fonts in Safari - and it doesn't matter if you clear the cache. The issue occurs consistently when you have a local declaration in the src list. e.g.
In this case the font isn't fetched up front at all - even though active event is triggered. Remove the local src and it works fine. See fiddle: https://jsfiddle.net/mlev/4w6jweo2/
The same thing happens with FontFaceObserver so guessing it's a Safari issue.
bramstein commentedon Aug 1, 2017
I think it might be related to a bug in
local(). Could you try WebKit nightly? It looks very similar to this bug: bramstein/fontfaceobserver#105AvaelKross commentedon Aug 1, 2017
I'm experiencing this bug, and I do not use
local()at all. Yes, seems like inHigh Sierra betathe bug is fixed, but I can't force all users to update to a beta OS, so still looking for a workaround (we have a plenty of users with this exact version of safari)belartodmarinus commentedon Aug 1, 2017
@bramstein WebKit nightly supports the
document.fonts.loadAPI and don't require the fontwatchrunner workaround. This is (for me) the most important feature in webfontloader.fantasydr commentedon Sep 2, 2017
I'm guessing it is a bug related to url loading+local src. (Safari/iOS only)
If the font from url is not fully loaded and the local() is not installed, the issue happened.
I'm making a html5 game using webfont. In the beginning, all characters I've tried to render are question marks. But later it will be rendered correctly.
The bigger font file size, the more question marks I got. I use fontmin to reduce the size of font file, then I got less question marks. It seems the slower networking could also cause more question marks be rendered.
Anyway, remove the local() and only set url src could resolve the issue.
mlev commentedon Sep 12, 2017
I still see this issue even after removing local() references - but does seem harder to trigger.
So can I clarify where we think the problem is? AFAIK webfontloader doesn't use the native loader for Safari 10 so this isn't a native loading issue. Is this just something the fontwatchrunner can't detect at the moment?
belartodmarinus commentedon Sep 12, 2017
Yes, in my opinion this is a bug in Safari 10 which makes the current logic in fontwatchrunner unusable.
This is fixed in the new version of Safari (which has native font loading notifications).
mlev commentedon Sep 12, 2017
Ok that makes sense - just a few different things mentioned in this thread.
I realised that my jsfiddle above was using 1.6.26 - which is still using native loader for Safari and works fine once I remove any local() refs. Given that the fontwatchrunner doesn't work for Safari 10 I'm tempted to rollback to that version. Is there any benefit of still using fontwatchrunner for Safari 10?
vinch commentedon Nov 16, 2017
Has the fix been released in the latest version of Safari? I can't seem to reproduce the bug on my side.
belartodmarinus commentedon Nov 30, 2017
@vinch it would help if you tell which Safari version you're using 😄
vinch commentedon Nov 30, 2017
@belartodmarinus Indeed, sorry. I'm on Safari 11.0.1 (12604.3.5.1.1)
csomakk commentedon May 30, 2018
we have a similar issue on iPad AIR on iOS 10.3.2.. reproduced the 1st fiddle too. simulator looks fine tho. nextens fiddle (/2) works fine on device.
csomakk commentedon Jun 1, 2018
also happened iPhone 5C iOS 10.3.3. fix was:
ryancat commentedon Aug 1, 2018
This happened to me with safari 10.1. Things working fine in safari 11 for me. I am using google Roboto font and the font is not picked up by canvas at all.