diff --git a/source b/source index 6c33ec31fec..5ece9f986bd 100644 --- a/source +++ b/source @@ -60014,10 +60014,18 @@ interface CanvasPattern { void setTransform(optional DOMMatrix2DInit transform); }; +[Exposed=(Window,Worker)] +dictionary Baselines { + double alphabetic; + double hanging; + double ideographic; +}; + [Exposed=(Window,Worker)] interface TextMetrics { // x-direction readonly attribute double width; // advance width + readonly attribute FrozenArray<double> advances; readonly attribute double actualBoundingBoxLeft; readonly attribute double actualBoundingBoxRight; @@ -60028,9 +60036,7 @@ interface TextMetrics { readonly attribute double actualBoundingBoxDescent; readonly attribute double emHeightAscent; readonly attribute double emHeightDescent; - readonly attribute double hangingBaseline; - readonly attribute double alphabeticBaseline; - readonly attribute double ideographicBaseline; + Baselines getBaselines(); }; [Constructor(unsigned long sw, unsigned long sh), @@ -62953,6 +62959,7 @@ try {
metrics . width
+
metrics . advances
metrics . actualBoundingBoxLeft
metrics . actualBoundingBoxRight
metrics . fontBoundingBoxAscent
@@ -62961,9 +62968,7 @@ try {
metrics . actualBoundingBoxDescent
metrics . emHeightAscent
metrics . emHeightDescent
-
metrics . hangingBaseline
-
metrics . alphabeticBaseline
-
metrics . ideographicBaseline
+
metrics . getBaselines()
@@ -63150,7 +63155,7 @@ v6DVT (also check for '- -' bits in the part above) --> argument, text. When the method is invoked, the user agent must run the text preparation algorithm, passing it text and the object implementing the CanvasText interface, and then using the returned inline box must - create a new TextMetrics object with its attributes set as described in the following + create a new TextMetrics object with members behaving as described in the following list. If doing these measurements requires using a font that has an origin that is not the @@ -63173,6 +63178,13 @@ v6DVT (also check for '- -' bits in the part above) -->

The width of that inline box, in CSS pixels. (The text's advance width.)

+
advances attribute
+ +

Returns a frozen array containing advances for each character in the measured text. Each + advance is measured as the distance from the beginning of the string (starting at 0) up to the + left side of the character. The same frozen array object must be returned every time this + attribute's getter is invoked.

+
actualBoundingBoxLeft attribute
@@ -63270,30 +63282,31 @@ v6DVT (also check for '- -' bits in the part above) --> indicating that the given baseline is below the bottom of that em square (so this value will usually be negative). (Zero if the given baseline is the bottom of that em square.)

-
hangingBaseline attribute
- -

The distance from the horizontal line indicated by the textBaseline attribute to the hanging baseline of the - line box, in CSS pixels; positive numbers indicating that - the given baseline is below the hanging baseline. (Zero if the given baseline is the hanging - baseline.)

+
getBaselines() method
-
alphabeticBaseline attribute
+
+

Returns a Baselines dictionary containing available baselines: -

The distance from the horizontal line indicated by the textBaseline attribute to the alphabetic baseline of - the line box, in CSS pixels; positive numbers indicating - that the given baseline is below the alphabetic baseline. (Zero if the given baseline is the - alphabetic baseline.)

+ +

In all cases, the baslines values are represented as distance from the horizontal line + indicated by the textBaseline attribute to + their respective baseline of the line box, in CSS pixels, with positive numbers indicating that the given baseline is + below the current textBaseline.

+

Glyphs rendered using fillText() and