Skip to content

Commit 1fd914f

Browse files
committed
[css-inline] Spec out some metric synthesis rules.
1 parent dfb1beb commit 1fd914f

2 files changed

Lines changed: 90 additions & 13 deletions

File tree

css-inline/Overview.bs

Lines changed: 89 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,28 +1090,105 @@ Interaction with floats</h4>
10901090
Issue: Is this the behavior we want? What if the float is on the same line as the initial letter?
10911091

10921092
<h2 class="no-num" id="baseline-synthesis">
1093-
Appendix A: Synthesizing Baselines</h2>
1093+
Appendix A: Synthesizing Alignment Metrics</h2>
10941094

10951095
<h3 class="no-num" id="baseline-synthesis-fonts">
1096-
A.1: Synthesizing Baselines for Text</h3>
1096+
A.1: Synthesizing Baselines (and Other Font Metrics) for Text</h3>
10971097

1098-
Some fonts may not contain the baseline information necessary to align properly as described above.
1099-
User agents may follow these steps in the absence of a required metric:
1098+
Some fonts might not contain the metrics information necessary
1099+
to align text properly as described in this module.
1100+
User agents may use the following strategies
1101+
in the absence of a required metric:
11001102

1101-
<ol>
1102-
1103-
<li>Measure the font.
1104-
<div class="issue">Describe in more detail.
1105-
Should we document which characters in which scripts are useful,
1106-
such as lowercase "o" to <a href="https://drafts.csswg.org/css-values/#ex">measure x-height</a> or the middle of the minus sign for the mathematical baseline?</div>
1103+
<dl>
11071104

1108-
<li>Use a heuristic for the script.
1105+
<dt>Measure the font
1106+
<dd>
1107+
Metrics may be derived from the glyph shapes.
1108+
For example,
1109+
<ol>
1110+
<li>
1111+
The center of the minus sign (U+2212)
1112+
can be taken as the mathematical baseline.
1113+
1114+
<li>
1115+
The amount by which the lowercase “o”
1116+
descends below the alphabetic baseline
1117+
can be subtracted from its highest point
1118+
to <a href="https://drafts.csswg.org/css-values/#ex">measure the x-height</a>.
1119+
1120+
<li>
1121+
The amount by which the uppercase “O”
1122+
descends below the alphabetic baseline
1123+
can be subtracted from its highest point
1124+
to measure the cap-height.
1125+
1126+
<li>
1127+
The top edge of the below ideograph (U+4E05 “丅”)
1128+
and the bottom edge of the above ideograph (U+4E04 “丄”)
1129+
can be taken as the ideographic character face edges.
1130+
In the horizontal dimension,
1131+
the left and right edges of the nation ideograph (U+56FD “国”)
1132+
or solid ideograph (U+56FA “固”)
1133+
can be used.
1134+
In all cases, the these edges should be measured
1135+
at their intersection with the central baseline in that axis.
1136+
1137+
Issue: Is 国 or 固 more common?
1138+
1139+
<li>
1140+
The top edge of the center of the Hebrew maqaf (U+05B3 “־”)
1141+
can be taken as the Hebrew hanging baseline.
1142+
1143+
<li>
1144+
The top edge of the center of the letter Ka
1145+
can be taken as the hanging baseline.
1146+
Which Ka is used should depend on the <a>content language</a>:
1147+
1148+
<table class="data">
1149+
<thead>
1150+
<tr>
1151+
<th>Language
1152+
<th>Script
1153+
<th>Letter
1154+
<tbody>
1155+
<tr>
1156+
<td>
1157+
<td>Devanagari
1158+
<td>क U+0915 KA
1159+
<tr>
1160+
<td>
1161+
<td>Bengali
1162+
<td>ক U+0995
1163+
<tr>
1164+
<td>
1165+
<td>Gurmukhi
1166+
<td>ਕ U+0A15
1167+
<tr>
1168+
<td>
1169+
<td>Tibetan
1170+
<td>ཀ U+0F40
1171+
</table>
1172+
1173+
Issue: Pick a default.
1174+
1175+
<li>Issue: Add more notes here?
1176+
</ol>
1177+
1178+
Issue: Somebody sanity-check these heuristics please.
1179+
1180+
<dt>Use a heuristic for the script
1181+
<dd>
1182+
Issue: What does this mean?
11091183

1110-
<li>Use fallback values:
1184+
<dt>Use fallback values
1185+
<dd>
1186+
The following fallback values
11111187
<ul>
11121188
<li>x-height: .5em;
11131189
<li>cap-height: .66em;
11141190
<li>hanging baseline: .6em;
1191+
<li>Hebrew hanging baseline: ???
11151192
</ul>
11161193
</ol>
11171194

css-text/Overview.bs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ Languages and Typesetting</h4>
282282
Authors should language-tag their content accurately for the best typographic behavior.
283283
</strong>
284284

285-
<p>The <dfn>content language</dfn> of an element is the (human) language
285+
<p>The <dfn export>content language</dfn> of an element is the (human) language
286286
the element is declared to be in, according to the rules of the
287287
<a href="https://www.w3.org/TR/CSS21/conform.html#doclanguage">document language</a>.
288288
For example, the rules for determining the <a>content language</a> of an HTML

0 commit comments

Comments
 (0)