Skip to content

Commit 02095d6

Browse files
cdoublevsvgeesus
andauthored
[css-fonts][css-prints][css-values][editorial] Add font- prefix to production names (#13272)
Co-authored-by: Chris Lilley <chris@w3.org>
1 parent 860489e commit 02095d6

File tree

6 files changed

+147
-62
lines changed

6 files changed

+147
-62
lines changed

css-fonts-4/Overview.bs

Lines changed: 139 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,12 @@ Font family: the 'font-family!!property' property</h3>
120120

121121
<pre class="propdef">
122122
Name: font-family
123-
Value: [ <<family-name>> | <<generic-family>> ]#
123+
Value: [ <<font-family-name>> | <<generic-font-family>> ]#
124124
Initial: depends on user agent
125125
Applies to: all elements and text
126126
Inherited: yes
127127
Percentages: n/a
128-
Computed value: list, each item a string and/or <<generic-family>> keywords
128+
Computed value: list, each item a string and/or <<generic-font-family>> keywords
129129
Animation type: discrete
130130
</pre>
131131

@@ -214,20 +214,20 @@ Font family: the 'font-family!!property' property</h3>
214214
There are three types of font family names, two of which may be used with this property:
215215

216216
<dl>
217-
<dt><dfn id="family-name-value"><<family-name>></dfn>
218-
<dd>
219-
The name of a font family, such as Helvetica or Verdana in the previous example.
217+
<dt><dfn id="font-family-name-value"><<font-family-name>></dfn>
218+
<dd>
219+
The name of a font family, such as Helvetica or Verdana in the previous example.
220220

221221
This might be a locally-instaled font, or might be a web font.
222222

223-
<dt><<generic-family>>
224-
<dd>
225-
Each <<generic-family>> keyword represents
226-
a generic font choice,
227-
and behaves as a potential alias for one or more locally-installed fonts
228-
belonging to the specified generic font category.
229-
A <<generic-family>> can thus be used as a fallback
230-
for when an author's more specific font choices are not available.
223+
<dt><<generic-font-family>>
224+
<dd>
225+
Each <<generic-font-family>> keyword represents
226+
a generic font choice,
227+
and behaves as a potential alias for one or more locally-installed fonts
228+
belonging to the specified generic font category.
229+
A <<generic-font-family>> can thus be used as a fallback
230+
for when an author's more specific font choices are not available.
231231

232232
There are three types of generic family:
233233

@@ -251,12 +251,12 @@ Font family: the 'font-family!!property' property</h3>
251251
and to use a more specific generic font family, if applicable,
252252
to prefer a specific style even if the individual named font family is not available.
253253

254-
Note that <<generic-family>> keywords cannot be quoted
255-
(otherwise they are interpreted as a <<family-name>>).
254+
Note that <<generic-font-family>> keywords cannot be quoted
255+
(otherwise they are interpreted as a <<font-family-name>>).
256256

257257
The set of generic family keywords is defined in [[#generic-font-families]].
258258

259-
<dt><dfn id="system-family-name-value"><<system-family-name>></dfn>
259+
<dt><dfn id="system-font-family-name-value"><<system-font-family-name>></dfn>
260260
<dd>
261261
A locally installed system font, whose use is subject to certain constraints.
262262
In particular, it may not be used with the ''font-family'' property,
@@ -286,11 +286,11 @@ Font family: the 'font-family!!property' property</h3>
286286

287287
</dl>
288288

289-
<h4 id="family-name-syntax">
290-
Syntax of <<family-name>>
289+
<h4 id="font-family-name-syntax">
290+
Syntax of <<font-family-name>>
291291
</h4>
292292

293-
<pre class=prod><l><<family-name>></l> = <<string>> | <<custom-ident>>+</pre>
293+
<pre class=prod><l><<font-family-name>></l> = <<string>> | <<custom-ident>>+</pre>
294294

295295
Font family names other than generic families or system font families
296296
must either be given quoted as <<string>>s,
@@ -320,7 +320,7 @@ Syntax of <<family-name>>
320320

321321
Note: this means that if you really have a font
322322
whose name
323-
is the same as one of the <<generic-family>> names,
323+
is the same as one of the <<generic-font-family>> names,
324324
or the system font names,
325325
or the [=CSS-wide keywords=],
326326
it <em>must</em> be quoted.
@@ -338,7 +338,7 @@ Syntax of <<family-name>>
338338
</pre>
339339
</div>
340340

341-
If a sequence of identifiers is given as a <<family-name>>,
341+
If a sequence of identifiers is given as a <<font-family-name>>,
342342
the computed value is the name
343343
converted to a string
344344
by joining all the identifiers in the sequence by single spaces.
@@ -361,28 +361,28 @@ Syntax of <<family-name>>
361361
Font family <em>names</em> that happen to be the same as
362362
a 'font-family!!property' keyword value
363363
(e.g. <a>CSS-wide keywords</a> such as ''inherit'', or
364-
<<generic-family>> keywords such as ''serif'')
364+
<<generic-font-family>> keywords such as ''serif'')
365365
must be quoted to prevent confusion
366366
with the keywords of the same names.
367-
UAs must not consider these keywords as matching the <<family-name>> type.
367+
UAs must not consider these keywords as matching the <<font-family-name>> type.
368368

369369
<h4 id="generic-family-name-syntax">
370-
Syntax of <<generic-family>>
370+
Syntax of <<generic-font-family>>
371371
</h4>
372372

373373
<!-- <pre class=prod>
374-
<dfn><<generic-family>></dfn> = generic(<<generic-script-specific>>) | <<generic-complete>> | <<generic-incomplete>>
375-
<dfn><<generic-script-specific>></dfn> = <a href="">kai</a> | fangsong | nastaliq
376-
<dfn><<generic-complete>></dfn> = serif | sans-serif | system-ui | cursive | fantasy | math | monospace
377-
<dfn><<generic-incomplete>></dfn> = ui-serif | ui-sans-serif | ui-monospace | ui-rounded
378-
</pre> -->
379-
380-
<pre class=prod>
381-
<dfn><<generic-family>></dfn> = <<generic-script-specific>>| <<generic-complete>> | <<generic-incomplete>>
382-
<dfn><<generic-script-specific>></dfn> = <l>''font-family/generic(fangsong)''</l> | <l>''font-family/generic(kai)''</l> | <l>''font-family/generic(khmer-mul)''</l> | <l>''font-family/generic(nastaliq)''</l>
383-
<dfn><<generic-complete>></dfn> = <l>''font-family/serif''</l> | <l>''font-family/sans-serif''</l> | <l>''font-family/system-ui''</l> | <l>''font-family/cursive''</l> | <l>''font-family/fantasy''</l> | <l>''font-family/math''</l> | <l>''font-family/monospace''</l>
384-
<dfn><<generic-incomplete>></dfn> = <l>''font-family/ui-serif''</l> | <l>''font-family/ui-sans-serif''</l> | <l>''font-family/ui-monospace''</l> | <l>''font-family/ui-rounded''</l>
385-
</pre>
374+
<dfn><<generic-font-family>></dfn> = generic(<<generic-font-script-specific>>) | <<generic-font-complete>> | <<generic-font-incomplete>>
375+
<dfn><<generic-font-script-specific>></dfn> = <a href="">kai</a> | fangsong | nastaliq
376+
<dfn><<generic-font-complete>></dfn> = serif | sans-serif | system-ui | cursive | fantasy | math | monospace
377+
<dfn><<generic-font-incomplete>></dfn> = ui-serif | ui-sans-serif | ui-monospace | ui-rounded
378+
</pre> -->
379+
380+
<pre class=prod>
381+
<dfn><<generic-font-family>></dfn> = <<generic-font-script-specific>>| <<generic-font-complete>> | <<generic-font-incomplete>>
382+
<dfn><<generic-font-script-specific>></dfn> = <l>''generic(fangsong)''</l> | <l>''generic(kai)''</l> | <l>''generic(khmer-mul)''</l> | <l>''generic(nastaliq)''</l>
383+
<dfn><<generic-font-complete>></dfn> = <l>''serif''</l> | <l>''sans-serif''</l> | <l>''system-ui''</l> | <l>''cursive''</l> | <l>''fantasy''</l> | <l>''math''</l> | <l>''monospace''</l>
384+
<dfn><<generic-font-incomplete>></dfn> = <l>''ui-serif''</l> | <l>''ui-sans-serif''</l> | <l>''ui-monospace''</l> | <l>''ui-rounded''</l>
385+
</pre>
386386

387387
To make the syntax less succeptible to clashes, more recently defined generic font families are identified using a functional syntax.
388388

@@ -400,11 +400,11 @@ Syntax of <<generic-family>>
400400
</div>
401401

402402
<h4 id="system">
403-
Syntax of <<system-family-name>>
403+
Syntax of <<system-font-family-name>>
404404
</h4>
405405

406406
<pre class="prod">
407-
<l><<system-family-name>></l> = <l>''caption''</l> | <l>''icon''</l> | <l>''menu''</l> | <l>''message-box''</l> | <l>''small-caption''</l> | <l>''status-bar''</l>
407+
<l><<system-font-family-name>></l> = <l>''caption''</l> | <l>''icon''</l> | <l>''menu''</l> | <l>''message-box''</l> | <l>''small-caption''</l> | <l>''status-bar''</l>
408408
</pre>
409409

410410
<h4 id="font-families">
@@ -464,23 +464,23 @@ Generic font families</h4>
464464
generic-family-keywords-002.html
465465
</wpt>
466466

467-
Note: Generic font families are intended to be widely implemented on many platforms, unlike arbitrary <<family-name>>s which are usually platform-specific names. They are expected to map to different fonts on different platforms. Authors may specify these generic family names if they desire their text to follow a particular design on many platforms, and are not particular about which specific font is chosen on those platforms.
467+
Note: Generic font families are intended to be widely implemented on many platforms, unlike arbitrary <<font-family-name>>s which are usually platform-specific names. They are expected to map to different fonts on different platforms. Authors may specify these generic family names if they desire their text to follow a particular design on many platforms, and are not particular about which specific font is chosen on those platforms.
468468

469469
User agents should provide reasonable default choices for the generic font families,
470470
that express the characteristics of each family as well as possible,
471471
within the limits allowed by the underlying technology.
472472
User agents are encouraged to allow users to select alternative faces for the generic font families.
473473

474-
<dl dfn-for="font-family,<generic-family>" dfn-type=value>
475-
<dt id="serif-def"><dfn>serif</dfn>
476-
<dd>
477-
Serif fonts represent
478-
glyphs that have finishing strokes,
479-
flared or tapering ends,
480-
or have actual serifed endings (including slab serifs).
481-
Serif fonts are typically proportionately-spaced.
482-
They often display a greater variation between thick and thin strokes
483-
than fonts from the ''sans-serif'' generic font family.
474+
<dl dfn-for="font-family,<generic-font-family>" dfn-type=value>
475+
<dt id="serif-def"><dfn>serif</dfn>
476+
<dd>
477+
Serif fonts represent
478+
glyphs that have finishing strokes,
479+
flared or tapering ends,
480+
or have actual serifed endings (including slab serifs).
481+
Serif fonts are typically proportionately-spaced.
482+
They often display a greater variation between thick and thin strokes
483+
than fonts from the ''sans-serif'' generic font family.
484484

485485
Note: ''serif'' and ''sans-serif''
486486
only apply to a small handful of writing scripts.
@@ -1785,7 +1785,7 @@ Shorthand font property: the 'font' property</h3>
17851785
<<'font-weight'>> ||
17861786
<<font-width-css3>> ]? <<'font-size'>> [ / <<'line-height'>> ]?
17871787
<<'font-family'>># ] |
1788-
<<system-family-name>>
1788+
<<system-font-family-name>>
17891789
Initial: see individual properties
17901790
Applies to: all elements and text
17911791
Inherited: yes
@@ -2695,7 +2695,7 @@ The <dfn id="at-font-face-rule">''@font-face''</dfn> rule</h3>
26952695

26962696
<pre class='descdef'>
26972697
Name: font-family
2698-
Value: <<family-name>>
2698+
Value: <<font-family-name>>
26992699
For: @font-face
27002700
Initial: N/A
27012701
</pre>
@@ -2757,6 +2757,13 @@ The <dfn id="at-font-face-rule">''@font-face''</dfn> rule</h3>
27572757

27582758
<h4 id="font-face-src-parsing">Parsing the 'src!!descriptor' descriptor</h4>
27592759

2760+
To parse a <dfn><<font-src-list>></dfn> production, [=parse a list=] of <<font-src>>s.
2761+
2762+
<pre class="prod"><dfn>&lt;font-src></dfn> = <<url>> [ format(<<font-format>>)]? [ tech( <<font-tech>>#)]? | local(<<font-family-name>>)</pre>
2763+
2764+
<pre class="prod"><dfn id="font-format-values">&lt;font-format&gt;</dfn>
2765+
= [<<string>> | collection | embedded-opentype | opentype
2766+
| svg | truetype | woff | woff2 ]</pre>
27602767
To parse a <dfn><<font-src-list>></dfn> production, [=parse a list=] of <<font-src>>s.
27612768

27622769
<pre class="prod">
@@ -2949,7 +2956,7 @@ The <dfn id="at-font-face-rule">''@font-face''</dfn> rule</h3>
29492956
a locally available copy of a given font
29502957
and download it if it's not,
29512958
<code>local()</code> can be used.
2952-
The locally-installed <<family-name>> argument to <code>local()</code>
2959+
The locally-installed <<font-family-name>> argument to <code>local()</code>
29532960
is a format-specific string
29542961
that uniquely identifies a single font face
29552962
within a larger family.
@@ -2964,7 +2971,7 @@ The <dfn id="at-font-face-rule">''@font-face''</dfn> rule</h3>
29642971
separated by a single space;
29652972
and thus,
29662973
<a>CSS-wide keywords</a> such as ''inherit'', and
2967-
<<generic-family>> keywords such as ''serif''
2974+
<<generic-font-family>> keywords such as ''serif''
29682975
are not allowed inside <code>local()</code>.
29692976

29702977
<pre class="lang-css">
@@ -6047,6 +6054,32 @@ Defining font specific alternates: the <dfn>@font-feature-values</dfn> rule</h3>
60476054

60486055
<h4 id="font-feature-values-syntax">Basic syntax</h4>
60496056

6057+
An ''@font-feature-values'' rule's prelude
6058+
contains a list of font family names,
6059+
followed by a block containing multiple ''feature-value-block''s,
6060+
a special type of subsidiary at-rule.
6061+
Each ''feature-value-block''' contains declarations
6062+
mapping author-chosen human-friendly names
6063+
(such as "flowing")
6064+
to feature indexes for the associated feature.
6065+
6066+
Each <<font-feature-value>> has the same meaning
6067+
as the corresponding value of the 'font-variant-alternates' property.
6068+
6069+
<pre class=prod export>
6070+
@font-feature-values = @font-feature-values <<font-family-name>># { <<declaration-rule-list>> }
6071+
6072+
<dfn for="@font-feature-values">font-feature-value-type</dfn> = <<@stylistic>> | <<@historical-forms>> | <<@styleset>> | <<@character-variant>>
6073+
| <<@swash>> | <<@ornaments>> | <<@annotation>>
6074+
6075+
<dfn for="@font-feature-values">@stylistic</dfn> = @stylistic { <<declaration-list>> }
6076+
<dfn for="@font-feature-values">@historical-forms</dfn> = @historical-forms { <<declaration-list>> }
6077+
<dfn for="@font-feature-values">@styleset</dfn> = @styleset { <<declaration-list>> }
6078+
<dfn for="@font-feature-values">@character-variant</dfn> = @character-variant { <<declaration-list>> }
6079+
<dfn for="@font-feature-values">@swash</dfn> = @swash { <<declaration-list>> }
6080+
<dfn for="@font-feature-values">@ornaments</dfn> = @ornaments { <<declaration-list>> }
6081+
<dfn for="@font-feature-values">@annotation</dfn> = @annotation { <<declaration-list>> }
6082+
</pre>
60506083
An ''@font-feature-values'' rule's prelude
60516084
contains a list of font family names,
60526085
followed by a block containing multiple <dfn export lt="font feature value block | feature value block">feature value blocks</dfn>,
@@ -6079,6 +6112,58 @@ Defining font specific alternates: the <dfn>@font-feature-values</dfn> rule</h3>
60796112
test_font_feature_values_parsing.html
60806113
</wpt>
60816114

6115+
The ''@font-feature-values'' prelude
6116+
is a comma-delimited list of font family names that match the definition of <<font-family-name>>
6117+
for the 'font-family!!property' property.
6118+
This means that only named font families are allowed;
6119+
rules that include generic or system fonts in the list of font families are syntax errors.
6120+
However, if a user agent defines a generic font to be a specific named font (e.g. Helvetica),
6121+
the settings associated with that family name will be used.
6122+
If syntax errors occur within the <<font-family-name>> list,
6123+
the entire rule ''@font-feature-values'' rule is invalid
6124+
and must be ignored.
6125+
6126+
The ''@font-feature-values'' block accepts <<declaration-rule-list>> as its contents;
6127+
these list items are either:
6128+
6129+
- [=at-rules=] named by one of the <<font-feature-value-type>> at-keyword tokens
6130+
6131+
or
6132+
6133+
- the '@font-feature-values/font-display' descriptor.
6134+
6135+
<!-- TODO: tab says "The OM needs to make sure it exposes both .style and .childRules or whatever." -->
6136+
6137+
Specifying the same <<font-feature-value-type>> more than once is valid;
6138+
their contents are cascaded together.
6139+
Each <<feature-value-block>> accepts a list of [=declarations=],
6140+
the <dfn lt="font feature value declaration">font feature value declarations</dfn>,
6141+
where the declaration's name can be any [=identifier=],
6142+
and the value must be a list of one or more non-negative <<integer>>s.
6143+
6144+
The <<feature-value-block>>s accept any declaration name;
6145+
these names must be identifiers,
6146+
per standard CSS syntax rules,
6147+
and are [=case-sensitive=]
6148+
(so ''foo: 1;'' and ''FOO: 2'' define two different features).
6149+
Each declaration's value must match the grammar ''<<integer [0,∞]>>+'',
6150+
or else the declaration is invalid and must be ignored.
6151+
6152+
Note: Each feature name is unique only within a single <<feature-value-block>>.
6153+
Between different <<feature-value-block>>s,
6154+
or the same type of <<feature-value-block>>s in separate ''@font-feature-values'' rules,
6155+
names can be reused without colliding.
6156+
6157+
For each <<font-family-name>> in the ''@font-feature-values'' prelude,
6158+
each [=font feature value declaration=] defines a mapping between a
6159+
(family name, feature block name, declaration name) [=tuple=]
6160+
and the list of one or more integers from the declaration's value.
6161+
If the same tuple appears more than once in a document
6162+
(such as if a single block),
6163+
the last-defined one is used.
6164+
6165+
<div class=example id="ex-same-font-feature-values">
6166+
For example, the following all define the exact same set of font feature values:
60826167
The ''@font-feature-values'' prelude
60836168
is a comma-delimited list of font family names that match the definition of <<family-name>>
60846169
for the 'font-family!!property' property.
@@ -7881,7 +7966,7 @@ Font family: the '@font-palette-values/font-family' descriptor</h4>
78817966

78827967
<pre class='descdef'>
78837968
Name: font-family
7884-
Value: <<family-name>>#
7969+
Value: <<font-family-name>>#
78857970
For: @font-palette-values
78867971
Initial: N/A
78877972
</pre>

css-fonts-5/Overview.bs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ in CSS Fonts Level 4, the following new generic font families are also defined.
212212

213213
Issue(4910):
214214

215-
<dl dfn-for="font-family,<generic-family>" dfn-type=value>
215+
<dl dfn-for="font-family,<generic-font-family>" dfn-type=value>
216216
<dt id="xxx-def"><dfn>xxx</dfn>
217217
<dd>
218218
Placeholder text for the xxx generic font family.
@@ -509,7 +509,7 @@ according to section [[css-syntax#parse-comma-separated-list-of-component-values
509509
Then each component value is parsed according to this grammar:
510510

511511

512-
<pre><<url>> [ format(<<font-format>>)]? [ tech( <<font-tech>>#)]? | local(<<family-name>>)</pre>
512+
<pre><<url>> [ format(<<font-format>>)]? [ tech( <<font-tech>>#)]? | local(<<font-family-name>>)</pre>
513513

514514
<pre class="prod"><dfn id="font-format-values">&lt;font-format&gt;</dfn>
515515
= [<<string>> | collection | embedded-opentype | opentype

css-print/Overview.bs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,8 +574,8 @@ small-caption | status-bar | inherit</td>
574574
<td>'font-family'</td>
575575
<td><em title="MUST In The RFC 2119 Context" class="RFC2119">MUST</em><a href="#table_note_1">*</a></td>
576576
<td><em title="MUST In The RFC 2119 Context" class="RFC2119">MUST</em><a href="#table_note_1">*</a></td>
577-
<td>[[ &lt;family-name&gt; | &lt;generic-family&gt; ],]* [
578-
&lt;family-name&gt; | &lt;generic-family&gt; ] | inherit</td>
577+
<td>[[ &lt;font-family-name&gt; | &lt;generic-font-family&gt; ],]* [
578+
&lt;font-family-name&gt; | &lt;generic-font-family&gt; ] | inherit</td>
579579
<td>depends on user agent</td></tr>
580580
<tr class="yes">
581581
<td>'font-size'</td>

css-values-3/Overview.bs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ Property Value Examples</h3>
418418
<td>''overline underline''
419419
<tr>
420420
<td><a property>font-family</a>
421-
<td>[ &lt;family-name> | &lt;generic-family> ]#
421+
<td>[ &lt;font-family-name> | &lt;generic-font-family> ]#
422422
<td>''"Gill Sans", Futura, sans-serif''
423423
<tr>
424424
<td>'border-width'

css-values-4/Overview.bs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ Property Value Examples</h3>
490490
<td>''overline underline''
491491
<tr>
492492
<td><a property>font-family</a>
493-
<td>[ &lt;family-name> | &lt;generic-family> ]#
493+
<td>[ &lt;font-family-name> | &lt;generic-font-family> ]#
494494
<td>''"Gill Sans", Futura, sans-serif''
495495
<tr>
496496
<td>'border-width'

0 commit comments

Comments
 (0)