FontGlyph

Freetype's article on glyph metrics goes in depth about the various metrics.

glyph metrics labeled

We're thinking about a parametric Cuttle version of this image for any font/glyph. 🧐

Constructors

FontGlyph(name,x,advanceWidth,advanceX,geometry)FontGlyph
name
string

The glyph name (e.g. "Aring", "five")

x
number

Distance along path, including advanceWidth and kerning of previous characters.

advanceWidth
number

The width to advance when drawing this glyph. We use this to find the "designed" origin of the glyph. Advance width does not change in response to letter spacing or kerning. For a value that includes these adjustments, see advanceX.

advanceX
number

The amount to move the cursor from the previous cursor position when drawing this glyph. Unlike advanceWidth, this value incorporates things like letter spacing and kerning.

geometry

The geometry associated with the glyph. This is currently always a CompoundPath. Glyph geometry is not pre-transformed, so you'll probably need to translate this by x.

Properties

.namestring

The glyph name (e.g. "Aring", "five")

.xnumber

Distance along path, including advanceWidth and kerning of previous characters.

.advanceWidthnumber

The width to advance when drawing this glyph. We use this to find the "designed" origin of the glyph. Advance width does not change in response to letter spacing or kerning. For a value that includes these adjustments, see advanceX.

.advanceXnumber

The amount to move the cursor from the previous cursor position when drawing this glyph. Unlike advanceWidth, this value incorporates things like letter spacing and kerning.

.geometryGraphic

The geometry associated with the glyph. This is currently always a CompoundPath. Glyph geometry is not pre-transformed, so you'll probably need to translate this by x.

Methods

.clone()FontGlyph

Returns a copy of this glyph.

.isBlank()boolean

Returns true if this glyph contains no geometry. Glyphs for whitespace characters such as spaces typically don't contain any geometry.