Jump to content

PIXI and fontawesome


brean
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...