TextCluster Class
- Experimental (WEBPLATEXP0024)
A cluster of a measured text (https://github.com/whatwg/html/pull/11000), returned by TextMetrics.GetTextClusters: a range of the text (a grapheme cluster, or several when a glyph spans them) and the position of its alignment point relative to the alignment point and to the baseline of the text.
[Experimental("WEBPLATEXP0024", UrlFormat = "https://github.com/meziantou/Meziantou.Framework/blob/main/src/Meziantou.Framework.WebPlatform/docs/experimental-apis.md#{0}")]
public sealed class TextClusterProperties
| Name | Description |
|---|---|
| Align | Gets the alignment the cluster is drawn with. |
| Baseline | Gets the baseline the cluster is drawn with. |
| End | Gets the index (in UTF-16 code units) after the last character of the cluster. |
| Start | Gets the index (in UTF-16 code units) of the first character of the cluster. |
| X | Gets the horizontal distance of the alignment point of the cluster (for TextCluster.Align) from the alignment point of the text. |
| Y | Gets the vertical distance of the baseline of the cluster (for TextCluster.Baseline) below the baseline of the text. |
Gets the alignment the cluster is drawn with.
public CanvasTextAlign Align { get; }Gets the baseline the cluster is drawn with.
public CanvasTextBaseline Baseline { get; }Gets the index (in UTF-16 code units) after the last character of the cluster.
public uint End { get; }Gets the index (in UTF-16 code units) of the first character of the cluster.
public uint Start { get; }Gets the horizontal distance of the alignment point of the cluster (for TextCluster.Align) from the alignment point of the text.
public double X { get; }Gets the vertical distance of the baseline of the cluster (for TextCluster.Baseline) below the baseline of the text.
public double Y { get; }