Skip to content

Commit 2501b7f

Browse files
author
John Daggett
committed
[css3-fonts] updated styling for font load events section
1 parent 29e0ae6 commit 2501b7f

1 file changed

Lines changed: 60 additions & 30 deletions

File tree

css3-fonts/Fonts.html

Lines changed: 60 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
229229
<li><a href="#typography-background"><span class=secno>2 </span>Typography
230230
Background</a>
231231

232-
<li><a href="#basic-font-props"><span class=secno>3 </span>Basic font
233-
properties</a>
232+
<li><a href="#basic-font-props"><span class=secno>3 </span>Basic Font
233+
Properties</a>
234234
<ul class=toc>
235235
<li><a href="#font-family-prop"><span class=secno>3.1 </span>Font
236236
family: the font-family property</a>
@@ -262,7 +262,7 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
262262
</ul>
263263

264264
<li><a href="#font-resources"><span class=secno>4 </span>Font
265-
resources</a>
265+
Resources</a>
266266
<ul class=toc>
267267
<li><a href="#font-face-rule"><span class=secno>4.1 </span>The
268268
@font-face rule</a>
@@ -297,7 +297,7 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
297297
</ul>
298298

299299
<li><a href="#font-matching-algorithm"><span class=secno>5 </span>Font
300-
matching algorithm</a>
300+
Matching Algorithm</a>
301301
<ul class=toc>
302302
<li><a href="#font-style-matching"><span class=secno>5.1 </span>Matching
303303
font styles</a>
@@ -309,8 +309,8 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
309309
matching changes since CSS 2.1</a>
310310
</ul>
311311

312-
<li><a href="#font-rend-props"><span class=secno>6 </span>Font feature
313-
properties</a>
312+
<li><a href="#font-rend-props"><span class=secno>6 </span>Font Feature
313+
Properties</a>
314314
<ul class=toc>
315315
<li><a href="#glyph-selection-positioning"><span class=secno>6.1
316316
</span>Glyph selection and positioning</a>
@@ -357,10 +357,30 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
357357
</ul>
358358

359359
<li><a href="#font-feature-resolution"><span class=secno>7 </span>Font
360-
feature resolution </a>
360+
Feature Resolution </a>
361+
<ul class=toc>
362+
<li><a href="#default-features"><span class=secno>7.1 </span>Default
363+
features</a>
364+
365+
<li><a href="#feature-precedence"><span class=secno>7.2 </span>Feature
366+
precedence</a>
367+
368+
<li><a href="#feature-precedence-examples"><span class=secno>7.3
369+
</span>Feature precedence examples</a>
370+
</ul>
371+
372+
<li><a href="#font-load-events"><span class=secno>8 </span>Font Load
373+
Events</a>
374+
<ul class=toc>
375+
<li><a href="#document-fontloader"><span class=secno>8.1
376+
</span>Extension to the <code>document</code> interface</a>
361377

362-
<li><a href="#font-load-events"><span class=secno>8 </span>Font load
363-
events</a>
378+
<li><a href="#fontloader-interface"><span class=secno>8.2 </span>The
379+
<code>FontLoader</code> Interface</a>
380+
381+
<li><a href="#font-load-event-examples"><span class=secno>8.3
382+
</span>Font load event examples</a>
383+
</ul>
364384

365385
<li class=no-num><a href="#platform-props-to-css">Appendix A: Mapping
366386
platform font properties to CSS properties</a>
@@ -523,7 +543,7 @@ <h2 id=typography-background><span class=secno>2 </span>Typography
523543
see the <a href="#OPENTYPE-FONT-GUIDE"
524544
rel=biblioentry>[OPENTYPE-FONT-GUIDE]<!--{{OPENTYPE-FONT-GUIDE}}--></a>.
525545

526-
<h2 id=basic-font-props><span class=secno>3 </span>Basic font properties</h2>
546+
<h2 id=basic-font-props><span class=secno>3 </span>Basic Font Properties</h2>
527547

528548
<p>The particular font face used to render a character is determined by the
529549
font family and other font properties that apply to a given element. This
@@ -1918,7 +1938,7 @@ <h3 id=font-synthesis-prop><span class=secno>3.8 </span>Controlling
19181938
</pre>
19191939
</div>
19201940

1921-
<h2 id=font-resources><span class=secno>4 </span>Font resources</h2>
1941+
<h2 id=font-resources><span class=secno>4 </span>Font Resources</h2>
19221942

19231943
<h3 id=font-face-rule><span class=secno>4.1 </span>The @font-face rule</h3>
19241944

@@ -2742,8 +2762,8 @@ <h4 id=allowing-cross-origin-font-loading><span class=secno>4.8.2
27422762
cross-site downloading of font data using the
27432763
<code>Access-Control-Allow-Origin</code> HTTP header.
27442764

2745-
<h2 id=font-matching-algorithm><span class=secno>5 </span>Font matching
2746-
algorithm</h2>
2765+
<h2 id=font-matching-algorithm><span class=secno>5 </span>Font Matching
2766+
Algorithm</h2>
27472767

27482768
<p>The algorithm below describes how fonts are associated with individual
27492769
runs of text. For each character in the run a font family is chosen and a
@@ -2965,7 +2985,7 @@ <h3 id=font-matching-changes><span class=secno>5.3 </span>Font matching
29652985
Traditional Chinese - and uses the appropriate font.
29662986
</div>
29672987

2968-
<h2 id=font-rend-props><span class=secno>6 </span>Font feature properties</h2>
2988+
<h2 id=font-rend-props><span class=secno>6 </span>Font Feature Properties</h2>
29692989

29702990
<p>Modern font technologies support a variety of advanced typographic and
29712991
language-specific font features. Using these features, a single font can
@@ -4616,8 +4636,8 @@ <h3 id=font-language-override-prop><span class=secno>6.13 </span>Font
46164636

46174637
<p><a id=rendering-considerations></a>
46184638

4619-
<h2 id=font-feature-resolution><span class=secno>7 </span>Font feature
4620-
resolution</h2>
4639+
<h2 id=font-feature-resolution><span class=secno>7 </span>Font Feature
4640+
Resolution</h2>
46214641

46224642
<p>As described in the previous section, font features can be enabled in a
46234643
variety of ways, either via the use of ‘<a
@@ -4629,6 +4649,8 @@ <h2 id=font-feature-resolution><span class=secno>7 </span>Font feature
46294649
settings is defined below. Features defined via CSS properties are applied
46304650
on top of layout engine default features.
46314651

4652+
<h3 id=default-features><span class=secno>7.1 </span>Default features</h3>
4653+
46324654
<p>For OpenType fonts, user agents must enable the default features defined
46334655
in the OpenType documentation for a given script and writing mode.
46344656
Required ligatures, common ligatures and contextual forms must be enabled
@@ -4657,6 +4679,8 @@ <h2 id=font-feature-resolution><span class=secno>7 </span>Font feature
46574679
runs, vertical alternates (OpenType feature: <span class=tag>vert</span>)
46584680
must be enabled.
46594681

4682+
<h3 id=feature-precedence><span class=secno>7.2 </span>Feature precedence</h3>
4683+
46604684
<p>General and font specific font feature property settings are resolved in
46614685
the order below, in ascending precedence order. This ordering is used to
46624686
construct a combined list of font features that affect a given text run.
@@ -4705,6 +4729,9 @@ <h2 id=font-feature-resolution><span class=secno>7 </span>Font feature
47054729
occur and no attempt is made to synthesize the feature except where
47064730
explicitly noted for specific properties.
47074731

4732+
<h3 id=feature-precedence-examples><span class=secno>7.3 </span>Feature
4733+
precedence examples</h3>
4734+
47084735
<div class=example>
47094736
<p>With the styles below, numbers are rendered proportionally when used
47104737
within a paragraph but are shown in tabular form within tables of prices:</p>
@@ -4808,27 +4835,28 @@ <h2 id=font-feature-resolution><span class=secno>7 </span>Font feature
48084835
discretionary ligatures.</p>
48094836
</div>
48104837

4811-
<h2 id=font-load-events><span class=secno>8 </span>Font load events</h2>
4838+
<h2 id=font-load-events><span class=secno>8 </span>Font Load Events</h2>
48124839

48134840
<p>Since fonts defined via @font-face rules are loaded on demand, pages may
48144841
need to know precisely when fonts have completed downloading before
48154842
measuring text elements on the page or to show some form of interim user
48164843
interface state.
48174844

4818-
<p>To allow font loading to be tracked explicitly within content the
4819-
following event target is added to the document of the page:
4845+
<h3 id=document-fontloader><span class=secno>8.1 </span>Extension to the
4846+
<code>document</code> interface</h3>
48204847

4821-
<dl>
4822-
<dt><b>IDL Definition</b>
4848+
<p>To allow font loading to be tracked explicitly within content the
4849+
following event target is added to the <code>document</code> of the page:
48234850

4824-
<dd>
4825-
<div class=idl-code>
4826-
<pre>
4827-
partial interface Document {
4851+
<pre class=idl>partial interface Document {
48284852
readonly attribute FontLoader fontloader;
48294853
};
4854+
</pre>
48304855

4831-
[Constructor]
4856+
<h3 id=fontloader-interface><span class=secno>8.2 </span>The
4857+
<code>FontLoader</code> Interface</h3>
4858+
4859+
<pre class=idl>[Constructor]
48324860
interface CSSFontFaceLoadEvent : Event {
48334861
readonly attribute CSSFontFaceRule fontface;
48344862
readonly attribute DOMString error;
@@ -4861,10 +4889,7 @@ <h2 id=font-load-events><span class=secno>8 </span>Font load events</h2>
48614889
// "idle" or "loading"
48624890
readonly attribute FontLoaderReadyState readyState;
48634891
};</pre>
4864-
</div>
4865-
</dd>
4866-
<!-- IDL -->
4867-
</dl>
4892+
<!-- IDL -->
48684893

48694894
<p>When layout determines that a font or a set of fonts defined via
48704895
@font-face rules need to be loaded, the readyState switches from the
@@ -4904,6 +4929,9 @@ <h2 id=font-load-events><span class=secno>8 </span>Font load events</h2>
49044929
authors need to explicitly call this method again to have the callback
49054930
called again.
49064931

4932+
<h3 id=font-load-event-examples><span class=secno>8.3 </span>Font load
4933+
event examples</h3>
4934+
49074935
<div class=example>
49084936
<p>To show content only after all font loads complete:</p>
49094937

@@ -5138,6 +5166,8 @@ <h3 class=no-num id=recent-changes> Changes from the <a
51385166
<li>Added ‘<code class=property>auto</code>’ value to ‘<a
51395167
href="#propdef-font-size-adjust"><code
51405168
class=property>font-size-adjust</code></a>
5169+
5170+
<li>Added definition of font load events
51415171
</ul>
51425172

51435173
<h2 class=no-num id=acknowledgments>Acknowledgments</h2>

0 commit comments

Comments
 (0)