Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/skia_canvas/mod.ts>Fonts

Fast HTML Canvas API implementation for Deno using Google Skia
Latest
class Fonts
import { Fonts } from "https://deno.land/x/skia_canvas@0.5.8/mod.ts";

Manage fonts to be used by Skia.

Static Properties

readonly
families: string[]

Get a list of all available font families.

readonly
famliliesCount: number

Get number of font families registered.

readonly
systemFontCount: number

At startup we load the system fonts, this property gives the count of system fonts loaded.

If you want to disable loading system fonts, set the CANVAS_DISABLE_SYSTEM_FONTS environment variable to 1.

Static Methods

register(path: string): void

Register a font either from file or in memory buffer

register(data: Uint8Array, alias?: string): void
registerDir(dir: string): number

Register all fonts in a directory.

setAlias(alias: string, family: string)

Set alias for a font family.