Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Web Fonts FTW

James Ford
February 05, 2015

Web Fonts FTW

Making web fonts with Grunt

James Ford

February 05, 2015
Tweet

More Decks by James Ford

Other Decks in Programming

Transcript

  1. How can we display icons in HTML? • Individual images

    (e.g. 16x16 .gif) • Spritesheets • Web fonts
  2. How can we display icons in HTML? • Individual images

    (e.g. 16x16 .gif) • Spritesheets • Web fonts
  3. Bonus bits • Change size • Change colour • Add

    drop shadows • and much, much more
  4. Spritesheets: • Minimise the number of HTTP Requests • Reduces

    the overhead/payload ratio • Faster page loads
  5. Fonts • [Manual] creation and maintenance is a skilled process

    • Requires specialist software • Integration with HTML requires management of unicode character assignment(s)
  6. How it works for ActiveTeach • Directory of individual SVG

    icons • Grunt build process with grunt-webfont and grunt-sass tasks • Grunt task generates .eot, .ttf, .woff, .svg and .sass files • Insert HTML tags to display icons
  7. Grunt-webfont task • Includes all SVG files in specified directory

    • Generates .eot, .ttf, .woff .svg and .sass files
  8. Integration • Universal task - works on all Platforms •

    Part of our CI Build Process • Generated SASS files are @imported to the overall project SASS file • Used alongside Font Awesome, and is only responsible for our custom icons