Skip to content

Commit 09ab9f9

Browse files
svgeesusnschonni
authored andcommitted
[css-fonts-5] Start level 5 as CSSWG resolved to put stuff there today w3c#126
1 parent ffe8b14 commit 09ab9f9

File tree

1 file changed

+293
-0
lines changed

1 file changed

+293
-0
lines changed

css-fonts-5/Overview.bs

Lines changed: 293 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,293 @@
1+
2+
Title: CSS Fonts Module Level 5
3+
Shortname: css-fonts
4+
Level: 5
5+
Status: ED
6+
Work Status: exploring
7+
Group: CSSWG
8+
ED: https://drafts.csswg.org/css-fonts-5/
9+
TR: https://www.w3.org/TR/css-fonts-5/
10+
!Delta Spec: yes
11+
Editor: Myles C. Maxfield, Apple Inc., [email protected], w3cid 77180
12+
Editor: Chris Lilley, W3C, http://svgees.us, w3cid 1438
13+
Abstract: This specification defines modifications to the existing CSS Fonts 4 specification along with additional features.
14+
Repository: w3c/csswg-drafts
15+
Inline Github Issues: title
16+
Default Highlight: css
17+
Warning: Not Ready
18+
19+
20+
21+
spec:css-color-4; type:property; text:color
22+
spec:css-values; type:value; text:ex
23+
spec:css22; type:value; for:/; text:block
24+
spec:html; type:element; text:font
25+
spec:css-fonts-4; type:descriptor; text:font-language-override
26+
27+
28+
29+

30+
Introduction
31+
32+
The CSS Fonts Level 4 specification ([[!CSS-FONTS-4]]) describes the
33+
controls CSS provides for selecting and using fonts within documents,
34+
including support for variable fonts and color fonts.
35+
The ideas here are additions or modifications to the properties and
36+
rules defined in CSS Fonts Level 4.
37+
38+
This specification is currently a delta to the CSS Fonts Level 4 specification.
39+
Do not assume that if something is not here, it has been dropped.
40+
41+
42+
43+

44+
Value Definitions
45+
46+
This specification follows the CSS property definition conventions from [[!CSS2]]
47+
using the value definition syntax from [[!CSS-VALUES-3]].
48+
Value types not defined in this specification are defined in CSS Values & Units [[!CSS-VALUES-3]].
49+
Combination with other CSS modules may expand the definitions of these value types.
50+
51+
In addition to the property-specific values listed in their definitions,
52+
all properties defined in this specification
53+
also accept the CSS-wide keywords as their property value.
54+
For readability they have not been repeated explicitly.
55+
56+

57+
Basic Font Properties
58+
59+

60+
Font family: the 'font-family!!property' property
61+
62+

63+
Generic font families
64+
65+
In addition to the [[css-fonts-4#generic-font-families]]
66+
in CSS Fonts Level 4, the following new generic font families are also defined.
67+
68+
Issue(4910):
69+
70+
Issue(5054):
71+
72+
73+
xxx
74+
75+
Placeholder text for the xxx generic font family.
76+
77+
78+
79+
80+
Issue(4566):
81+
82+

Font weight: the 'font-weight!!property' property

83+
84+
Issue(2690):
85+
86+
87+

88+
Font style: the 'font-style!!property' property
89+
90+
Issue(4044):
91+
92+
93+

94+
Relative sizing: the 'font-size-adjust' property
95+
96+
Issue(5539):
97+
98+
99+

100+
Font Resources
101+
102+

103+
The ''@font-face'' rule
104+
105+
Issue(5518):
106+
107+
108+

109+
Font property descriptors: the 'font-size!!descriptor'
110+
111+
112+
Issue(806):
113+
114+
Issue(731):
115+
116+
Issue(5892):
117+
118+
119+
120+
121+

122+
Default font metrics overriding:
123+
the 'ascent-override', 'descent-override' and 'line-gap-override' descriptors
124+
125+
126+
Name: ascent-override
127+
Value: normal | <>
128+
For: @font-face
129+
Initial: normal
130+
131+
132+
133+
Name: descent-override
134+
Value: normal | <>
135+
For: @font-face
136+
Initial: normal
137+
138+
139+
140+
Name: line-gap-override
141+
Value: normal | <>
142+
For: @font-face
143+
Initial: normal
144+
145+
146+
The 'ascent-override', 'descent-override' and 'line-gap-override' descriptors define the
147+
148+
line gap metric of the font, respectively.
149+
150+
When the descriptor value is 'normal', the corresponding metric value is obtained from the
151+
font file directly.
152+
153+
Note: User agents may draw data from different places from the font file as the metric values,
154+
which results in different text layouts.
155+
156+
When the descriptor value is a percentage, the corresponding metric value is resolved as the
157+
given percentage multiplied by the used font size. Negative values are invalid at parse time.
158+
159+
160+
The percentage is resolved against different font sizes for different elements.
161+
162+
163+
@font-face {
164+
font-family: overridden-font;
165+
ascent-override: 50%;
166+
...
167+
}
168+
169+
<span style="font-family: overridden-font; font-size: 20px;">
170+
Outer span content
171+
<span style="font-size: 150%;">Inner span content</span>
172+
</span>
173+
174+
175+
The outer span uses an ascent value of
176+
10px, whereas the inner span uses 15px.
177+
178+
179+
180+
181+
We may override the metrics of a local fallback font to match the primary font, which
182+
is a web font. This reduces layout shifting when switching from fallback to the
183+
primary font.
184+
185+
186+
@font-face {
187+
font-family: cool-web-font;
188+
src: url("https://example.com/font.woff");
189+
}
190+
191+
@font-face {
192+
font-family: fallback-to-local;
193+
src: local(Some Local Font);
194+
/* Override metric values to match cool-web-font */
195+
ascent-override: 125%;
196+
descent-override: 25%;
197+
line-gap-override: 0%;
198+
}
199+
200+
<div style="font-family: cool-web-font, fallback-to-local">Title goes here</div>
201+
<img src="https://example.com/largeimage" alt="A large image that you don't want to shift">
202+
203+
204+
The image will not be vertically shifted when the user agent finishes loading and
205+
switches to use the web font.
206+
207+
208+
209+

210+
Default font metrics overriding:
211+
the 'superscript-position-override', 'subscript-position-override','superscript-size-override' and 'subscript-size-override' descriptors
212+
213+
Issue(5518):
214+
215+
216+
Name: superscript-position-override
217+
Value: normal | <>
218+
For: @font-face
219+
Initial: normal
220+
221+
222+
223+
Name: subscript-position-override
224+
Value: normal | <>
225+
For: @font-face
226+
Initial: normal
227+
228+
229+
230+
Name: superscript-size-override
231+
Value: normal | <>
232+
For: @font-face
233+
Initial: normal
234+
235+
236+
237+
Name: subscript-size-override
238+
Value: normal | <>
239+
For: @font-face
240+
Initial: normal
241+
242+
243+
244+
245+

246+
Font Feature Properties
247+
248+
249+

Font language override: the 'font-language-override' property

250+
251+
Issue(5484):
252+
253+
254+

255+
Font Feature and Variation Resolution
256+
257+
Issue(5635):
258+
259+
260+

261+
Font Variation Properties
262+
263+
264+

265+
Optical sizing control: the 'font-optical-sizing' property
266+
267+
Issue(5466):
268+
269+
270+
271+
275+
276+
277+

278+
Security and Privacy Considerations
279+
280+
281+
No new security or privacy considerations have been raised on this specification.
282+
283+
284+

285+
Acknowledgments
286+
287+
The CSS Working group would like to thank:
288+
289+
290+

291+
Changes
292+
293+
-->

0 commit comments

Comments
 (0)