Skip to main content

Type Alias: P5AsciifyCharacter

P5AsciifyCharacter = object

Defined in: types.ts:180

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:204

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


b

b: number

Defined in: types.ts:213

The blue component of the character color.


character

character: string

Defined in: types.ts:182

The character represented by this glyph.


g

g: number

Defined in: types.ts:210

The green component of the character color.


r

r: number

Defined in: types.ts:207

The red component of the character color.


unicode

unicode: number

Defined in: types.ts:185

The unicode value of the character.

Methods

getPath()

getPath(x, y, fontSize): object

Defined in: types.ts:198

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

This method comes from the opentype.js library, which is used by p5.js through the p5.Font object throughout the v1.X.X versions p5.asciify is compatible with.

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:199
toSVG()() => stringtypes.ts:200