-
Notifications
You must be signed in to change notification settings - Fork 645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Font cannot be rendered on canvas after active event on Safari #370
Comments
@belartodmarinus Try this: https://jsfiddle.net/hjqtqyvx/2/ -> If it fails in Safari, then its a problem with Safari itself. |
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 think it might be related to a bug in |
I'm experiencing this bug, and I do not use |
@bramstein WebKit nightly supports the |
I'm guessing it is a bug related to url loading+local src. (Safari/iOS only) 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? |
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). |
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? |
Has the fix been released in the latest version of Safari? I can't seem to reproduce the bug on my side. |
@vinch it would help if you tell which Safari version you're using 😄 |
@belartodmarinus Indeed, sorry. I'm on Safari 11.0.1 (12604.3.5.1.1) |
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. |
also happened iPhone 5C iOS 10.3.3. fix was:
|
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.
|
This might be related to #365 but as @nextend mentioned, it might be related to a bug in Safari's webkit.
I'm using the following code:
https://jsfiddle.net/hjqtqyvx/
This works in Firefox and Chrome but it doesn't work with the latest Safari 10.1.1 (12603.2.4), which displays the attached screenshot.
(note, this is only shown if the cache is cleared before (re)loading the jsfiddle)
Older versions of Safari show different behaviour (from just working to displaying a default font).
The text was updated successfully, but these errors were encountered: