Skip to main content
Module

x/skia_canvas/mod.ts>Fonts

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

Manage fonts to be used by Skia.

Static Properties

readonly
families

Get a list of all available font families.

readonly
famliliesCount

Get number of font families registered.

readonly
systemFontCount

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)

Register all fonts in a directory.

setAlias(alias: string, family: string)

Set alias for a font family.