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
Parameter | Type | Description |
---|---|---|
x | number | The horizontal position to place the character |
y | number | The vertical position to place the character |
fontSize | number | The 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
Name | Type | Defined in |
---|---|---|
getBoundingBox() | () => object | types.ts:199 |
toSVG() | () => string | types.ts:200 |