import { type SkFont } from "https://deno.land/x/canvas@v1.0.0/mod.ts";
See SkFont.h for more on this class.
Methods
Retrieves the bounds for each glyph in glyphs. If paint is not null, its stroking, SkPathEffect, and SkMaskFilter fields are respected. These are returned as flattened rectangles. For each glyph, there will be 4 floats for left, top, right, bottom (relative to 0, 0) for that glyph.
Retrieves the glyph ids for each code point in the provided string. Note that glyph IDs are font-dependent; different fonts may have different ids for the same code point.
Retrieves the advanceX measurements for each glyph. If paint is not null, its stroking, SkPathEffect, and SkMaskFilter fields are respected. One width per glyph is returned in the returned array.
Retrieves the advanceX measurements for each code point in str. [deprecated] Use getGlyphIDs and getGlyphWidths instead.
Retrieves the total advance with the given string. If attempting to shape text to fit into a given width, using getGlyphIDs and getGlyphWidths is probably easier / more efficient.
Requests, but does not require, that edge pixels draw opaque or with partial transparency.
Requests, but does not require, linearly scalable font and glyph metrics.
For outline fonts 'true' means font and glyph metrics should ignore hinting and rounding. Note that some bitmap formats may not be able to scale linearly and will ignore this flag.
Sets the typeface to use with this font. null means to clear the typeface and use the default one.