Generate an icon webfont from SVG files, á la grunt-webfont. No fontforge support.
Configure the package by creating an iconfont.json
file at the project's root and set any of the following properties:
Type: string|array
Default: svgs
List of paths with the SVGs to convert.
Type: string
Default: public/fonts/icons
Path where the generated font files should be created. This sould be inside meteor's public folder.
Type: string
Default: icons
The CSS font-family name. Also used for the the fonts filename (icons.ttf, icons.eot, etc.).
Type: string
Default: /fonts/icons
The prefix for the font-face URLs. This should be the dest
value without public/
.
Type: string
Default: icon-
The prefix for the icons classes. Ex: icon-
arrow-up.
Type: array
Default: [ 'svg', 'ttf', 'eot', 'woff' ]
The types of fonts to generate.
Type: number
Default: 512
The height of the outputed fonts.
Type: string
Default: client
Path where the generated stylesheet should be outputed to.
Type: string
Default: the fontName value plus .css
The filename of the genetated stylesheet.
Type: string
Default: path to a bundled template file
The path to a Lodash template
Type: object
Default: null
An object that defined which files to generate and with what templates. If specified, stylesheetFilename
and stylesheetTemplate
are ignored.
Example for a possible usecase where you want the icons content
value to be specified in a SASS map, and to access those variables in the icons selectors:
{
'_icon-classes.scss': 'private/icons-templatates/classes.tpl',
'_icon-variables.scss': 'private/icons-templatates/variables.tpl'
}
This would create _icon-classes.scss
and _icon-variables.scss
at stylesheetDestBasePath
with the contents of the respective compiled template.
_icon-variables.scss
$icons: (
my-icon '\e001',
my-other-icon '\e002',
);
_icon-classes.scss
.my-icon {
content: map-get($icons, my-icon);
}
.my-other-icon {
content: map-get($icons, my-other-icon);
}
some-file.scss
.thing:after {
font-family: icons;
content: map-get($icons, my-icon);
}
Type: number
Default: 64
The font descent. Usefull to fix the font baseline.
Type: boolean
Default: true
Normalize icons by scaling them to the fontHeight
value.
- Allow generating more that one font
- Output to other stylesheet formats (scss, less, etc.)
- Don't regenerate unless needed
The MIT License, see the included License.txt file.