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

PxFontLoader #11

Open
paulirish opened this issue May 20, 2012 · 5 comments
Open

PxFontLoader #11

paulirish opened this issue May 20, 2012 · 5 comments

Comments

@paulirish
Copy link

Fonts load asynchronously and there is no load event at all. This always bites developers making canvas games that want custom fonts.

(Fwiw, in Mozilla, the window load event waits for fonts, but not in Webkit)

@joelfillmore
Copy link
Member

Thanks Paul, this is a great idea!

Font.js looks awesome and should be easy to plug into PxLoader.

I'll try to get the wrapper done in the next day or so.

@Studio-Hunto
Copy link

This would be very usefull. Did you look into this Joel?

@joelfillmore
Copy link
Member

Yes, I wrote the wrapper but was having problems getting consistent load events. I won't have time to work on it for a few weeks but will try to find the code and put it in a branch in case someone else wants to take a look.

@joelfillmore
Copy link
Member

@Studio-Hunto - I've pushed the PxLoaderFont wrapper into the fonts branch:
https://github.com/thinkpixellab/PxLoader/tree/fonts

I wasn't able to repro the issues with the load events, but they were only sporadic when I saw them earlier. They seemed to occur more frequently in some browsers and especially when starting from an empty cache. I'd like to spend a little more time with the code before pushing it to master.

If you'd like to play with the code there is a demo in the /tests/fonts directory which shows how to use the plugin. It preloads 4 fonts before using them to draw on a canvas.

@Studio-Hunto
Copy link

Thanks Joel, ill try and see if I can help.

2012/7/16 Joel Fillmore <
reply@reply.github.com

@Studio-Hunto - I've pushed the PxLoaderFont wrapper into the fonts branch:
https://github.com/thinkpixellab/PxLoader/tree/fonts

I wasn't able to repro the issues with the load events, but they were only
sporadic when I saw them earlier. They seemed to occur more frequently in
some browsers and especially when starting from an empty cache. I'd like to
spend a little more time with the code before pushing it to master.

If you'd like to play with the code there is a demo in the /tests/fonts
directory which shows how to use the plugin. It preloads 4 fonts before
using them to draw on a canvas.


Reply to this email directly or view it on GitHub:
#11 (comment)

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

No branches or pull requests

3 participants