Skip to main content
Module

x/canvas/mod.ts>GlyphRun

Canvas API for Deno, ported from canvaskit-wasm (Skia).
Latest
interface GlyphRun
import { type GlyphRun } from "https://deno.land/x/canvas@v1.4.1/mod.ts";

Information for a run of shaped text. See Paragraph.getShapedLines()

Notes: positions is documented as Float32, but it holds twice as many as you expect, and they are treated logically as pairs of floats: {x0, y0}, {x1, y1}, ... for each glyph.

positions and offsets arrays have 1 extra slot (actually 2 for positions) to describe the location "after" the last glyph in the glyphs array.

Properties

typeface: Typeface
size: number
fakeBold: boolean
fakeItalic: boolean
glyphs: Uint16Array
positions: Float32Array
offsets: Uint32Array
flags: number