Skip to main content
Module

x/font/mod.ts>Metrics

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

Encapsulates all layout information associated with a glyph for a fixed scale.

Properties

xmin: number

Whole pixel offset of the left-most edge of the bitmap. This may be negative to reflect the glyph is positioned to the left of the origin.

ymin: number

Whole pixel offset of the bottom-most edge of the bitmap. This may be negative to refelct the glyph is positioned below the baseline.

width: number

The width of the bitmap in whole pixels.

height: number

The height of the bitmap in whole pixels.

advanceWidth: number

Advance width of the glyph in subpixels. Used in horizontal fonts.

advanceHeight: number

Advance height of the glyph in subpixels. Used in vertical fonts.

The bounding box that contains the glyph's outline at the offsets specified by the font. This is always a smaller box than the bitmap bounds.