Skip to content

WebReflection/font-cawesome

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

font-cawesome

Just A Canvas Remix for IE9 Mobile and Windows Phone 7

example

// if you want to load this only in IE9 Mobile
if(/*@cc_on(/\bIEMobile\b/.test(navigator.userAgent)&&@_jscript_version<10)||@*/false){
  document.addEventListener(
    'DOMContentLoaded',
    function (e) {
      FontCawesome(
        // the local svg file
        'fonts/font-awesome.svg'
      );
    }
  );
}

Above snippet will automatically replace everything with a fa class with it's icon image equivalent.

In order to do specific replacements or arbitrary actions, we can specify a callback too.

document.addEventListener(
  'DOMContentLoaded',
  function (e) {
    FontCawesome(
      'fonts/font-awesome.svg',
      function (glyphs) {
        // glyps is an object
        // with keys such "\uf098"
        // representing objects
        // with a size method
        document.body.appendChild(
          glyps['\uf098'].size(48)
          // optionally a color too
          // '#EEE', 'rgb(10,20,30)'
        );
      }
    );
  }
);

About

Canvas Rendered Font Awesome for IE9 Mobile and WP 7.X

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published