1.0.3 • Published 1 year ago

font-facer v1.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

CSS-Font-Facer

Tool to generate css-font-face rules from a folder structure.

Usage

Install the package globally.

npm install -g font-facer

Run the tool from the root of your web project

font-facer -n fonts.css -f FontName ./path/to/yourfont

The tool generates the file 'font.css' with all font-faces for the font files inside the target folder.

Parameters

shortlongdescriptiondefaultrequired
-f--font-nameSet the name of font in the output file. Default is the name of the source directory. '_' are reokaced by ' '.Name of source directory.
-o--overrideCan be set to replace the target file.'${font-dir-name}.css'
-s--sourceRelative path to the font directory. Can be used without any parameter as last argument.-*
-t--targetRelative path to the css file. By default that file is appended to. It is created if it doesn't exist.-*
-v--verboseVerbose outputs for debugging purposes.false

Limitations

The package checks the filename for the name of the font-weights (e.g. light, bold, black, ...) as well as for the keyword 'italic'. If that information isn't in the fontname, the tool won't work as expected.