@awayjs/scene
Version:
AwayJS scene classes
43 lines (42 loc) • 1.94 kB
JavaScript
/**
* The TextLineMetrics class contains information about the text position and
* measurements of a line of text within a text field. All measurements are in
* pixels. Objects of this class are returned by the
* <code>away.entities.TextField.getLineMetrics()</code> method.
*/
var TextLineMetrics = /** @class */ (function () {
/**
* Creates a TextLineMetrics object. The TextLineMetrics object contains
* information about the text metrics of a line of text in a text field.
* Objects of this class are returned by the
* away.entities.TextField.getLineMetrics() method.
*
* @param x The left position of the first character in pixels.
* @param width The width of the text of the selected lines (not
* necessarily the complete text) in pixels.
* @param height The height of the text of the selected lines (not
* necessarily the complete text) in pixels.
* @param ascent The length from the baseline to the top of the line
* height in pixels.
* @param descent The length from the baseline to the bottom depth of
* the line in pixels.
* @param leading The measurement of the vertical distance between the
* lines of text.
*/
function TextLineMetrics(x, width, height, ascent, descent, leading) {
if (x === void 0) { x = 0; }
if (width === void 0) { width = 0; }
if (height === void 0) { height = 0; }
if (ascent === void 0) { ascent = 0; }
if (descent === void 0) { descent = 0; }
if (leading === void 0) { leading = 0; }
this.x = x;
this.width = width;
this.height = height;
this.ascent = ascent;
this.descent = descent;
this.leading = leading;
}
return TextLineMetrics;
}());
export { TextLineMetrics };