CanvasGlyphRun Class

  • Experimental (WEBPLATEXP0025)

A glyph run or a cluster of a CanvasShapedText: a range of the text and its glyphs, positioned relative to the alignment point and to the baseline of the shaped text.

[Experimental("WEBPLATEXP0025", UrlFormat = "https://github.com/meziantou/Meziantou.Framework/blob/main/src/Meziantou.Framework.WebPlatform/docs/experimental-apis.md#{0}")]
public sealed class CanvasGlyphRun

Properties

NameDescription
EndGets the index (in UTF-16 code units) after the last character of the run.
StartGets the index (in UTF-16 code units) of the first character of the run.
WidthGets the advance width of the run.
XGets the horizontal distance of the left of the run from the alignment point of the shaped text.
YGets the vertical distance of the baseline of the run below the baseline of the shaped text (always 0).

Gets the index (in UTF-16 code units) after the last character of the run.

public uint End { get; }

Gets the index (in UTF-16 code units) of the first character of the run.

public uint Start { get; }

Gets the horizontal distance of the left of the run from the alignment point of the shaped text.

public double X { get; }

Gets the vertical distance of the baseline of the run below the baseline of the shaped text (always 0).

public double Y { get; }

Methods

NameDescription
GetTextMetrics()Returns the metrics of the run, as measureText() gives them for its glyphs alone, with the alignment and the baseline of the shaped text.

Returns the metrics of the run, as measureText() gives them for its glyphs alone, with the alignment and the baseline of the shaped text.

public TextMetrics GetTextMetrics()