Font Registration
Welcome to the Font Registration Guide for aoi.canvas!
In this guide, we will walk you through the process of registering custom fonts in aoi.canvas.
In index.js Way
To register your fonts in index.js, follow these steps:
1. Setup aoi.canvas
If you already setup aoi.canvas in your project, you can skip this step. If not, check out our guide on how to set it up.
2. Use the registerFonts() function.
Once youve set up aoi.canvas in your project, use the registerFonts()
function to register your custom fonts.
Registering a font
To register a single font, specify the path to the font file and, optionally, provide a name for reference.
Registering multiple fonts
You can register multiple fonts by adding a font object to the fonts array or use multiple registerFonts()
functions.
Registering Fonts in a directory
If you don’t want to register every font manually, you can put them into a folder and register them all at once.
In a command way
To register fonts in a command, please head to $registerFont.