Fonsta allows you to take and use fonts simply, because it works as a package manager like Bower or npm. The package interacts with Font Squirrel and gets fonts directly from there.
$ npm install -g fonsta
# install dependencies from fonsta.deps.json
$ fonsta install
# install a font with regular style and add it to fonsta.deps.json
$ fonsta install <font> --save
# install a font with specific styles and add it to fonsta.deps.json
$ bower install <font>:<style>,<style>,<style> --save
# install a font without generating css file
$ fonsta install <font> --nocss
Once you have got the font, css file will be generated with @font-face for chosen font. See below how to configure all file paths.
# uninstall a font with all available styles
$ fonsta uninstall <font>
# uninstall a font with specific styles
$ fonsta uninstall <font>:<style>,<style>
$ fonsta show <font>
Fonsta can be configured by a fonsta.config.json
file. For example:
{
"tmpDir": "/tmp/fonts",
"fontsDir": "/assets/fonts",
"cssDir": "/assets/css",
"cssFile": "fonts.css"
}
tmpDir
- temporary directory which stores downloaded fonts (cleaned after installation)
fontsDir
- directory which stores resulting fonts
cssDir
- directory which stores generated css file
cssFile
- name for css file where will be included generated @font-face