You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: css-fonts-4/Overview.bs
+57-37Lines changed: 57 additions & 37 deletions
Original file line number
Diff line number
Diff line change
@@ -251,7 +251,7 @@ at least as dark as its predecessor. Only values between 1 - 999 are valid, and
251
251
<a href="#font-matching-algorithm">font matching section below</a> for the
252
252
precise algorithm). For TrueType / OpenType fonts which use variations, the "wdth"
253
253
variation is used to implement varying widths. The figure below shows how nine
254
-
font-stretch property settings affect font selection for font family
254
+
font-stretch property settings affect font matching for font family
255
255
containing a variety of discrete widths. Grey indicates a width for which no
256
256
face exists and a different width is substituted:
257
257
@@ -284,23 +284,23 @@ at least as dark as its predecessor. Only values between 1 - 999 are valid, and
284
284
<dl dfn-for=font-style dfn-type=value>
285
285
<dt><dfn>normal</dfn></dt>
286
286
<dd>
287
-
Selects a face that is classified as a normal face, one that is neither italic or obliqued. This represents an oblique value of "0".
287
+
Matches against a face that is classified as a normal face, one that is neither italic or obliqued. This represents an oblique value of "0".
288
288
</dd>
289
289
290
290
<dt><dfn>italic</dfn></dt>
291
291
<dd>
292
-
selects a font that is labeled as an oblique face, or an italic face if one is not.
292
+
Matches against a font that is labeled as an oblique face, or an italic face if one is not.
293
293
</dd>
294
294
295
295
<dt><dfn>oblique <<angle>>?</dfn></dt>
296
296
<dd>
297
-
Controls the selection of an oblique face. The lack of a number represents an angle of "20deg". Values less than or equal to -90deg or values greater than or equal to 90deg are invalid and are treated as parse errors. (Note that a font may internally provide its own mapping for "oblique", but that mapping within the font is disregarded)
297
+
Controls matching against an oblique face. The lack of a number represents an angle of "20deg". Values less than or equal to -90deg or values greater than or equal to 90deg are invalid and are treated as parse errors. (Note that a font may internally provide its own mapping for "oblique", but that mapping within the font is disregarded)
298
298
</dd>
299
299
</dl>
300
300
301
301
Some font families may contain only zero or one italic or oblique face, while yet other
302
302
families may contain multiple oblique faces with varying
303
-
angles. The font selection routine will select a font to use which
303
+
angles. The font matching routine will select a font to use which
304
304
is closest to the requested angle. In general, for a requested angle greater
305
305
or equal to 20deg, larger angles are prefered; otherwise, smaller
306
306
angles are preferred (see the
@@ -353,7 +353,9 @@ at least as dark as its predecessor. Only values between 1 - 999 are valid, and
353
353
is a prioritized, comma-separated list of external references or
354
354
locally-installed font face names. When a font is needed the user
355
355
agent iterates over the set of references listed, using the first one
356
-
it can successfully activate. Fonts containing invalid data or local
356
+
it can successfully activate. Activation of a font involves downloading
357
+
the file or reading it from disk, parsing it, and perhaps additional user-agent-dependent steps.
358
+
Fonts containing invalid data or local
357
359
font faces that are not found are ignored and the user agent loads the
358
360
next font in the list.
359
361
@@ -585,37 +587,43 @@ at least as dark as its predecessor. Only values between 1 - 999 are valid, and
These descriptors define the characteristics of a font face and are
609
-
used in the process of matching styles to specific faces. For a font
611
+
used in the process of matching styles to specific faces. For a font
610
612
family defined with several <code>@font-face</code> rules, user agents can either
611
613
download all faces in the family or use these descriptors to selectively
612
-
download font faces that match actual styles used in document. The
613
-
values for these descriptors are the same as those for the corresponding
614
+
download font faces that match actual styles used in document. The
615
+
meaning of the values for these descriptors are the same as those for the corresponding
614
616
font properties except that relative keywords are not allowed, 'bolder' and
615
-
'lighter'. If these descriptors are omitted, initial
617
+
'lighter'. If these descriptors are omitted, initial
616
618
values are assumed. If specified values are out of range of the accepted values
617
619
of the property of the same name, the descriptor is treated as a parse error.
618
620
621
+
Ranges are accepted in these three descriptors in place of a single value. Where a single
622
+
value is specified, it has the same meaning as a range with identical startpoint and
623
+
endpoint. User agents may swap the computed value of the startpoint and endpoint of the range
624
+
in order to forbid decreasing ranges. Both endpoints are inclusive.
625
+
The ranges are used in the <a href="#font-matching-algorithm">Font Matching Algorithm</a> below.
626
+
619
627
The value for these font face style attributes is used in place of
620
628
the style implied by the underlying font data. This allows authors to
621
629
combine faces in flexible combinations, even in situations where the
@@ -784,8 +792,8 @@ at least as dark as its predecessor. Only values between 1 - 999 are valid, and
784
792
selected by this algorithm, particular values for
785
793
'font-stretch', 'font-style', and 'font-weight' must be applied
786
794
before any layout or rendering occurs. The application of these values
787
-
must be applied in the <a href="#apply-font-selection-variations">Apply
788
-
font selection variations</a> step detailed in
795
+
must be applied in the <a href="#apply-font-matching-variations">Apply
796
+
font matching variations</a> step detailed in
789
797
<a href="#font-feature-variation-resolution">Font Feature and Variation
790
798
Resolution</a>.
791
799
A group
@@ -798,10 +806,10 @@ at least as dark as its predecessor. Only values between 1 - 999 are valid, and
798
806
<li>'font-stretch' is tried first. If a font
799
807
does not have any concept of varying strengths of stretch values, its stretch value
800
808
is mapped according table in the <a href="#stretchmappings">property definition</a>.
801
-
If the matching set contains faces with width values
802
-
matching the 'font-stretch' value, faces with other width
809
+
If the matching set includes faces with width values
810
+
containing the 'font-stretch' desired value, faces with other width
803
811
values are removed from the matching set. If there is no face
804
-
that exactly matches, a stretch value is chosen using the rules below:
812
+
which contains the desired value, a stretch value is chosen using the rules below:
805
813
<ul>
806
814
<li>If the desired stretch value is less than 100, stretch values below the
807
815
desired stretch value are checked in descending order followed by
@@ -814,14 +822,14 @@ at least as dark as its predecessor. Only values between 1 - 999 are valid, and
814
822
</ul>
815
823
Once the
816
824
closest matching width has been determined by this process,
817
-
faces with other widths are removed from the matching set.
825
+
faces with widths which do not include this determined width are removed from the matching set.
818
826
</li>
819
827
820
828
<li>'font-style' is tried next.
821
829
If the value of 'font-style' is 'italic', italic faces are
822
830
checked first, then oblique, then normal faces. If the value
823
831
is 'oblique', oblique faces are checked first, then italic
824
-
faces and then normal faces. If the value is 'normal',
832
+
faces and then normal faces. If the value is 'normal',
825
833
normal faces are checked first, then oblique faces, then
826
834
italic faces. When checking oblique faces, an oblique angle is chosen using the rules below:
827
835
<ul>
@@ -833,11 +841,13 @@ at least as dark as its predecessor. Only values between 1 - 999 are valid, and
833
841
are checked in descending order until 0deg or a negative value is reached.
834
842
<li>Otherwise, the same steps as above are performed, substituting negative values for the positive ones above.</li>
835
843
</ul>
836
-
During this operation, if a font does not have any concept of varying oblique angles, it is assumed to have an angle of 20deg. Faces with other style values are excluded
837
-
from the matching set. User agents are permitted to
844
+
During this operation, if an oblique font does not have any concept of varying oblique angles, it is assumed to have an angle of 20deg.
845
+
If the search for a normal or italic face successfully determined a font, faces with other style values are excluded
846
+
from the matching set. Otherwise, if the search for an oblique face successfully determined a font, fonts with oblique angles which do not include
847
+
this determined angle are excluded from the matching set. User agents are permitted to
838
848
distinguish between italic and oblique faces within platform
839
849
font families but this is not required, so all
840
-
italic or oblique faces may be treated as italic faces. However, within font
850
+
italic or oblique faces may be treated as italic faces or oblique faces with an angle of 20deg. However, within font
841
851
families defined via <code>@font-face</code> rules, italic and oblique
842
852
faces must be distinguished using the value of the
843
853
'font-style' descriptor.
@@ -853,9 +863,9 @@ at least as dark as its predecessor. Only values between 1 - 999 are valid, and
853
863
If bolder/lighter relative weights are used, the
854
864
effective weight is calculated based on the inherited weight
855
865
value, as described in the definition of the 'font-weight'
856
-
property. Given the desired weight and the weights of faces
866
+
property. Given the desired weight and the weight ranges of faces
857
867
in the matching set after the steps above, if the desired
858
-
weight is available that face matches. Otherwise, a weight
868
+
weight is available inside the weight range of a font in the matching set, then that face matches. Otherwise, a weight
859
869
is chosen using the rules below:
860
870
<ul>
861
871
<li>If the desired weight is 400, 500 is checked first and then
@@ -872,6 +882,8 @@ at least as dark as its predecessor. Only values between 1 - 999 are valid, and
872
882
weights below the desired weight in descending order until a
873
883
match is found.</li>
874
884
</ul>
885
+
Once the closest matching weight has been determined by this process,
886
+
faces with weights which do not include this determined width are removed from the matching set.
875
887
</li>
876
888
877
889
<li>'font-size' must be
@@ -884,6 +896,11 @@ at least as dark as its predecessor. Only values between 1 - 999 are valid, and
884
896
</li>
885
897
886
898
</ol>
899
+
Note that more than one font may be remaining in the matching set after performing
900
+
the above steps. If so, the user agent must choose a single font from
901
+
the matching set and continue these steps with it. The choice of which
902
+
font to choose may differ between multiple user agents and multiple operating
903
+
system platforms; however, it must not differ between two elements in the same document.
887
904
</li>
888
905
889
906
<li><p>If the matched face is defined via <code>@font-face</code>
@@ -992,7 +1009,7 @@ at least as dark as its predecessor. Only values between 1 - 999 are valid, and
992
1009
<ol>
993
1010
<li>Font features enabled by default, including features required for a given script.</li>
994
1011
995
-
<li id="apply-font-selection-variations">Font variations as enabled by the 'font-weight',
1012
+
<li id="apply-font-matching-variations">Font variations as enabled by the 'font-weight',
996
1013
'font-stretch', and 'font-style' properties.</li>
997
1014
998
1015
<li>If the font is defined via an <code>@font-face</code> rule, the font features
@@ -1126,8 +1143,6 @@ at least as dark as its predecessor. Only values between 1 - 999 are valid, and
Issue: For all the various kinds of zooms, describe whether font-optical-sizing is re-applied (layout-time) or not (paint scaling).
1130
-
1131
1146
<pre class="propdef">
1132
1147
Name: font-optical-sizing
1133
1148
Value: auto | none
@@ -1149,6 +1164,10 @@ at least as dark as its predecessor. Only values between 1 - 999 are valid, and
1149
1164
<dd>The user agent must not modify the shape of glyphs for optical size.</dd>
1150
1165
</dl>
1151
1166
1167
+
Pixel density as well as visual size of the text may influence the variation value chosen for 'font-optical-sizing'. When either pixel density or visual size of the text changes in response to a user operation or style change, user agents may choose a new value for this variation value only if the change is layout-causing. User agents are free to determine which changes are layout-causing.
1168
+
1169
+
Note: Some user operations, such as pinch-zoom, may be considered not-layout-causing if they do not cause text to reflow. However, other user operations, such as increasing text size for accessiblity purposes, may be considered layout-causing because they cause text to reflow. Similarly, the 'transform' property may be considered not-layout-causing because transforms generally do not cause text to reflow. Each user-agent is free to decide whether or not each operation is layout-changing or not.
1170
+
1152
1171
<div class="figure"><img alt="text with and without 'font-optical-size'" src="fontopticalsize.png" /><p class="caption">Text with and without the use of 'font-optical-size'</p></div>
1153
1172
1154
1173
<h3>Low-level font variation settings control: the 'font-variation-settings' property</h3>
@@ -1175,7 +1194,7 @@ at least as dark as its predecessor. Only values between 1 - 999 are valid, and
1175
1194
property for special cases where its use is the only way of accessing
1176
1195
a particular infrequently used font variation.
1177
1196
1178
-
A value of 'normal' means that no change in glyph shape, selection, or positioning occurs due to this property.
1197
+
A value of 'normal' means that no change in glyph shape, matching, or positioning occurs due to this property.
1179
1198
1180
1199
The <<string>> is a case-sensitive OpenType or TrueType variation axis name. As
1181
1200
specified in the OpenType / TrueType specifications, axis names contain four
@@ -1187,14 +1206,13 @@ at least as dark as its predecessor. Only values between 1 - 999 are valid, and
Axis values not present in the fontare ignored and therefore have no effect on font selection; a user agent must
1191
-
not attempt to synthesize fallback behavior based on these feature
1192
-
tags.
1209
+
Axis values not present in the font, or axis values greater or less than the range supported by the font, are ignored and therefore have no effect; a user agent must
1210
+
not attempt to synthesize fallback behavior based on these feature tags. Other axis values
1211
+
within the same CSS 'font-variation-settings' statement are not ignored.
1193
1212
1194
1213
Values are allowed to be fractional or negative.
1195
1214
1196
-
When values greater or less than the range supported by the font are
1197
-
specified, the value is ignored and therefore has no effect on font selection.
1215
+
If the same axis name appears twice, the second one supercedes the first.
1198
1216
1199
1217
Although specifically defined for OpenType / TrueType variations, variation axes
1200
1218
for other modern font formats that support font variations may be
@@ -1203,9 +1221,11 @@ at least as dark as its predecessor. Only values between 1 - 999 are valid, and
1203
1221
1204
1222
Animating font-variation-settings is possible using a mechanism similar to animating
1205
1223
the 'transform' property: Two declarations of font-feature-settings can be animated between
1206
-
if they are "like". "Like" declarations are ones where the same sequence of properties appear
1207
-
in the same order. If two declarations are "like" then animation occurs pairwise between
1208
-
corresponding values in the declarations.
1224
+
if they are "like". "Like" declarations are ones where the same set of properties appear (in any order).
1225
+
If two declarations are "like" then animation occurs pairwise between
1226
+
corresponding values in the declarations. Otherwise, animation is not possible. In this situation,
1227
+
the "from" values of the animation are swapped to the "to" values at an unspecified time during
1228
+
the animation.
1209
1229
1210
1230
<h2 id="platform-props-to-css" class="no-num">Appendix A: Mapping platform font properties to CSS properties</h2>
0 commit comments