Skip to content
pixi-silk
GitHub repository
Interface

RuntimeShaper

import type { RuntimeShaper } from 'pixi-silk/i18n';

A runtime shaper for one font file.

Properties#

PropertyModifierTypeDescriptionDefined in
fontHashreadonlystring64-bit FNV-1a hash of the font file, 16 hex digits, as fontHash computes it.packages/pixi-silk/src/i18n/shaper.ts:25
unitsPerEmreadonlynumberUnits per em of the font.packages/pixi-silk/src/i18n/shaper.ts:27

Methods#

shape()#

shape(text: string, options: {
  direction: "ltr" | "rtl";
  features?: string[];
  language?: string;
  script?: string;
}): ShapedGlyphOut[];

Shapes a run of one direction and script.

Parameters#

ParameterType
textstring
options{ direction: "ltr" | "rtl"; features?: string[]; language?: string; script?: string; }
options.direction"ltr" | "rtl"
options.features?string[]
options.language?string
options.script?string

Returns#

ShapedGlyphOut[]