Skip to main content

Type Alias: P5AsciifyCharacter

P5AsciifyCharacter = object

Defined in: types.ts:282

Each character from a loaded font is represented as a P5AsciifyCharacter object.

To receive the list of characters from a loaded font, use the P5AsciifyFontManager class.

Properties​

advanceWidth​

advanceWidth: number

Defined in: types.ts:302

The advance width of the character. Only relevant for SVG export. To be removed in the future hopefully.


character​

character: string

Defined in: types.ts:284

The character represented by this glyph.


color​

color: p5.Color

Defined in: types.ts:304


unicode​

unicode: number

Defined in: types.ts:287

The unicode value of the character.

Methods​

getPath()​

getPath(x, y, fontSize): object

Defined in: types.ts:296

Gets the outline path of this character positioned at specified coordinates.

Parameters​

ParameterTypeDescription
xnumberThe horizontal position to place the character
ynumberThe vertical position to place the character
fontSizenumberThe font size to scale the glyph to (in pixels)

Returns​

object

An object with methods to get the bounding box and SVG representation of the character

NameTypeDefined in
getBoundingBox()() => objecttypes.ts:297
toSVG()() => stringtypes.ts:298