Skip to content

Commit 9feb2c8

Browse files
committed
Add clarifications and fluff
--HG-- extra : rebase_source : 0df21ff398fd077dd1bde480fff44919329a3aeb
1 parent dd71c26 commit 9feb2c8

2 files changed

Lines changed: 43 additions & 5 deletions

File tree

css-font-load-events/Overview.html

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,12 @@ <h4 class="heading settled heading" data-level=2.2.1 id=font-face-constructor><s
345345
<h4 class="heading settled heading" data-level=2.2.2 id=font-face-load><span class=secno>2.2.2 </span><span class=content>
346346
The <code>load()</code> method</span><a class=self-link href=#font-face-load></a></h4>
347347

348+
<p> The <a class=idl-code data-link-for=FontFace data-link-type=method href=#dom-fontface-load>load()</a> method of <a class=idl-code data-link-type=interface>FontFace</a>
349+
forces a url-based font face to request its font data and load.
350+
For fonts constructed from binary data,
351+
or fonts that are already loading or loaded,
352+
it does nothing.
353+
348354
<p> When the <dfn class=idl-code data-dfn-for=FontFace data-dfn-type=method data-export="" id=dom-fontface-load>load()<a class=self-link href=#dom-fontface-load></a></dfn> method is called,
349355
execute these steps:
350356

@@ -388,6 +394,11 @@ <h4 class="heading settled heading" data-level=2.2.2 id=font-face-load><span cla
388394
<h4 class="heading settled heading" data-level=2.2.3 id=font-face-ready><span class=secno>2.2.3 </span><span class=content>
389395
The <code>ready()</code> method</span><a class=self-link href=#font-face-ready></a></h4>
390396

397+
<p> The <a class=idl-code data-link-for=FontFace data-link-type=method href=#dom-fontface-ready>ready()</a> method of <a class=idl-code data-link-type=interface>FontFace</a>
398+
returns a Promise
399+
which is fulfilled when the font face is successfully loaded,
400+
or rejected when the font face fails to load or parse successfully.
401+
391402
<p> When the <dfn class=idl-code data-dfn-for=FontFace data-dfn-type=method data-export="" id=dom-fontface-ready>ready()<a class=self-link href=#dom-fontface-ready></a></dfn> method is called,
392403
execute these steps:
393404

@@ -402,11 +413,15 @@ <h4 class="heading settled heading" data-level=2.2.3 id=font-face-ready><span cl
402413
<h4 class="heading settled heading" data-level=2.2.4 id=font-face-match><span class=secno>2.2.4 </span><span class=content>
403414
The <code>match()</code> method</span><a class=self-link href=#font-face-match></a></h4>
404415

416+
<p> The <a class=idl-code data-link-for=FontFace data-link-type=method href=#dom-fontface-matchfontfacedescriptors-descriptors-optional-domstring-characters>match()</a> method of <a class=idl-code data-link-type=interface>FontFace</a> exposes the CSS font-matching algorithm
417+
on a per-font basis,
418+
allowing one to test individual fonts to see if they match a given <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-fonts-3/#propdef-font title=font>font</a> value.
419+
405420
<p> When the <dfn class=idl-code data-dfn-for=FontFace data-dfn-type=method data-export="" id=dom-fontface-matchfontfacedescriptors-descriptors-optional-domstring-characters title=match()>match(<a class=idl-code data-link-type=interface>FontFaceDescriptors</a> <dfn class=idl-code data-dfn-for="FontFace/match() match()" data-dfn-type=argument data-export="" id=dom-fontfacematch-match-descriptors>descriptors<a class=self-link href=#dom-fontfacematch-match-descriptors></a></dfn>, optional DOMString <dfn class=idl-code data-dfn-for="FontFace/match() match()" data-dfn-type=argument data-export="" id=dom-fontfacematch-match-characters>characters<a class=self-link href=#dom-fontfacematch-match-characters></a></dfn>)<a class=self-link href=#dom-fontface-matchfontfacedescriptors-descriptors-optional-domstring-characters></a></dfn> method is called,
406421
execute these steps:
407422

408-
<p class=issue id=issue-7d93b920><a class=self-link href=#issue-7d93b920></a>
409-
Refer to Font’s font matching algorithm somehow.
423+
<p class=issue id=issue-89af42f8><a class=self-link href=#issue-89af42f8></a>
424+
Figure out how to run Font’s font selection algorithm on a single face.
410425

411426
<h4 class="heading settled heading" data-level=2.2.5 id=font-face-css-connection><span class=secno>2.2.5 </span><span class=content>
412427
Connection to CSS’s <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-fonts-3/#at-font-face-rule>@font-face</a></span><a class=self-link href=#font-face-css-connection></a></h4>
@@ -796,6 +811,10 @@ <h4 class="heading settled heading" data-level=2.3.5 id=font-face-set-ready><spa
796811
The <a>ready promise</a> is only fulfilled after layout operations complete
797812
and no additional font loads are necessary.
798813

814+
<p class=note> Note: Note that the Promise returned by this <a class=idl-code data-link-for=FontFaceSet data-link-type=method href=#dom-fontfaceset-ready>ready()</a> method is only ever fulfilled,
815+
never rejected,
816+
unlike the Promise returned by the <a class=idl-code data-link-type=interface>FontFace</a> <a class=idl-code data-link-for=FontFace data-link-type=method href=#dom-fontface-ready>ready()</a> method.
817+
799818
<h3 class="heading settled heading" data-level=2.4 id=font-load-event-examples><span class=secno>2.4 </span><span class=content>
800819
Font load event examples</span><a class=self-link href=#font-load-event-examples></a></h3>
801820

@@ -1093,9 +1112,9 @@ <h2 class="no-num no-ref heading settled heading" id=property-index><span class=
10931112
I think I just need to add it to WorkerGlobalScope or something.
10941113

10951114
<a href=#issue-fbb9c14f></a><p class=issue>
1096-
Refer to Font’s font matching algorithm somehow.
1115+
Figure out how to run Font’s font selection algorithm on a single face.
10971116

1098-
<a href=#issue-7d93b920></a><p class=issue>
1117+
<a href=#issue-89af42f8></a><p class=issue>
10991118
Document the FontFaceSet behavior for Workers.
11001119
(They start out empty, but can construct fonts or be sent them via postMessage.)
11011120

css-font-load-events/Overview.src.html

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,12 @@ <h4 id='font-face-constructor'>
266266
<h4 id='font-face-load'>
267267
The <code>load()</code> method</h4>
268268

269+
The <a method for=FontFace>load()</a> method of <a interface>FontFace</a>
270+
forces a url-based font face to request its font data and load.
271+
For fonts constructed from binary data,
272+
or fonts that are already loading or loaded,
273+
it does nothing.
274+
269275
When the <dfn method for=FontFace>load()</dfn> method is called,
270276
execute these steps:
271277

@@ -309,6 +315,11 @@ <h4 id='font-face-load'>
309315
<h4 id='font-face-ready'>
310316
The <code>ready()</code> method</h4>
311317

318+
The <a method for=FontFace>ready()</a> method of <a interface>FontFace</a>
319+
returns a Promise
320+
which is fulfilled when the font face is successfully loaded,
321+
or rejected when the font face fails to load or parse successfully.
322+
312323
When the <dfn method for="FontFace">ready()</dfn> method is called,
313324
execute these steps:
314325

@@ -323,11 +334,15 @@ <h4 id='font-face-ready'>
323334
<h4 id='font-face-match'>
324335
The <code>match()</code> method</h4>
325336

337+
The <a method for=FontFace>match()</a> method of <a interface>FontFace</a> exposes the CSS font-matching algorithm
338+
on a per-font basis,
339+
allowing one to test individual fonts to see if they match a given 'font' value.
340+
326341
When the <dfn method for="FontFace" title='match()'>match(<a interface>FontFaceDescriptors</a> <dfn argument>descriptors</dfn>, optional DOMString <dfn argument>characters</dfn>)</dfn> method is called,
327342
execute these steps:
328343

329344
<p class='issue'>
330-
Refer to Font's font matching algorithm somehow.
345+
Figure out how to run Font's font selection algorithm on a single face.
331346

332347
<h4 id='font-face-css-connection'>
333348
Connection to CSS's ''@font-face''</h4>
@@ -719,6 +734,10 @@ <h4 id='font-face-set-ready'>
719734
The <a>ready promise</a> is only fulfilled after layout operations complete
720735
and no additional font loads are necessary.
721736

737+
Note: Note that the Promise returned by this <a method for=FontFaceSet>ready()</a> method is only ever fulfilled,
738+
never rejected,
739+
unlike the Promise returned by the <a interface>FontFace</a> <a method for=FontFace>ready()</a> method.
740+
722741
<h3 id="font-load-event-examples">
723742
Font load event examples</h3>
724743

0 commit comments

Comments
 (0)