
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
webfontjson
Advanced tools
Turn a set of web font files into JSON.
You probably want to run in using the associated grunt plugin: https://github.com/ahume/grunt-webfontjson
Sometimes you want more control over when and how web fonts are loaded in to your page. Sometimes you want to cache them in localStorage or indexedDB, decide exactly which point they are applied to the page, etc… That's difficult when you simply download a font file.
The package comes with an executable command, webfontjson
npm install -g webfontjson
webfontjson /path/to/config.json
Everything else is configured in a configuration file. Here's an example:
[{
"filename": "/my-project/json-fonts/MyriadPro.otf.json",
"callback": "fontsLoadedCallback",
"fonts": [
{
"font-family": "WebFont-MyriadPro",
"font-weight": "normal",
"file": "/Library/Fonts/MyriadPro-Regular.otf",
"format": "otf"
},
{
"font-family": "WebFont-MyriadPro",
"font-weight": "bold",
"font-style": "italic",
"file": "/Library/Fonts/MyriadPro-Bold.otf",
"format": "otf"
}
]
}]
The config is an array of files to create. It contains fields for the filename, the name of a callback function to wrap the JSON in, and a list of fonts to include in the file.
Each font in the list can contain the following values for a particular @font-face rule.
font-family (required)format (required)file (required)font-weightfont-stylefont-stretchunicode-rangefont-variantfont-feature-settingsFor each font, the appropriate @font-face rule will be created and wrapped in a JSON wrapper for delivery into a web browser.
FAQs
Convert a set of web fonts to one json file
We found that webfontjson demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.