
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
You can easily create web-icon-font by creating svg as font.
This module easily converts svg to font files and css. It is a new and updated module that refers to webfonts-generator and provides a variety of additional functions such as css, less, sass, and stylus conversion.
Features:
WOFF2, WOFF, EOT, TTF and SVG.css, sass, less, and stylus.ligatureInstall with npm:
npm install fontagon
Create a file to build svg.
// index.js
const Fontagon = require('fontagon')
Fontagon({
files: [
'path/**/*.svg'
],
dist: 'dist/',
fontName: 'fontagon-icons',
style: 'all',
classOptions: {
baseClass: 'fontagon-icons',
classPrefix: 'ft'
}
}).then((opts) => {
console.log('done! ' ,opts)
}).catch((err) => {
console.log('fail! ', err)
})
Modify package.json's npm script or run a build file generated through the nodejs.
{
"scripts": {
"build:fontagon": "node build/index.js"
}
}
$ npm run build:fontagon
Now use the build output. You only need to insert the style sheet.
<link rel="stylesheet" type="text/css" href="dist/fontagon-icons.css">
import '../dist/fontagon-icons.css'
Fontagon generates svg by class and supports ligature. just put the name of the svg.
<i class="fontagon-icons ft-icon">SVG FILE NAME</i>
<i class="fontagon-icons ft-icon ft-SVG FILE NAME"></i>
The above results are the same.
filesList of SVG files.
Array[]distDirectory for generated font files.
String'dist/'fontNameSpecify a font name and the default name for the font file.
String'fontagon-icons'stylestylesheet file generation type.
String'all''css', 'sass', 'less', 'stylus'styleTemplateSpecify a custom style template.
The '.hbs' extension is required because the custom template is compiled through handlebars.
If the style is 'all', only one pre-processor template is specified in the styleTemplate,
it is merged with the default option and processed.
Object{
"styleTemplate": {
"css": "css.hbs",
"sass": "sass.hbs",
"less": "less.hbs",
"stylus": "styl.hbs"
}
}
classOptionsAdditional options for CSS templates, that extends default options.
When 'baseClass' is set, it is specified by the default class name of the stylesheet,
or 'classPrefix' as a sub class factor of the stylesheet.
Object{
"baseClass": "fontagon-icons",
"classPrefix": "ft"
}
orderOrder of src values in font-face in CSS file.
Array['eot', 'woff2', 'woff', 'ttf', 'svg']renameFunction that takes path of file and return name of icon.
FunctionstartCodepointStarting codepoint. Defaults to beginning of unicode private area.
Number0xF101codepointsSpecific codepoints for certain icons.
Icons without codepoints will have codepoints incremented from startCodepoint skipping duplicates.
Object{}formatOptionsSpecific per format arbitrary options to pass to the generator
object{
"svg": {
"normalize": true,
"fontHeight": 1000
}
}
format and matching generator:
svg - svgicons2svgfont.ttf - svg2ttf.woff2 - ttf2woff2.woff - ttf2woff.eot - ttf2eot.writeFilesIt is possible to not create files and get generated fonts in object to write them to files later.
Also results object will have function generateCss([urls]) where urls is an object with future fonts urls.
BooleantrueMIT License Copyright (c) Dev.DY
FAQs
Easy web icon font generator
We found that fontagon 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

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.