
Security News
Node.js Drops Bug Bounty Rewards After Funding Dries Up
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.
fontconvert-tool
Advanced tools
Helps to convert normal font into WebFont.
This plugin requires FontForge. ttfautohint is optional(turn it off in config, see below). Tested on ttfautohint version 1.5.
brew install ttfautohint fontforge --with-python
npm install fontconvert-tool --save-dev
sudo apt-get install fontforge ttfautohint
npm install fontconvert-tool --save-dev
npm install fontconvert-tool --save-dev
Then install ttfautohint (optional).
Then install fontforge.
C:\Program Files (x86)\FontForgeBuilds\bin to your PATH environment variable or specify executablevar fontconvert = require('fontconvert-tool')
fontconvert.convertFonts('./fonts-source', './fonts-out')
var fontconvert = require('fontconvert-tool')
fontconvert.convertFonts('./fonts-source', './fonts-out', {
subset: [
'Basic Latin', 'Latin-1 Supplement', // Latin
'Cyrillic Russian', // Cyrillic
'General Punctuation', 'Currency Symbols' // Punctuation
]
})
Returns a promise.
Type: array
Default: []
Array list of out font subsets. See supported unicode ranges patterns.
[
'Basic Latin', 'Latin-1 Supplement', // Latin
'Cyrillic Russian', // Cyrillic
'General Punctuation', 'Currency Symbols' // Punctuation
]
Type: array
Default: ['ttf', 'eot', 'woff', 'woff2'].
svg-fonts not supported.
Type: boolean
Default: true
Use ttfautohint util to hint fonts.
Type: string
Default: latn
Type: array
Default: []
You can specify ttfautohint arguments
Type: boolean
Default: true
Use ttf2woff2 native addon. Set it false for using pure js converter in trouble case.
Type: function(fontFileName, fontFamily, config)
You can specify name of out file name by passing filter function
function (fileName) {
return 'prefix-' + fileName
}
Type: function(fontDestDir, fontDestBaseDir, fontDestName, fontFamily, config)
You can specify name of fonts out dir by passing filter function.
function (dirName) {
return path.join('subdir', dirName)
}
If you are using OS X or Linux usually you don't need to specify any paths if FontForge and ttfautohint installed normally. On Windows you probably have to set paths manually(at least for FontForge).
var fontconvert = require('fontconvert-tool')
fontconvert.fontForgeBin = 'fontforge'
fontconvert.ttfautohintBin = 'ttfautohint' // example: 'C:\Program Files (x86)\FontForgeBuilds\bin\fontforge.exe'
If you are using task manager like gulp you can specify logging function for pretty out log:
var fontconvert = require('fontconvert-tool'),
gutil = require('gutil')
fontconvert.log = gutil.log.bind(gutil)
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Alex Batalov
Copyright © 2015 Alex Batalov Licensed under the MIT license.
FAQs
WebFonts generation tool
We found that fontconvert-tool 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
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.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.