Skip to content
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

check if the font is fully loaded in safari (and not using question mark boxes) #371

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

belartodmarinus
Copy link

check if the font is fully loaded in safari (and not using question mark boxes)

this is a fix/workaround for #370

@bramstein
Copy link
Contributor

Thanks! Do you have a bug report for Safari? I'd like to understand this bug better.

@belartodmarinus
Copy link
Author

Hi @bramstein , I've reported my bug at https://www.apple.com/feedback/safari.html I hope I get some reply from that. I've tried reproducing this bug without webfontloader but I couldn't reproduct it yet.

@EugeneSqr
Copy link

Struggling with the same problem. Hopefully the fix gets accepted.

@belartodmarinus
Copy link
Author

@bramstein I didn't get any response from my bug report at Apple, as stated below I cannot report this bug at webkit.

Note: Safari is not WebKit. Safari bugs should be reported to Apple.
https://webkit.org/reporting-bugs/

Do you have some other suggestion?

I think this is fixed in the technology preview because there we can use the native font loading API.

BTW I've got a report this fix doesn't work for Chrome on iOS (where this is fixed in Safari). Chrome on iOS doesn't use the Chrome rendering/javascript engine but the iOS system version of webkit.

@AvaelKross
Copy link

AvaelKross commented Aug 1, 2017

Seems like this fix doesn't work for me (Sierra, safari 10.1.1) :(
Probably magic number(2412) is different under some conditions?

@belartodmarinus
Copy link
Author

@AvaelKross I'm using the same version and it works, maybe you've got a retina display and use hidpi scaling? If you add console.info(a) to line 282 at src/core/fontwatchrunner.js you might find your "magic number" (please share it with us!).

@AvaelKross
Copy link

AvaelKross commented Aug 5, 2017

Looks like '2410' is the magic number for me; retina 15" display. My situation: I'm using webfontloader for a text element on canvas, and on page reload, [?] boxes appear for a second and then replaced with the needed font. But different font size breaks text positioning on canvas (because [?] boxes are usually much wider than the original symbols). This is still an issue for me, BUT: Sometimes boxes weren't replaced with the needed font, and I guess this case should be fixed now with your code. So actually it may help someone.

@mattkahl
Copy link

mattkahl commented Oct 4, 2017

My team has struggled with this quite a bit. It seems to me that some workaround (potentially this one, as it is also working for us) should be accepted into this library (with documented edge cases, or maybe an opt-in implementation). Especially in situations where load state accuracy is very important (e.g. drawing on a Canvas) this is a very problematic bug.

@rdub80
Copy link

rdub80 commented Feb 11, 2018

@bramstein any updates when this is going to be merged?

@dengjeffrey
Copy link

I encountered the same magic number issue when fixing something similar to this in #402. Perhaps the solution in #402 would also be a solution to this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants