This is the source for the File-Icons package's custom icon-font.
NOTE: Don't request icon additions here. Please do that at the proper repository.
Currently, IcoMoon is used to generate the icon-font.
To add new icons, repeat the following steps:
- Open IcoMoon's projects panel, and select Import Project.
- Select
icomoon.json
, located in this repo's base directory. - Click the imported project's Load button.
- Press the ☰ icon near the top-right corner. In the menu that opens, click Import to Set.
- Select one or more SVG files.
- Select each imported icon, then press Generate Font.
- Press Download.
- Extract files to the right locations:
Linux/macOS:- Move the downloaded ZIP folder to this repo's base directory.
- Run `make` from command-line.
- Copy `file-icons.svg` and `file-icons.woff2` to repo's `dist` directory.
- Replace `icomoon.json` with extracted `selection.json`.
- Rename `selection.json` to `icomoon.json`.
- Convert spaces in `icomoon.json` to tabs.
If IcoMoon didn't give you a WOFF2 file, just add what you can (with the SVG) and a maintainer will take care of the rest.
Before submitting a pull request, make sure you've followed these steps:
- Always include newly-added SVGs in your fork's
svg
folder. - Fit icons to a square canvas when possible. More info on that here.
- Don't add icons that're already included in one of the existing icon-fonts bundled with the package:
If you're exporting an icon from a graphics program, make sure you've optimised it:
- Outline paths, and delete hidden or unused geometry.
- Leave everything ungrouped. Compound paths are enough.
- Merge duplicate control points. Simplify paths if possible.
- Export with the maximum permitted number of decimal spaces.
- Adobe Illustrator: Use File → Save as…, not Export as…
- Inkscape: Save as "Plain SVG", not "Inkscape SVG"
- Run
make lint
to clean up source code.
macOS already ships with Perl and Make installed. The remaining dependencies can be installed with Homebrew:
brew tap bramstein/webfonttools
brew install bramstein/webfonttools/woff2
WOFF2 is only necessary for users without a paid IcoMoon account.