@@ -29,6 +29,7 @@ spec:css-fonts-4; type:descriptor; text:font-language-override
29
29
spec:css-fonts-4; type:property; text:font-family
30
30
spec:css-fonts-4; type:property; text:font-style
31
31
spec:css-fonts-4; type:property; text:font-weight
32
+ spec:css-fonts-4; type:descriptor; text:src
32
33
</pre>
33
34
34
35
@@ -345,6 +346,71 @@ The <dfn id="at-font-face-rule">''@font-face''</dfn> rule</h3>
345
346
Multiple fonts can be used within an individual element
346
347
e.g. for characters not supported by the [=first available font=] .
347
348
349
+ <h3 id="src-desc">Font reference: the 'src' descriptor</h3>
350
+
351
+ <h4 id="font-face-src-parsing">Parsing the 'src!!descriptor' descriptor</h4>
352
+
353
+ Note: this level adds the incremental font technology.
354
+
355
+
356
+ The 'src!!descriptor' descriptor value must be parsed
357
+ according to section [[css-syntax#parse-comma-separated-list-of-component-values]] .
358
+ Then each component value is parsed according to this grammar:
359
+
360
+
361
+ <pre> <<url>> [ format(<<font-format>> [supports <<font-technology>>#] ?)]? | local(<<font-face-name>> )</pre>
362
+
363
+ <pre class="prod"><dfn id="font-format-values"><font-format></dfn>
364
+ = [<<string>> | woff | truetype | opentype
365
+ | woff2 | embedded-opentype | collection | svg]</pre>
366
+
367
+ <pre class="prod"><dfn id="font-technology-values"><font-technology></dfn>
368
+ = [features(<<font-feature-technology>> ) | variations
369
+ | color(<<color-font-technology>> ) | palettes
370
+ | incremental ]</pre>
371
+
372
+ <pre class="prod"><dfn id="font-feature-technology-values"><font-feature-technology></dfn>
373
+ = [opentype | aat | graphite]</pre>
374
+
375
+ <pre class="prod"><dfn id="color-font-technology-values"><color-font-technology></dfn>
376
+ = [COLRv0 | COLRv1 | SVG | sbix | CBDT ]</pre>
377
+
378
+ If a component value is parsed correctly
379
+ and is of a format and font technology that the UA supports,
380
+ add it to the list of supported sources.
381
+ If parsing a component value results in a parsing error
382
+ or its format or technology are unsupported,
383
+ do not add it to the list of supported sources.
384
+
385
+ If there are no supported entries at the end of this process,
386
+ the value for the 'src!!descriptor' descriptor is a parse error.
387
+
388
+ These parsing rules allow for graceful fallback of fonts
389
+ for user agents which don't support a particular font technology.
390
+
391
+ <div class="example" id="ex-incremental">
392
+ For example,
393
+ when incremental transfer is not supported,
394
+ a woff2 compressed version of the font
395
+ is supplied,
396
+ for optimal performance.
397
+ Then,
398
+ for incremental transfer using the
399
+ <a href="https://www.w3.org/TR/2020/NOTE-PFE-evaluation-20201015/#range-request">range-request method</a> ,
400
+ the raw uncompressed OpenType font is provided
401
+ so that the client
402
+ can perform byte range requests.
403
+
404
+ <pre>
405
+ @font-face {
406
+ font-family: "MyIncrementallyLoadedWebFont";
407
+ src: url("FallbackURLForBrowsersWhichDontSupportIncrementalLoading.woff2") format("woff2");
408
+ src: url("MyIncrementallyLoadedWebFont.otf") format(opentype supports incremental);
409
+ }
410
+ </pre>
411
+ </div>
412
+
413
+
348
414
<h3 id="font-size-desc">
349
415
Font property descriptors: the 'font-size!!descriptor'
350
416
</h3>
0 commit comments