-
Notifications
You must be signed in to change notification settings - Fork 649
-
Notifications
You must be signed in to change notification settings - Fork 649
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 families might not really loaded in WebKit based browsers in specific networks conditions #365
Comments
#353 can be the same issue |
With the native font load api, my example works fine in Chrome, so there is an issue in this library. Safari still fails with the native font load api. https://smartslider3.com/bugs/webkit/fontfamily1/index2.html |
@nextend did you find any workaround for this ? |
No. Chrome seems fine with native font loader api, so there is a bug in Web font loader. For Safari, I think it is a bug in Webkit and not in thus library. |
I faced with the same issue. This bug reproduces in Safari (MacOS X, iOS) and Chrome (iOS). |
Related bug report in WebKit bug tracker: https://bugs.webkit.org/show_bug.cgi?id=172210
My assumtion would be:
Webkit fails to do this and fires the load event even when not able to render the font family yet. It happens mostly on IOS Safari when font family is not cache, but in simulated network enviroment, I can simulate it in Safari on OSX, Chrome on OSX and Chrome on Windows too.
I have created a page to show this bug: http://smartslider3.com/bugs/webkit/fontfamily1/index.html
It loads several Google Fonts with the Web Font Loader.
I tried it with document.fonts.ready, but it was even more inconsistent in non-simulated environment.
If the output contains green "Fonts active + renderable" then everything was fine.
If there is no green on the output or red appears, it means a fail.
The desired output would be something like this (families might be in different order, depends on the network environment):
Internet Explorer 11, Edge and Firefox produces the following result even in throttled network condition.
To be able to consistently reproduce the bug, you must throttle the network only on the host: fonts.gstatic.com
(Charles proxy was great help in it.) Make sure to set up https proxy too if you are testing on the https version.
For Safari/OSX testers: It is not enough to disable caches on develop tab. You must hit Empty caches to remove font families from the cache! It seems like disable cache has no effect on the font families.
For IOS: when document load event fired, the default width with the system font changes so I have to update it to be able to compare to the soon-to-be-renderable font families. I think it is a bug too.
Chrome - Failed output:
Fons marked ready, but browser is not be able to render them yet. It takes more than 1 seconds for Family Kaushan Script to be able to render after it should be.
Safari - OSX - Failed output:
Safari - IOS - Failed output
The text was updated successfully, but these errors were encountered: