TextMetrics

Result of the Canvas.TextMetrics() function

type TextMetrics struct {
    Ascent float64
    Descent float64
    Left float64
    Right float64
    Width float64
}
Member Type Description
Ascent float64 Distance from the horizontal baseline to the top of the bounding rectangle used to render the text, in pixels
Descent float64 Distance from the horizontal baseline to the bottom of the bounding rectangle used to render the text, in pixels
Left float64 Distance to the left side of the bounding rectangle of the given text, in pixels; positive numbers indicating a distance going left from the given alignment point
Right float64 Distance to the right side of the bounding rectangle of the given text, CSS pixels
Width float64 Calculated width of a segment of inline text in pixels