Skip to main content
Deno 2 is finally here 🎉️
Learn more
Latest
interface SkTextBlobFactory
import { type SkTextBlobFactory } from "https://deno.land/x/canvaseno@v1.0.2/types.ts";

See SkTextBlob.h for more details.

Methods

MakeFromGlyphs(glyphs: InputGlyphIDArray, font: SkFont): SkTextBlob

Return a TextBlob with a single run of text.

It does not perform typeface fallback for characters not found in the SkTypeface. It does not perform kerning or other complex shaping; glyphs are positioned based on their default advances.

MakeFromRSXform(
str: string,
font: SkFont,
): SkTextBlob

Returns a TextBlob built from a single run of text with rotation, scale, and translations.

It uses the default character-to-glyph mapping from the typeface in the font.

MakeFromRSXformGlyphs(): SkTextBlob

Returns a TextBlob built from a single run of text with rotation, scale, and translations.

MakeFromText(str: string, font: SkFont): SkTextBlob

Return a TextBlob with a single run of text.

It uses the default character-to-glyph mapping from the typeface in the font. It does not perform typeface fallback for characters not found in the SkTypeface. It does not perform kerning or other complex shaping; glyphs are positioned based on their default advances.

MakeOnPath(
str: string,
path: SkPath,
font: SkFont,
initialOffset?: number,
): SkTextBlob

Returns a TextBlob that has the glyphs following the contours of the given path.

It is a convenience wrapper around MakeFromRSXform and SkContourMeasureIter.