@@ -428,6 +428,18 @@ Baselines and Metrics</h3>
428
428
<dd>
429
429
Corresponds to the metric used as the [=line-under=] edge
430
430
of an [=inline box|inline=] ’s [=content box=] per [[CSS2]] .
431
+
432
+ <dt> <dfn lt="em-over baseline" local-lt="em-over">em-over</dfn>
433
+ <dd>
434
+ Corresponds to a conceptual [=ascent=] normalized
435
+ to ensure 1em between [=em-over=] and [=em-under=] .
436
+ See [[#baseline-synthesis-em]] .
437
+
438
+ <dt> <dfn lt="em-under baseline" local-lt="em-under">em-under</dfn>
439
+ <dd>
440
+ Corresponds to a conceptual [=descent=] normalized
441
+ to ensure 1em between [=em-over=] and [=em-under=] .
442
+ See [[#baseline-synthesis-em]] .
431
443
</dl>
432
444
433
445
Note: These metrics are optical design metrics,
@@ -2655,8 +2667,37 @@ Interaction with Fragmentation (Pagination)</h4>
2655
2667
<h2 class="no-num" id="baseline-synthesis">
2656
2668
Appendix A: Synthesizing Alignment Metrics</h2>
2657
2669
2658
- <h3 class="no-num" id="baseline-synthesis-fonts">
2659
- A.1: Synthesizing Baselines (and Other Font Metrics) for Text</h3>
2670
+ <h3 class="no-num" id="baseline-synthesis-em">
2671
+ A.1: Calculating [=Em-over=] and [=Em-under=]</h3>
2672
+
2673
+ Note: The [=em-over=] and [=em-under=] baselines are not used by CSS.
2674
+ Their definitions are included in this module
2675
+ for consistency with the other metrics used by
2676
+ <a href="https://html.spec.whatwg.org/multipage/canvas.html#2dcontext">Canvas 2D API</a> .
2677
+
2678
+ The [=em-over=] and [=em-under=] metrics are calculated as follows:
2679
+
2680
+ * If any one of
2681
+ [=central=] , [=ideographic-over=] , or [=ideographic-under=]
2682
+ is defined by the font,
2683
+ then [=em-over=] is 0.5em over the [=central=] baseline,
2684
+ and [=em-under=] is 0.5em under it,
2685
+ with the [=central=] baseline derived from the others
2686
+ if missing or undefined
2687
+ (see below).
2688
+
2689
+ * Otherwise, the [=ascent=] and [=descent=]
2690
+ are both proportionally augmented or reduced
2691
+ to add up to exactly 1em,
2692
+ and these normalized metrics are taken
2693
+ as the [=em-over=] and [=em-under=] metrics, respectively.
2694
+
2695
+ Note: This calculation ensures that [=em-over=] and [=em-under=]
2696
+ are always exactly 1em apart
2697
+ while trying to center the glyph outlines’ “center of gravity” between them.
2698
+
2699
+ <h3 class="no-num" id="baseline-synthesis-fonts">
2700
+ A.2: Synthesizing Baselines (and Other Font Metrics) for Text</h3>
2660
2701
2661
2702
Some fonts might not contain the metrics information necessary
2662
2703
to align text properly as described in this module.
@@ -2681,7 +2722,7 @@ Appendix A: Synthesizing Alignment Metrics</h2>
2681
2722
The [=ideographic-over=] and [=ideographic-under=] baselines
2682
2723
are typically ''1em'' apart,
2683
2724
so if only one of the
2684
- [=ideographic-over=] /[=ideographic-under=] /[=ideograph- central=]
2725
+ [=ideographic-over=] /[=ideographic-under=] /[=central=]
2685
2726
baselines are provided,
2686
2727
this relation can be used to calculate the other two.
2687
2728
<li>
@@ -2781,10 +2822,10 @@ Appendix A: Synthesizing Alignment Metrics</h2>
2781
2822
<li> cap-height: .66em;
2782
2823
<li> hanging baseline: .6em;
2783
2824
</ul>
2784
- </ol >
2825
+ </dl >
2785
2826
2786
2827
<h3 class="no-num" id="baseline-synthesis-box">
2787
- A.2 : Synthesizing Baselines for Atomic Inlines</h3>
2828
+ A.3 : Synthesizing Baselines for Atomic Inlines</h3>
2788
2829
2789
2830
If an [=atomic inline=]
2790
2831
(such as an inline-block, inline-table, or [=replaced element=] )
0 commit comments