The OpenD Programming Language

TextMetrics

The TextMetrics interface represents the dimensions of a piece of text, as created by the measureText() method. Reference: https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics

Members

Variables

actualBoundingBoxLeft
float actualBoundingBoxLeft;

The distance parallel to the baseline from the alignment point given by TextAlign attribute to the left side of the bounding rectangle of the given text. Positive numbers indicating a distance going left from the given alignment point. TODO: currently imprecise.

actualBoundingBoxRight
float actualBoundingBoxRight;

The distance parallel to the baseline from the alignment point given by TextAlign attribute to the right side of the bounding rectangle of the given text. Positive numbers indicating a distance going right from the given alignment point. TODO: currently can't be relied upon.

actualBoundingBoxWidth
float actualBoundingBoxWidth;

Distance between left side and right side of the given text. TODO: currently can't be relied upon.

fontBoundingBoxAscent
float fontBoundingBoxAscent;

The distance from the horizontal line indicated by the textBaseline attribute to the ascent metric of the font. Positive numbers indicating a distance going up from the given baseline. Note: doesn't depend upon specific input text in measureText.

fontBoundingBoxDescent
float fontBoundingBoxDescent;

The distance from the horizontal line indicated by the textBaseline attribute to the descent metric of the font. Positive numbers indicating a distance going down from the given baseline. Note: doesn't depend upon specific input text in measureText.

fontBoundingBoxHeight
float fontBoundingBoxHeight;

Distance between ascent and descent baselines in the font. Note: doesn't depend upon specific input text in measureText.

lineGap
float lineGap;

Suggested offset to the next line, baseline to baseline. Note: doesn't depend upon specific input text in measureText.

width
float width;

Suggested horizontal advance to the next block of text. This is the so-called "text's advance width".

Meta