diff --git a/api-reports/2_12.txt b/api-reports/2_12.txt index 840d41a6..8a425162 100644 --- a/api-reports/2_12.txt +++ b/api-reports/2_12.txt @@ -26488,6 +26488,17 @@ TextEventInit[JT] var inputMethod: js.UndefOr[Int] TextEventInit[JT] var locale: js.UndefOr[String] TextEventInit[JT] var scoped: js.UndefOr[Boolean] TextEventInit[JT] var view: js.UndefOr[Window] +TextMetrics[JC] val actualBoundingBoxAscent: Double +TextMetrics[JC] val actualBoundingBoxDescent: Double +TextMetrics[JC] val actualBoundingBoxLeft: Double +TextMetrics[JC] val actualBoundingBoxRight: Double +TextMetrics[JC] val alphabeticBaseline: Double +TextMetrics[JC] val emHeightAscent: Double +TextMetrics[JC] val emHeightDescent: Double +TextMetrics[JC] val fontBoundingBoxAscent: Double +TextMetrics[JC] val fontBoundingBoxDescent: Double +TextMetrics[JC] val hangingBaseline: Double +TextMetrics[JC] val ideographicBaseline: Double TextMetrics[JC] var width: Double TextTrack[JO] var DISABLED: Int TextTrack[JO] var ERROR: Int diff --git a/api-reports/2_13.txt b/api-reports/2_13.txt index 840d41a6..8a425162 100644 --- a/api-reports/2_13.txt +++ b/api-reports/2_13.txt @@ -26488,6 +26488,17 @@ TextEventInit[JT] var inputMethod: js.UndefOr[Int] TextEventInit[JT] var locale: js.UndefOr[String] TextEventInit[JT] var scoped: js.UndefOr[Boolean] TextEventInit[JT] var view: js.UndefOr[Window] +TextMetrics[JC] val actualBoundingBoxAscent: Double +TextMetrics[JC] val actualBoundingBoxDescent: Double +TextMetrics[JC] val actualBoundingBoxLeft: Double +TextMetrics[JC] val actualBoundingBoxRight: Double +TextMetrics[JC] val alphabeticBaseline: Double +TextMetrics[JC] val emHeightAscent: Double +TextMetrics[JC] val emHeightDescent: Double +TextMetrics[JC] val fontBoundingBoxAscent: Double +TextMetrics[JC] val fontBoundingBoxDescent: Double +TextMetrics[JC] val hangingBaseline: Double +TextMetrics[JC] val ideographicBaseline: Double TextMetrics[JC] var width: Double TextTrack[JO] var DISABLED: Int TextTrack[JO] var ERROR: Int diff --git a/dom/src/main/scala/org/scalajs/dom/TextMetrics.scala b/dom/src/main/scala/org/scalajs/dom/TextMetrics.scala index 0f6f6204..44c72396 100644 --- a/dom/src/main/scala/org/scalajs/dom/TextMetrics.scala +++ b/dom/src/main/scala/org/scalajs/dom/TextMetrics.scala @@ -20,4 +20,62 @@ class TextMetrics extends js.Object { * current font of the context. */ var width: Double = js.native + + /** Distance 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, in CSS pixels; positive numbers indicating + * a distance going left from the given alignment point. + */ + val actualBoundingBoxLeft: Double = js.native + + /** Returns the distance from the alignment point given by the CanvasRenderingContext2D.textAlign property to the + * right side of the bounding rectangle of the given text, in CSS pixels. The distance is measured parallel to the + * baseline. + */ + val actualBoundingBoxRight: Double = js.native + + /** Returns the distance from the horizontal line indicated by the CanvasRenderingContext2D.textBaseline attribute to + * the top of the highest bounding rectangle of all the fonts used to render the text, in CSS pixels. + */ + val fontBoundingBoxAscent: Double = js.native + + /** Returns the distance from the horizontal line indicated by the CanvasRenderingContext2D.textBaseline attribute to + * the bottom of the bounding rectangle of all the fonts used to render the text, in CSS pixels. + */ + val fontBoundingBoxDescent: Double = js.native + + /** Returns the distance from the horizontal line indicated by the CanvasRenderingContext2D.textBaseline attribute to + * the top of the bounding rectangle used to render the text, in CSS pixels. + */ + val actualBoundingBoxAscent: Double = js.native + + /** Returns the distance from the horizontal line indicated by the CanvasRenderingContext2D.textBaseline attribute to + * the bottom of the bounding rectangle used to render the text, in CSS pixels. + */ + val actualBoundingBoxDescent: Double = js.native + + /** Returns the distance from the horizontal line indicated by the CanvasRenderingContext2D.textBaseline property to + * the top of the em square in the line box, in CSS pixels. + */ + val emHeightAscent: Double = js.native + + /** Returns the distance from the horizontal line indicated by the CanvasRenderingContext2D.textBaseline property to + * the bottom of the em square in the line box, in CSS pixels. + */ + val emHeightDescent: Double = js.native + + /** Returns the distance from the horizontal line indicated by the CanvasRenderingContext2D.textBaseline property to + * the hanging baseline of the line box, in CSS pixels. + */ + val hangingBaseline: Double = js.native + + /** Returns the distance from the horizontal line indicated by the CanvasRenderingContext2D.textBaseline property to + * the alphabetic baseline of the line box, in CSS pixels. + */ + val alphabeticBaseline: Double = js.native + + /** Returns the distance from the horizontal line indicated by the CanvasRenderingContext2D.textBaseline property to + * the ideographic baseline of the line box, in CSS pixels. + */ + val ideographicBaseline: Double = js.native + }