
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
detect-kerning
Advanced tools
Calculate kerning pairs for a font.
const kerning = require('detect-kerning')
let pairs = kerning('Roboto')
/*
{
'A”': -10,
'W.': -5,
'P,': -3,
...
}
*/
// get px kerning for 16px font-size
let px = 16 * pairs['AV'] / 1000
pairs = kerning(family|familyList, pairs|range|options?)
Detect kerning pairs for the font family or stack of families and return their kerning in 1000 units/em. Optionally pass specific kerning pairs to check, or a unicode range, by default all printable ASCII character pairs are detected from the [32, 126]
range. Alternatively, an options object can define:
options.pairs
- specific pairs to check;options.range
- unicode range to detect pairs from;options.fontSize
- base font size to use for check. Can affect performance, by default 16.options.threshold
- font size (em) ratio to detect kerning, by default 0.05. Values below that number can bloat kerning table size.© 2018 Dmitry Yv. MIT License
FAQs
Calculate kerning table of a font
The npm package detect-kerning receives a total of 196,239 weekly downloads. As such, detect-kerning popularity was classified as popular.
We found that detect-kerning 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
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.