Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update definition of fontBoundingBoxAscent/Descent and emHeightAscent… #5429

Merged
merged 19 commits into from
Jun 29, 2020
Merged
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 19 additions & 7 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -62514,21 +62514,29 @@ try {
<dd>
<p>The distance from the horizontal line indicated by the <code
data-x="dom-context-2d-textBaseline">textBaseline</code> attribute to the top of the highest
bounding rectangle of all the fonts used to render the text, in <span data-x="'px'">CSS
bounding rectangle of the first available font used to render the text, in <span data-x="'px'">CSS
pixels</span>; positive numbers indicating a distance going up from the given baseline.</p>

<p class="note">This value and the next are useful when rendering a background that have to have
a consistent height even if the exact text being rendered changes. The <code
data-x="dom-textmetrics-actualBoundingBoxAscent">actualBoundingBoxAscent</code> attribute (and
its corresponding attribute for the descent) are useful when drawing a bounding box around
specific text.</p>

<p class="note">The Implementations of <code data-x="dom-textmetrics-fontBoundingBoxAscent">fontBoundingBoxAscent</code>
and <code data-x="dom-textmetrics-fontBoundingBoxDescent">fontBoundingBoxDescent</code> are
expected to be equivalent to that of "sTypoAscender" and "sTypoDescender" in
<cite>OpenType Specification</cite> <a href="https://docs.microsoft.com/en-us/typography/opentype/spec/os2">OS/2 table</a>.
If these are not available, implementations returns "ascender" and "descender" in
<a href="https://docs.microsoft.com/en-us/typography/opentype/spec/hhea">hhea table</a>.
<ref spec=OPENTABLE></p>
annevk marked this conversation as resolved.
Show resolved Hide resolved
</dd>

<dt><dfn><code data-x="dom-textmetrics-fontBoundingBoxDescent">fontBoundingBoxDescent</code></dfn> attribute</dt>

<dd><p>The distance from the horizontal line indicated by the <code
data-x="dom-context-2d-textBaseline">textBaseline</code> attribute to the bottom of the lowest
bounding rectangle of all the fonts used to render the text, in <span data-x="'px'">CSS
bounding rectangle of the first available font used to render the text, in <span data-x="'px'">CSS
pixels</span>; positive numbers indicating a distance going down from the given
baseline.</p></dd>

Expand Down Expand Up @@ -62562,7 +62570,7 @@ try {

<dd><p>The distance from the horizontal line indicated by the <code
data-x="dom-context-2d-textBaseline">textBaseline</code> attribute to the highest top of the em
squares in the <span>line box</span>, in <span data-x="'px'">CSS pixels</span>; positive numbers
squares in the <span>inline box</span>, in <span data-x="'px'">CSS pixels</span>; positive numbers
indicating that the given baseline is below the top of that em square (so this value will usually
be positive). Zero if the given baseline is the top of that em square; half the font size if the
given baseline is the middle of that em square.</p></dd>
Expand All @@ -62571,31 +62579,31 @@ try {

<dd><p>The distance from the horizontal line indicated by the <code
data-x="dom-context-2d-textBaseline">textBaseline</code> attribute to the lowest bottom of the em
squares in the <span>line box</span>, in <span data-x="'px'">CSS pixels</span>; positive numbers
squares in the <span>inline box</span>, in <span data-x="'px'">CSS pixels</span>; positive numbers
indicating that the given baseline is above the bottom of that em square. (Zero if the given baseline
is the bottom of that em square.)</p></dd>

<dt><dfn><code data-x="dom-textmetrics-hangingBaseline">hangingBaseline</code></dfn> attribute</dt>

<dd><p>The distance from the horizontal line indicated by the <code
data-x="dom-context-2d-textBaseline">textBaseline</code> attribute to the hanging baseline of the
<span>line box</span>, in <span data-x="'px'">CSS pixels</span>; positive numbers indicating that
<span>inline box</span>, in <span data-x="'px'">CSS pixels</span>; positive numbers indicating that
the given baseline is below the hanging baseline. (Zero if the given baseline is the hanging
baseline.)</p></dd>

<dt><dfn><code data-x="dom-textmetrics-alphabeticBaseline">alphabeticBaseline</code></dfn> attribute</dt>

<dd><p>The distance from the horizontal line indicated by the <code
data-x="dom-context-2d-textBaseline">textBaseline</code> attribute to the alphabetic baseline of
the <span>line box</span>, in <span data-x="'px'">CSS pixels</span>; positive numbers indicating
the <span>inline box</span>, in <span data-x="'px'">CSS pixels</span>; positive numbers indicating
that the given baseline is below the alphabetic baseline. (Zero if the given baseline is the
alphabetic baseline.)</p></dd>

<dt><dfn><code data-x="dom-textmetrics-ideographicBaseline">ideographicBaseline</code></dfn> attribute</dt>

<dd><p>The distance from the horizontal line indicated by the <code
data-x="dom-context-2d-textBaseline">textBaseline</code> attribute to the ideographic baseline of
the <span>line box</span>, in <span data-x="'px'">CSS pixels</span>; positive numbers indicating
the <span>inline box</span>, in <span data-x="'px'">CSS pixels</span>; positive numbers indicating
that the given baseline is below the ideographic baseline. (Zero if the given baseline is the
ideographic baseline.)</p></dd>
</dl>
Expand Down Expand Up @@ -120767,6 +120775,9 @@ INSERT INTERFACES HERE
<dt id="refsOPENSEARCH">[OPENSEARCH]</dt>
<dd><cite><a href="http://www.opensearch.org/Specifications/OpenSearch/1.1#Autodiscovery_in_HTML.2FXHTML">Autodiscovery in HTML/XHTML</a></cite>. In <cite>OpenSearch 1.1 Draft 4</cite>, Section 4.6.2. OpenSearch.org.</dd>

<dt id="refsOPENTABLE">[OPENTABLE]</dt>
<dd>(Non-normativs) <cite><a href="https://docs.microsoft.com/en-us/typography/opentype/spec">OpenType Specification</a></cite>. Microsoft</dd>

<dt id="refsORIGIN">[ORIGIN]</dt>
<dd>(Non-normative) <cite><a href="https://tools.ietf.org/html/rfc6454">The Web Origin Concept</a></cite>, A. Barth. IETF.</dd>

Expand Down Expand Up @@ -122009,6 +122020,7 @@ INSERT INTERFACES HERE
Yay295,
Ye-Kui Wang,
Yehuda Katz,
Yi Xu
annevk marked this conversation as resolved.
Show resolved Hide resolved
Yi-An Huang,
Yngve Nysaeter Pettersen,
Yoav Weiss,
Expand Down