Skip to main content
Module

x/font/mod.ts>LoadOptions

🖌 A simple deno module for font rasterization
Latest
interface LoadOptions
import { type LoadOptions } from "https://deno.land/x/font@0.1.3/mod.ts";

Settings for controlling specific font and layout behavior.

Properties

enableOffsetBoundingBox: boolean

The default is true. This offsets glyphs relative to their position in their scaled bounding box. This is required for laying out glyphs correctly, but can be disabled to make some incorrect fonts crisper.

collectionIndex: number

The default is 0. The index of the font to use if parsing a font collection.

scale: number

The default is 40. The scale in px the font geometry is optimized for. Fonts rendered at the scale defined here will be the most optimal in terms of looks and performance. Glyphs rendered smaller than this scale will look the same but perform slightly worse, while glyphs rendered larger than this will looks worse but perform slightly better.