facer
facer is a browser utility that takes a list of font files and returns @font-face declarations for said fonts.
Install
npm install facer
…or just copy index.js
into your project’s directory.
API
facer(
files (array-like):
an array or array-like object of File objects.
callback (function):
called after all files have been processed.
the first argument is an error, the second
is an Object whose keys are font-family
names and whose values are @font-face
declarations.
)
Examples
browserify
Usingvar facer =var input = documentinput {}
<script src="index.js"></script>
Using var input = documentinput {}