Skip to content

$registerFont

Registers a font.

Usage

$registerFont[src;name?]

Parameters

FieldTypeDescriptionRequired
srcPath | URLThe font source.True
nameStringThe font name.False

Example(s)

Loading a font

$registerFont[./fonts/Arial.ttf;Arial]

Loading fonts from a directory

$registerFont[./fonts]

Raw Info

{
"name": "$registerFont",
"description": "Registers a font.",
"params": [
{
"name": "src",
"description": "The font source.",
"type": "Path | URL",
"required": true
},
{
"name": "name",
"description": "The font name.",
"type": "String",
"required": false
}
],
"usage": "$registerFont[src;name?]",
"example": "### Loading a font\n```aoi\n$registerFont[./fonts/Arial.ttf;Arial]\n```\n\n### Loading fonts from a directory\n```aoi\n$registerFont[./fonts]\n```",
"category": "canvas",
"src": "https://github.com/devlordduck/aoi.canvas/tree/v2/src/functions/canvas/registerFont.ts",
"docs": "https://aoicanvas.vercel.app/functions/registerfont"
}