TextMetrics Class
The measurements of a text (https://html.spec.whatwg.org/multipage/canvas.html#textmetrics), returned by measureText(): the distances are in CSS px, relative to the alignment point and to the baseline of the text attributes of the context.
public sealed class TextMetricsProperties
| Name | Description |
|---|---|
| ActualBoundingBoxAscent | Gets the distance from the baseline to the top of the bounding box of the glyphs (positive upwards). |
| ActualBoundingBoxDescent | Gets the distance from the baseline to the bottom of the bounding box of the glyphs (positive downwards). |
| ActualBoundingBoxLeft | Gets the distance from the alignment point to the left of the bounding box of the glyphs (positive to the left). |
| ActualBoundingBoxRight | Gets the distance from the alignment point to the right of the bounding box of the glyphs (positive to the right). |
| AlphabeticBaseline | Gets the distance from the baseline to the alphabetic baseline (positive when the baseline is below it). |
| EmHeightAscent | Gets the distance from the baseline to the top of the em square (positive when the baseline is below it). |
| EmHeightDescent | Gets the distance from the baseline to the bottom of the em square (positive when the baseline is above it). |
| FontBoundingBoxAscent | Gets the distance from the baseline to the ascent of the first available font (positive upwards). |
| FontBoundingBoxDescent | Gets the distance from the baseline to the descent of the first available font (positive downwards). |
| HangingBaseline | Gets the distance from the baseline to the hanging baseline (positive when the baseline is below it). |
| IdeographicBaseline | Gets the distance from the baseline to the ideographic-under baseline (positive when the baseline is below it). |
| Width | Gets the advance width of the text. |
ActualBoundingBoxAscent
CanvasRenderingContext2DBase.Text.csGets the distance from the baseline to the top of the bounding box of the glyphs (positive upwards).
public double ActualBoundingBoxAscent { get; }ActualBoundingBoxDescent
CanvasRenderingContext2DBase.Text.csGets the distance from the baseline to the bottom of the bounding box of the glyphs (positive downwards).
public double ActualBoundingBoxDescent { get; }ActualBoundingBoxLeft
CanvasRenderingContext2DBase.Text.csGets the distance from the alignment point to the left of the bounding box of the glyphs (positive to the left).
public double ActualBoundingBoxLeft { get; }ActualBoundingBoxRight
CanvasRenderingContext2DBase.Text.csGets the distance from the alignment point to the right of the bounding box of the glyphs (positive to the right).
public double ActualBoundingBoxRight { get; }AlphabeticBaseline
CanvasRenderingContext2DBase.Text.csGets the distance from the baseline to the alphabetic baseline (positive when the baseline is below it).
public double AlphabeticBaseline { get; }EmHeightAscent
CanvasRenderingContext2DBase.Text.csGets the distance from the baseline to the top of the em square (positive when the baseline is below it).
public double EmHeightAscent { get; }Property value
See also
EmHeightDescent
CanvasRenderingContext2DBase.Text.csGets the distance from the baseline to the bottom of the em square (positive when the baseline is above it).
public double EmHeightDescent { get; }Property value
See also
FontBoundingBoxAscent
CanvasRenderingContext2DBase.Text.csGets the distance from the baseline to the ascent of the first available font (positive upwards).
public double FontBoundingBoxAscent { get; }FontBoundingBoxDescent
CanvasRenderingContext2DBase.Text.csGets the distance from the baseline to the descent of the first available font (positive downwards).
public double FontBoundingBoxDescent { get; }HangingBaseline
CanvasRenderingContext2DBase.Text.csGets the distance from the baseline to the hanging baseline (positive when the baseline is below it).
public double HangingBaseline { get; }Property value
See also
IdeographicBaseline
CanvasRenderingContext2DBase.Text.csGets the distance from the baseline to the ideographic-under baseline (positive when the baseline is below it).
public double IdeographicBaseline { get; }