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
+20-14Lines changed: 20 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -446,6 +446,10 @@ given a font family containing normal and bold faces along with a thin and a hea
446
446
Authors who desire finer control over the exact weight values used for a given element
447
447
can use numerical values instead of relative weights.
448
448
449
+
Note: There is a small behavior change between [[CSS-FONTS-3]] and this specification with the animation of the 'font-size' property.
450
+
Previously, interpolated values of font-weight were rounded to their closest multiple of 100, and the font-matching algorithm was run on these
451
+
rounded values. In this specification, the font-matching algorithm is able to accept any value, so no rounding occurs. The small behavior change is due to the discontinuous nature of the font-matching algorithm.
452
+
449
453
<h3 id="font-stretch-prop">
450
454
Font width: the 'font-stretch' property</h3>
451
455
@@ -2141,16 +2145,14 @@ if all font style properties were set to their initial value.
2141
2145
value of the 'font-synthesis' property.
2142
2146
2143
2147
2144
-
3. 'font-weight' is matched next. If a font does not have any concept of varying strengths of weights, its weight is mapped according list in the <a href="#font-weight-numeric-values">property definition</a>. If bolder/lighter relative weights are used, the effective weight is calculated based on the inherited weight value, as described in the definition of the 'font-weight'property. If the matching set after performing the steps above includes faces with weight values containing the font-weight desired value, faces with weight values which do not include the desired font-weight value are removed from the matching set. If there is no face which contains the desired value, a weight value is chosen using the rules below:
2148
+
3. 'font-weight' is matched next. If a font does not have any concept of varying strengths of weights, its weight is mapped according list in the <a href="#font-weight-numeric-values">property definition</a>. If bolder/lighter relative weights are used, the effective weight is calculated based on the inherited weight value, as described in the definition of the 'font-weight'property. If the matching set after performing the steps above includes faces with weight values containing the font-weight desired value, faces with weight values which do not include the desired font-weight value are removed from the matching set. If there is no face which contains the desired value, a weight value is chosen using the rules below:
2145
2149
2146
-
* If the desired weight is 400, 400 is checked first, 500 is checked second and then the rule for desired weights less than or equal to 500 is used.
2147
-
* If the desired weight is 500, 500 is checked first, 400 is checked second and then
2148
-
the rule for desired weights less than or equal to 500 is used.
2149
-
* If the desired weight is less than or equal to 500, weights below the
2150
+
* If the desired weight is inclusively between 400 and 500, weights greater than or equal to the target weight are checked in ascending order until 500 is hit and checked, followed by weights less than the target weight in descending order, followed by weights greater than 500, until a match is found.
2151
+
* If the desired weight is less than 400, weights less than or equal to the
2150
2152
desired weight are checked in descending order followed by
2151
2153
weights above the desired weight in ascending order until a
2152
2154
match is found.
2153
-
* If the desired weight is greater than 500, weights above the
2155
+
* If the desired weight is greater than 500, weights greater than or equal to the
2154
2156
desired weight are checked in ascending order followed by
2155
2157
weights below the desired weight in descending order until a
2156
2158
match is found.
@@ -2160,31 +2162,35 @@ if all font style properties were set to their initial value.
As you can see, because font B contains the minimum oblique value across the entire family, font B would be selected by this algorithm. However, if font B were somehow eliminated from the family, font D would then contain the lowest distance in the family, so it would be selected. If D were eliminated, A would be selected, followed by fonts C and then E.
2165
+
As you can see, because font B contains the minimum distance across the entire family, font B would be selected by this algorithm. However, if font B were somehow eliminated from the family, font D would then contain the lowest distance in the family, so it would be selected. If D were eliminated, A would be selected, followed by fonts C and then E.
2164
2166
</div>
2165
2167
2166
2168
<div class="example">
2167
-
Similar to the <a href="#ascendingstretch">previous example</a>, here is the conceptual distance graph for an element styled with "font-weight: 500":
2169
+
Similar to the <a href="#ascendingstretch">previous example</a>, here is the conceptual distance graph for an element styled with "font-weight: 450":
As you can see, because font D contains the minimum oblique value across the entire family, font D would be selected by this algorithm. However, if font D were somehow eliminated from the family, font B would then contain the lowest distance in the family, so it would be selected. If B were eliminated, C would be selected, followed by fonts A and then E.
2173
+
As you can see, because font C contains the minimum distance across the entire family, font C would be selected by this algorithm. However, if font C were somehow eliminated from the family, font D would then contain the lowest distance in the family, so it would be selected. If D were also eliminated, B would be selected, followed by fonts A and then E.
2172
2174
</div>
2173
2175
2174
-
Once the closest matching weight has been determined by this process,
2175
-
faces with weights which do not include this determined width are removed from the matching set.
2176
+
<div class="example">
2177
+
Similar to the <a href="#ascendingstretch">previous example</a>, here is the conceptual distance graph for an element styled with "font-weight: 500":
As you can see, because font D contains the minimum distance across the entire family, font D would be selected by this algorithm. However, if font D were somehow eliminated from the family, font B would then contain the lowest distance in the family, so it would be selected. If B were eliminated, C would be selected, followed by fonts A and then E.
2182
+
</div>
2177
2183
2178
2184
<div class="example">
2179
2185
Similar to the <a href="#ascendingstretch">previous example</a>, here is the conceptual distance graph for an element styled with "font-weight: 300":
As you can see, because font B contains the minimum oblique value across the entire family, font B would be selected by this algorithm. However, if font B were somehow eliminated from the family, font A would then contain the lowest distance in the family, so it would be selected. If A were eliminated, C would be selected.
2189
+
As you can see, because font B contains the minimum distance across the entire family, font B would be selected by this algorithm. However, if font B were somehow eliminated from the family, font A would then contain the lowest distance in the family, so it would be selected. If A were eliminated, C would be selected.
2184
2190
</div>
2185
2191
2186
2192
Once the closest matching weight has been determined by this process,
2187
-
faces with weights which do not include this determined width are removed from the matching set.
2193
+
faces with weights which do not include this determined weight are removed from the matching set.
2188
2194
2189
2195
4. 'font-size' must be
2190
2196
matched within a UA-dependent margin of tolerance. (Typically, sizes
0 commit comments