We are using FontCustom to compile a custom webfont using icons from the Streamline Icon Set.
Preview here: https://identity-dev.github.io/streamline/dist/streamline-preview.html
- Copy over the fonts from the
/fonts
directory, and_fontcustom.scss
from the/stylesheets
directory.
Syntax: <i class="sl-iconfilename"></i>
CSS classes for the icons are based off their filename. These are the rules to apply when naming icons.
- Only lowercase letters and hyphens should be used
- Use hyphens for spaces
- Describe the illustration and not the intent. (i.e.
house.svg
vsaddress.svg
)
To add new icons to the set, just clone this repo and install FontCustom.
On Mac (assuming you have Homebrew and Ruby installed):
brew install fontforge ttfautohint
gem install fontcustom
Add the new SVGs to the vectors
directory, making sure the file names follow the rules that are stated above, then run:
fontcustom compile vectors
git tag <tagname> && git push --tags
- If you receive any errors from FontForge while attempting to compile the icons, run:
brew reinstall fontforge python
Lessons learned from our previous webfont.
- Really enforce this naming convention. A mix of capital letters and underscores leads to "ugh, let me pull up the preview page to see what this icon is called" when it should really be "I want that house icon, it's probably just
sl-house
" - This font should be consistent since it is used to enforce our branding. Along the way we all need to be "The Art Director" enforcing the quality of these icons. They need to match and seem they belong to each other. Letting one icon slip leads to, "Well this other new icon fits in with this first icon that is the new style that we're building towards.
- It's okay to adopt a new style, but like we're doing with streamline, it should be all at once or not at all.
- By not following this, you can (and we did) end up with various line weights and a mix of solid vs "knocked-out" icons.
- Wherever you are along the way, if there is discussion of adding a new icon that doesn't match the style of streamline, push back against it.