Skip to content
Shapemetry

Text

OpenType shaping/outlines. Outlines are untagged segment bags on the wire; convert to PolyCurve2d / Path2d at the TS door.

import { Text } from '@huukhanhnguyen/geometry'

API reference

Text.measure

Text.measure(font_ids: Uint32Array, text: string, size: number): string

Wasm: text_measure

Text.outlines

Text.outlines(font_ids: Uint32Array, text: string, options_json: string): string

Wasm: text_outlines

Text.outlinesClean

Text.outlinesClean(font_ids: Uint32Array, text: string, options_json: string): string

Wasm: text_outlines_clean

Text.shape

Text.shape(font_ids: Uint32Array, text: string, options_json: string): string

Wasm: text_shape

Text.wrapLines

Text.wrapLines(font_ids: Uint32Array, text: string, size: number, max_width: number): string

Wasm: text_wrap_lines

See GEOMETRY_CATALOG.md for catalog ownership.

Last updated: 📖 1 min readEdit on GitHub