Skip to content

Commit 58ea84d

Browse files
committed
[css-fonts-4] Describe classes of generics and whether they are guaranteed to match. #6770
1 parent 8a4c1ac commit 58ea84d

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed

css-fonts-4/Overview.bs

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -216,17 +216,39 @@ Font family: the 'font-family!!property' property</h3>
216216
<dd>
217217
The name of a font family, such as Helvetica or Verdana in the previous example.
218218

219+
This might be a locally-instaled font, or might be a web font.
220+
219221
<dt><dfn id="generic-family-value"><<generic-family>></dfn>
220222
<dd>
221223
Each <<generic-family>> keyword represents
222224
a generic font choice,
223-
and behaves as an alias for one or more locally-installed fonts
225+
and behaves as a potential alias for one or more locally-installed fonts
224226
belonging to the specified generic font category.
225-
A <<generic-family>> can thus be used as a reliable fallback
227+
A <<generic-family>> can thus be used as a fallback
226228
for when an author's more specific font choices are not available.
227229

230+
There are three types of generic family:
231+
232+
1. Generics which apply to all Unicode characters
233+
and will <em>always</em> match a locally installed font.
234+
For example, ''monospaced''.
235+
236+
2. Generics which apply to all Unicode characters
237+
but may not match to a locally installed font
238+
on some systems.
239+
For example, ''ui-rounded''.
240+
241+
3. Generics which are writing-system specific,
242+
only apply to a subset of Unicode characters,
243+
and may not match to a locally installed font
244+
on some systems.
245+
For example, ''fangsong''.
246+
228247
Authors are encouraged to append a generic font family as a last alternative
229-
for improved robustness.
248+
for improved robustness,
249+
and to use a more specific generic font family, if applicable,
250+
to prefer a specific style even if the individual named font family is not available.
251+
230252
Note that <<generic-family>> keywords cannot be quoted
231253
(otherwise they are interpreted as a <<family-name>>).
232254

@@ -312,10 +334,10 @@ Syntax of <<family-name>>
312334
UAs must not consider these keywords as matching the <<family-name>> type.
313335

314336
<h4 id="generic-family-name-syntax">
315-
Syntax of <<generic-family-name>>
337+
Syntax of <<generic-family>>
316338
</h4>
317339

318-
<pre class=prod><l><<generic-family-name>></l> = generic( <<custom-ident>>+ ) | <<string>> | <<custom-ident>>+</pre>
340+
<pre class=prod><l><<generic-family>></l> = generic( <<custom-ident>>+ ) | <<string>> | <<custom-ident>>+</pre>
319341

320342
<div class="example" id="ex-generic-functional">
321343
More recently defined generic font families are identified using a functional syntax:
@@ -324,10 +346,11 @@ Syntax of <<generic-family-name>>
324346
body { font-family: "Adobe Fangsong Std R", generic(fangsong), serif}
325347
</pre>
326348

327-
The first choice in this example is a specific font in fangsong style.
349+
The first choice in this example is a specific font, in fangsong style.
328350
The family name is enclosed in quotes as it contains space characters.
329351
The second is a recently added generic font; it is unicode-range specific
330-
and so may not match to an actual installed font on some systems.
352+
and so may not match to an actual installed font on some systems;
353+
but if it exists it will be an example of the requested style.
331354
The third is a generic font, which is guaranteed to match on all systems.
332355
</div>
333356

0 commit comments

Comments
 (0)