Skip to content

Commit 718cd94

Browse files
author
John Daggett
committed
added font downloading guidelines
1 parent 886078b commit 718cd94

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

css3-fonts/Fonts.html

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,9 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
285285

286286
<li><a href="#font-rend-desc"><span class=secno>4.6 </span>Font
287287
features: the font-variant and font-feature-settings descriptors</a>
288+
289+
<li><a href="#font-face-loading"><span class=secno>4.7 </span>Font
290+
loading guidelines</a>
288291
</ul>
289292

290293
<li><a href="#font-matching-algorithm"><span class=secno>5 </span>Font
@@ -2622,6 +2625,47 @@ <h3 id=font-rend-desc><span class=secno>4.6 </span>Font features: the <a
26222625
omitted. When multiple font feature descriptors or properties are used,
26232626
the cumulative effect on text rendering is described below.
26242627

2628+
<h3 id=font-face-loading><span class=secno>4.7 </span>Font loading
2629+
guidelines</h3>
2630+
2631+
<p>The @font-face rule is designed to allow lazy loading of fonts, fonts
2632+
are only downloaded when needed for use within a document. A stylesheet
2633+
can include @font-face rules for a library of fonts of which only a select
2634+
set are used; user agents must only download those fonts that are referred
2635+
to within the style rules applicable to a given page. User agents that
2636+
download all fonts defined in @font-face rules without considering whether
2637+
those fonts are in fact used within a page are considered non-conformant.
2638+
In cases where a font might be downloaded in character fallback cases,
2639+
user agents may download a font if it's listed in a font list but is not
2640+
actually used for a given text run.
2641+
2642+
<pre>
2643+
@font-face {
2644+
font-family: GeometricModern;
2645+
src: url(font.ttf);
2646+
}
2647+
2648+
p {
2649+
/* font will be downloaded for pages with p elements */
2650+
font-family: GeometricModern, sans-serif;
2651+
}
2652+
2653+
h2 {
2654+
/* font may be downloaded for pages with h2 elements, even if Futura is available locally */
2655+
font-family: Futura, GeometricModern, sans-serif;
2656+
}
2657+
</pre>
2658+
2659+
<p>In cases where textual content is loaded before downloadable fonts are
2660+
available, user agents may render text as it would be rendered if
2661+
downloadable font resources are not available or they may render text
2662+
transparently with fallback fonts to avoid a flash of text using a
2663+
fallback font. In cases where the font download fails user agents must
2664+
display text, simply leaving transparent text is considered non-conformant
2665+
behavior. Authors are advised to use fallback fonts in their font lists
2666+
that closely match the vertical metrics of the downloadable fonts to avoid
2667+
large page reflows where possible.
2668+
26252669
<h2 id=font-matching-algorithm><span class=secno>5 </span>Font matching
26262670
algorithm</h2>
26272671

0 commit comments

Comments
 (0)