Skip to main content

Type Alias: P5AsciifyCharacter

P5AsciifyCharacter = object

Defined in: types.ts:280

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

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

The blue component of the character color.


character

character: string

Defined in: types.ts:282

The character represented by this glyph.


g

g: number

Defined in: types.ts:306

The green component of the character color.


r

r: number

Defined in: types.ts:303

The red component of the character color.


unicode

unicode: number

Defined in: types.ts:285

The unicode value of the character.

Methods

getPath()

getPath(x, y, fontSize): object

Defined in: types.ts:294

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