API

Interface ITextMetrics

Class used to abstract a text measurement

interface ITextMetrics {
    actualBoundingBoxAscent: number;
    actualBoundingBoxDescent: number;
    actualBoundingBoxLeft: number;
    actualBoundingBoxRight: number;
    width: number;
}
Index
actualBoundingBoxAscent: number

distance (in pixels) from the horizontal line indicated by the CanvasRenderingContext2D.textBaseline property to the top side of the bounding rectangle of the given text

actualBoundingBoxDescent: number

distance (in pixels) from the horizontal line indicated by the CanvasRenderingContext2D.textBaseline property to the bottom side of the bounding rectangle of the given text

actualBoundingBoxLeft: number

distance (in pixels) parallel to the baseline from the alignment point given by the CanvasRenderingContext2D.textAlign property to the left side of the bounding rectangle of the given text

actualBoundingBoxRight: number

distance (in pixels) parallel to the baseline from the alignment point given by the CanvasRenderingContext2D.textAlign property to the right side of the bounding rectangle of the given text

width: number

Text width.