Skip to content

Commit 183f97b

Browse files
committed
[css-font-loading] Fill in intro.
1 parent 6d70a94 commit 183f97b

2 files changed

Lines changed: 39 additions & 12 deletions

File tree

css-font-loading/Overview.bs

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,26 @@ Editor: Tab Atkins Jr., Google, http://xanthir.com/contact/
1010
Former Editor: John Daggett, Mozilla, jdaggett@mozilla.com
1111
Abstract: This CSS module describes events and interfaces used for dynamically loading font resources.
1212
Link Defaults: css-fonts-3 (descriptor) src
13-
Ignored Terms: promise, domstring, eventinit, cssfontfacerule, event, eventtarget, workerglobalscope
13+
Ignored Terms: promise, domstring, eventinit, cssfontfacerule, eventtarget, workerglobalscope, document
1414
</pre>
1515

1616
<h2 id="introduction">
1717
Introduction</h2>
1818

19-
<p class='issue'>
20-
Fill in intro.
19+
CSS allows authors to load custom fonts from the web via the ''@font-face'' rule.
20+
While this is easy to use when authoring a stylesheet,
21+
it's much more difficult to use dynamically via scripting.
22+
23+
Further, CSS allows the user agent to choose when to actually load a font;
24+
if a font face isn't <em>currently</em> used by anything on a page,
25+
most user agents will not download its associated file.
26+
This means that later use of the font face will incur a delay
27+
as the user agent finally notices a usage and begins downloading and parsing the font file.
28+
29+
This specification defines a scripting interface to font faces in CSS,
30+
allowing font faces to be easily created and loaded from script.
31+
It also provides methods to track the loading status of an individual font,
32+
or of all the fonts on an entire page.
2133

2234
<h2 id="fontface-interface">
2335
The <code>FontFace</code> Interface</h2>
@@ -251,7 +263,8 @@ Interaction with CSS’s ''@font-face'' Rule</h3>
251263
This <a interface>FontFace</a> object is <dfn>CSS-connected</dfn>.
252264

253265
The <a interface>FontFace</a> object corresponding to a ''@font-face'' rule
254-
has its <a attribute>family</a>, <a attribute>style</a>, <a attribute>weight</a>, <a attribute>stretch</a>, <a attribute>unicodeRange</a>, <a attribute>variant</a>, and <a attribute>featureSettings</a> attributes set to the same value as the corresponding descriptors in the ''@font-face'' rule.
266+
has its <a attribute>family</a>, <a attribute>style</a>, <a attribute>weight</a>, <a attribute>stretch</a>, <a attribute>unicodeRange</a>, <a attribute>variant</a>, and <a attribute>featureSettings</a> attributes
267+
set to the same value as the corresponding descriptors in the ''@font-face'' rule.
255268
There is a two-way connection between the two:
256269
any change made to a ''@font-face'' descriptor is immediately reflected in the corresponding <a interface>FontFace</a> attribute,
257270
and vice versa.
@@ -261,7 +274,9 @@ Interaction with CSS’s ''@font-face'' Rule</h3>
261274

262275
Otherwise, a <a interface>FontFace</a> object created by a CSS ''@font-face'' rule is identical to one created manually.
263276

264-
If a ''@font-face'' rule is removed from the document, its corresponding <a interface>FontFace</a> object is no longer <a>CSS-connected</a>. The connection is not restorable by any means (but adding the ''@font-face'' back to the stylesheet will create a brand new <a interface>FontFace</a> object which <em>is</em> <a>CSS-connected</a>).
277+
If a ''@font-face'' rule is removed from the document, its corresponding <a interface>FontFace</a> object is no longer <a>CSS-connected</a>.
278+
The connection is not restorable by any means
279+
(but adding the ''@font-face'' back to the stylesheet will create a brand new <a interface>FontFace</a> object which <em>is</em> <a>CSS-connected</a>).
265280

266281

267282

css-font-loading/Overview.html

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,20 @@ <h2 class="no-num no-toc no-ref heading settled heading" id=contents><span class
143143
<h2 class="heading settled heading" data-level=1 id=introduction><span class=secno>1 </span><span class=content>
144144
Introduction</span><a class=self-link href=#introduction></a></h2>
145145

146-
<p class=issue id=issue-06b29672><a class=self-link href=#issue-06b29672></a>
147-
Fill in intro.
146+
<p> CSS allows authors to load custom fonts from the web via the <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-fonts-3/#at-font-face-rule title=@font-face>@font-face</a> rule.
147+
While this is easy to use when authoring a stylesheet,
148+
it’s much more difficult to use dynamically via scripting.
149+
150+
<p> Further, CSS allows the user agent to choose when to actually load a font;
151+
if a font face isn’t <em>currently</em> used by anything on a page,
152+
most user agents will not download its associated file.
153+
This means that later use of the font face will incur a delay
154+
as the user agent finally notices a usage and begins downloading and parsing the font file.
155+
156+
<p> This specification defines a scripting interface to font faces in CSS,
157+
allowing font faces to be easily created and loaded from script.
158+
It also provides methods to track the loading status of an individual font,
159+
or of all the fonts on an entire page.
148160

149161
<h2 class="heading settled heading" data-level=2 id=fontface-interface><span class=secno>2 </span><span class=content>
150162
The <code>FontFace</code> Interface</span><a class=self-link href=#fontface-interface></a></h2>
@@ -376,7 +388,8 @@ <h3 class="heading settled heading" data-level=2.4 id=font-face-css-connection><
376388
This <a class=idl-code data-link-type=interface href=http://dev.w3.org/csswg/css-font-load-events-3/#dom-fontface title=fontface>FontFace</a> object is <dfn data-dfn-type=dfn data-noexport="" id=css-connected>CSS-connected<a class=self-link href=#css-connected></a></dfn>.
377389

378390
<p> The <a class=idl-code data-link-type=interface href=http://dev.w3.org/csswg/css-font-load-events-3/#dom-fontface title=fontface>FontFace</a> object corresponding to a <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-fonts-3/#at-font-face-rule title=@font-face>@font-face</a> rule
379-
has its <a class=idl-code data-link-type=attribute href=#dom-fontface-family title=family>family</a>, <a class=idl-code data-link-type=attribute href=#dom-fontface-style title=style>style</a>, <a class=idl-code data-link-type=attribute href=#dom-fontface-weight title=weight>weight</a>, <a class=idl-code data-link-type=attribute href=#dom-fontface-stretch title=stretch>stretch</a>, <a class=idl-code data-link-type=attribute href=#dom-fontface-unicoderange title=unicoderange>unicodeRange</a>, <a class=idl-code data-link-type=attribute href=#dom-fontface-variant title=variant>variant</a>, and <a class=idl-code data-link-type=attribute href=#dom-fontface-featuresettings title=featuresettings>featureSettings</a> attributes set to the same value as the corresponding descriptors in the <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-fonts-3/#at-font-face-rule title=@font-face>@font-face</a> rule.
391+
has its <a class=idl-code data-link-type=attribute href=#dom-fontface-family title=family>family</a>, <a class=idl-code data-link-type=attribute href=#dom-fontface-style title=style>style</a>, <a class=idl-code data-link-type=attribute href=#dom-fontface-weight title=weight>weight</a>, <a class=idl-code data-link-type=attribute href=#dom-fontface-stretch title=stretch>stretch</a>, <a class=idl-code data-link-type=attribute href=#dom-fontface-unicoderange title=unicoderange>unicodeRange</a>, <a class=idl-code data-link-type=attribute href=#dom-fontface-variant title=variant>variant</a>, and <a class=idl-code data-link-type=attribute href=#dom-fontface-featuresettings title=featuresettings>featureSettings</a> attributes
392+
set to the same value as the corresponding descriptors in the <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-fonts-3/#at-font-face-rule title=@font-face>@font-face</a> rule.
380393
There is a two-way connection between the two:
381394
any change made to a <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-fonts-3/#at-font-face-rule title=@font-face>@font-face</a> descriptor is immediately reflected in the corresponding <a class=idl-code data-link-type=interface href=http://dev.w3.org/csswg/css-font-load-events-3/#dom-fontface title=fontface>FontFace</a> attribute,
382395
and vice versa.
@@ -386,7 +399,9 @@ <h3 class="heading settled heading" data-level=2.4 id=font-face-css-connection><
386399

387400
<p> Otherwise, a <a class=idl-code data-link-type=interface href=http://dev.w3.org/csswg/css-font-load-events-3/#dom-fontface title=fontface>FontFace</a> object created by a CSS <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-fonts-3/#at-font-face-rule title=@font-face>@font-face</a> rule is identical to one created manually.
388401

389-
<p> If a <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-fonts-3/#at-font-face-rule title=@font-face>@font-face</a> rule is removed from the document, its corresponding <a class=idl-code data-link-type=interface href=http://dev.w3.org/csswg/css-font-load-events-3/#dom-fontface title=fontface>FontFace</a> object is no longer <a data-link-type=dfn href=#css-connected title=css-connected>CSS-connected</a>. The connection is not restorable by any means (but adding the <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-fonts-3/#at-font-face-rule title=@font-face>@font-face</a> back to the stylesheet will create a brand new <a class=idl-code data-link-type=interface href=http://dev.w3.org/csswg/css-font-load-events-3/#dom-fontface title=fontface>FontFace</a> object which <em>is</em> <a data-link-type=dfn href=#css-connected title=css-connected>CSS-connected</a>).
402+
<p> If a <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-fonts-3/#at-font-face-rule title=@font-face>@font-face</a> rule is removed from the document, its corresponding <a class=idl-code data-link-type=interface href=http://dev.w3.org/csswg/css-font-load-events-3/#dom-fontface title=fontface>FontFace</a> object is no longer <a data-link-type=dfn href=#css-connected title=css-connected>CSS-connected</a>.
403+
The connection is not restorable by any means
404+
(but adding the <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-fonts-3/#at-font-face-rule title=@font-face>@font-face</a> back to the stylesheet will create a brand new <a class=idl-code data-link-type=interface href=http://dev.w3.org/csswg/css-font-load-events-3/#dom-fontface title=fontface>FontFace</a> object which <em>is</em> <a data-link-type=dfn href=#css-connected title=css-connected>CSS-connected</a>).
390405

391406

392407

@@ -1115,9 +1130,6 @@ <h2 class="no-num no-ref heading settled heading" id=property-index><span class=
11151130

11161131

11171132
<h2 class="no-num heading settled" id=issues-index><span class=content>Issues Index</span><a class=self-link href=#issues-index></a></h2><div style="counter-reset: issue"><div class=issue>
1118-
Fill in intro.
1119-
1120-
<a href=#issue-06b29672></a></div><div class=issue>
11211133
Document the FontFaceSet behavior for Workers.
11221134
(They start out empty, but can construct fonts or be sent them via postMessage.)
11231135

0 commit comments

Comments
 (0)