By default, assets are loaded in parallel before q5 runs draw. Use await to wait for a font to load.
Fonts in MSDF format
with the file ending "-msdf.json" can be used for high performance text rendering. Make your own using the MSDF font converter.
If no fonts are loaded, q5 WebGPU will lazy load the default MSDF font from q5js.org. Until it is loaded, the system's default sans-serif font will be used via textImage.
📘 Loads a font from a URL.
The first example below loads Robotica.
The second example loads Pacifico from Google fonts.
By default, assets are loaded in parallel before q5 runs
draw. Useawaitto wait for a font to load.Fonts in MSDF format with the file ending "-msdf.json" can be used for high performance text rendering. Make your own using the MSDF font converter.
If no fonts are loaded, q5 WebGPU will lazy load the default MSDF font from q5js.org. Until it is loaded, the system's default sans-serif font will be used via
textImage.