detect-kerning

WebJar for detect-kerning

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

detect-kerning
Last Version

Last Version

2.1.2
Release Date

Release Date

Type

Type

jar
Description

Description

detect-kerning
WebJar for detect-kerning
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/dy/detect-kerning

Download detect-kerning

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/detect-kerning/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>detect-kerning</artifactId>
    <version>2.1.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/detect-kerning/
implementation 'org.webjars.npm:detect-kerning:2.1.2'
// https://jarcasting.com/artifacts/org.webjars.npm/detect-kerning/
implementation ("org.webjars.npm:detect-kerning:2.1.2")
'org.webjars.npm:detect-kerning:jar:2.1.2'
<dependency org="org.webjars.npm" name="detect-kerning" rev="2.1.2">
  <artifact name="detect-kerning" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='detect-kerning', version='2.1.2')
)
libraryDependencies += "org.webjars.npm" % "detect-kerning" % "2.1.2"
[org.webjars.npm/detect-kerning "2.1.2"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

detect-kerning unstable Build Status

Calculate kerning pairs for a font.

npm install detect-kerning

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.

Related

  • css-font for parsing font-family from css font string.

License

© 2018 Dmitry Yv. MIT License

Versions

Version
2.1.2