brean Posted March 13, 2015 Share Posted March 13, 2015 Hi, I am aware that I can easily create an icon using fontawesome in pixi:my html:<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"> ...and the javascript: var envelope = new PIXI.Text('\uf003', { fill: '#ffffff', font: '12px fontawesome' }); stage.addChild(envelope);problem with that is that it does not show the icon if the font from the css is not loaded fast enough (reloading with an empty cache does not show the icon). So I thought about preloading the font using Font.js, which should work in general, but there are different fonts for different platforms and I think it is wrong to implement a browser-detection and load the correct font file (just load all files seems even worse). Has anyone experience with fontawesome and pixi on multiple platforms and can give some advice? Quote Link to comment Share on other sites More sharing options...
d13 Posted March 13, 2015 Share Posted March 13, 2015 Font pre-loading is a hole in the HTML5 spec and there doesn't currently exist a perfect solution.Here's the main Stackoverflow topic about this: http://stackoverflow.com/questions/1330825/preloading-font-face-fonts I use Font.js - it's well-tested, works flawlessly and seems to be the best thing we've got until a proper W3C spec comes along. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.