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 {
width
advances
actualBoundingBoxLeft
actualBoundingBoxRight
fontBoundingBoxAscent
actualBoundingBoxDescent
emHeightAscent
emHeightDescent
hangingBaseline
alphabeticBaseline
ideographicBaseline
getBaselines
()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
attributeReturns 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
attributehangingBaseline
attributeThe 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()
methodalphabeticBaseline
attributeReturns 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.)
If the alphabetic baseline is available for this text, the alphabetic
dictionary member must be set to that
+ baseline value.
ideographicBaseline
attributeIf the hanging baseline is available for this text, the hanging
dictionary member must be set to that
+ baseline value.
The distance from the horizontal line indicated by the textBaseline
attribute to the ideographic baseline of
- the line box, in CSS pixels; positive numbers indicating
- that the given baseline is below the ideographic baseline. (Zero if the given baseline is the
- ideographic baseline.)
If the ideographic baseline is available for this text, the ideographic
dictionary member must be set to
+ that baseline value.
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