Skip to content

Commit 63e6dc0

Browse files
authored
Merge pull request #484 from w3c/fonts-5-fontface
Fonts 5 fontface
2 parents 14a7026 + 2b0dc49 commit 63e6dc0

15 files changed

+1216
-62
lines changed

org/w3c/css/properties/CSS3Properties.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,12 @@ lighting-color: org.w3c.css.properties.css3.CssLightingC
541541
@font-face.font-variation-settings: org.w3c.css.properties.css3.fontface.CssFontVariationSettings
542542
@font-face.font-weight: org.w3c.css.properties.css3.fontface.CssFontWeight
543543
@font-face.line-gap-override: org.w3c.css.properties.css3.fontface.CssLineGapOverride
544+
@font-face.size-adjust: org.w3c.css.properties.css3.fontface.CssSizeAdjust
544545
@font-face.src: org.w3c.css.properties.css3.fontface.CssSrc
546+
@font-face.subscript-position-override org.w3c.css.properties.css3.fontface.CssSubscriptPositionOverride
547+
@font-face.subscript-size-override org.w3c.css.properties.css3.fontface.CssSubscriptSizeOverride
548+
@font-face.superscript-position-override org.w3c.css.properties.css3.fontface.CssSuperscriptPositionOverride
549+
@font-face.superscript-size-override org.w3c.css.properties.css3.fontface.CssSuperscriptSizeOverride
545550
@font-face.unicode-range: org.w3c.css.properties.css3.fontface.CssUnicodeRange
546551

547552
// mediafeatures
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
//
2+
// Author: Yves Lafon <ylafon@w3.org>
3+
//
4+
// (c) COPYRIGHT W3C, 2026.
5+
// Please first read the full copyright statement in file COPYRIGHT.html
6+
7+
package org.w3c.css.properties.css.fontface;
8+
9+
import org.w3c.css.parser.CssStyle;
10+
import org.w3c.css.properties.css.CssProperty;
11+
import org.w3c.css.properties.css3.Css3Style;
12+
import org.w3c.css.util.ApplContext;
13+
import org.w3c.css.util.InvalidParamException;
14+
import org.w3c.css.values.CssExpression;
15+
import org.w3c.css.values.CssValue;
16+
17+
/**
18+
* @since CSS3
19+
*/
20+
public class CssSizeAdjust extends CssProperty {
21+
22+
public CssValue value;
23+
24+
/**
25+
* Create a new CssSizeAdjust
26+
*/
27+
public CssSizeAdjust() {
28+
}
29+
30+
/**
31+
* Creates a new CssSizeAdjust
32+
*
33+
* @param expression The expression for this property
34+
* @throws InvalidParamException Expressions are incorrect
35+
*/
36+
public CssSizeAdjust(ApplContext ac, CssExpression expression, boolean check)
37+
throws InvalidParamException {
38+
throw new InvalidParamException("value",
39+
expression.getValue().toString(),
40+
getPropertyName(), ac);
41+
}
42+
43+
public CssSizeAdjust(ApplContext ac, CssExpression expression)
44+
throws InvalidParamException {
45+
this(ac, expression, false);
46+
}
47+
48+
/**
49+
* Returns the value of this property
50+
*/
51+
public Object get() {
52+
return value;
53+
}
54+
55+
56+
/**
57+
* Returns the name of this property
58+
*/
59+
public final String getPropertyName() {
60+
return "size-adjust";
61+
}
62+
63+
/**
64+
* Returns true if this property is "softly" inherited
65+
* e.g. his value is equals to inherit
66+
*/
67+
public boolean isSoftlyInherited() {
68+
return value.equals(inherit);
69+
}
70+
71+
/**
72+
* Returns a string representation of the object.
73+
*/
74+
public String toString() {
75+
return value.toString();
76+
}
77+
78+
/**
79+
* Add this property to the CssStyle.
80+
*
81+
* @param style The CssStyle
82+
*/
83+
public void addToStyle(ApplContext ac, CssStyle style) {
84+
Css3Style s = (Css3Style) style;
85+
if (s.fontFaceCssSizeAdjust != null) {
86+
style.addRedefinitionWarning(ac, this);
87+
}
88+
s.fontFaceCssSizeAdjust = this;
89+
}
90+
91+
92+
/**
93+
* Compares two properties for equality.
94+
*
95+
* @param property The other property.
96+
*/
97+
public boolean equals(CssProperty property) {
98+
return (property instanceof CssSizeAdjust &&
99+
value.equals(((CssSizeAdjust) property).value));
100+
}
101+
102+
103+
/**
104+
* Get this property in the style.
105+
*
106+
* @param style The style where the property is
107+
* @param resolve if true, resolve the style to find this property
108+
*/
109+
public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
110+
if (resolve) {
111+
return ((Css3Style) style).getFontFaceCssSizeAdjust();
112+
} else {
113+
return ((Css3Style) style).fontFaceCssSizeAdjust;
114+
}
115+
}
116+
}
117+
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
//
2+
// Author: Yves Lafon <ylafon@w3.org>
3+
//
4+
// (c) COPYRIGHT MIT, ERCIM, Keio, Beihang, 2021.
5+
// Please first read the full copyright statement in file COPYRIGHT.html
6+
7+
package org.w3c.css.properties.css.fontface;
8+
9+
import org.w3c.css.parser.CssStyle;
10+
import org.w3c.css.properties.css.CssProperty;
11+
import org.w3c.css.properties.css3.Css3Style;
12+
import org.w3c.css.util.ApplContext;
13+
import org.w3c.css.util.InvalidParamException;
14+
import org.w3c.css.values.CssExpression;
15+
import org.w3c.css.values.CssValue;
16+
17+
/**
18+
* @since CSS3
19+
*/
20+
public class CssSubscriptPositionOverride extends CssProperty {
21+
22+
public CssValue value;
23+
24+
/**
25+
* Create a new CssSubscriptPositionOverride
26+
*/
27+
public CssSubscriptPositionOverride() {
28+
}
29+
30+
/**
31+
* Creates a new CssSubscriptPositionOverride
32+
*
33+
* @param expression The expression for this property
34+
* @throws InvalidParamException Expressions are incorrect
35+
*/
36+
public CssSubscriptPositionOverride(ApplContext ac, CssExpression expression, boolean check)
37+
throws InvalidParamException {
38+
throw new InvalidParamException("value",
39+
expression.getValue().toString(),
40+
getPropertyName(), ac);
41+
}
42+
43+
public CssSubscriptPositionOverride(ApplContext ac, CssExpression expression)
44+
throws InvalidParamException {
45+
this(ac, expression, false);
46+
}
47+
48+
/**
49+
* Returns the value of this property
50+
*/
51+
public Object get() {
52+
return value;
53+
}
54+
55+
56+
/**
57+
* Returns the name of this property
58+
*/
59+
public final String getPropertyName() {
60+
return "subscript-position-override";
61+
}
62+
63+
/**
64+
* Returns true if this property is "softly" inherited
65+
* e.g. his value is equals to inherit
66+
*/
67+
public boolean isSoftlyInherited() {
68+
return value.equals(inherit);
69+
}
70+
71+
/**
72+
* Returns a string representation of the object.
73+
*/
74+
public String toString() {
75+
return value.toString();
76+
}
77+
78+
/**
79+
* Add this property to the CssStyle.
80+
*
81+
* @param style The CssStyle
82+
*/
83+
public void addToStyle(ApplContext ac, CssStyle style) {
84+
Css3Style s = (Css3Style) style;
85+
if (s.fontFaceCssSubscriptPositionOverride != null) {
86+
style.addRedefinitionWarning(ac, this);
87+
}
88+
s.fontFaceCssSubscriptPositionOverride = this;
89+
}
90+
91+
92+
/**
93+
* Compares two properties for equality.
94+
*
95+
* @param property The other property.
96+
*/
97+
public boolean equals(CssProperty property) {
98+
return (property instanceof CssSubscriptPositionOverride &&
99+
value.equals(((CssSubscriptPositionOverride) property).value));
100+
}
101+
102+
103+
/**
104+
* Get this property in the style.
105+
*
106+
* @param style The style where the property is
107+
* @param resolve if true, resolve the style to find this property
108+
*/
109+
public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
110+
if (resolve) {
111+
return ((Css3Style) style).getFontFaceCssSubscriptPositionOverride();
112+
} else {
113+
return ((Css3Style) style).fontFaceCssSubscriptPositionOverride;
114+
}
115+
}
116+
}
117+
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
//
2+
// Author: Yves Lafon <ylafon@w3.org>
3+
//
4+
// (c) COPYRIGHT MIT, ERCIM, Keio, Beihang, 2021.
5+
// Please first read the full copyright statement in file COPYRIGHT.html
6+
7+
package org.w3c.css.properties.css.fontface;
8+
9+
import org.w3c.css.parser.CssStyle;
10+
import org.w3c.css.properties.css.CssProperty;
11+
import org.w3c.css.properties.css3.Css3Style;
12+
import org.w3c.css.util.ApplContext;
13+
import org.w3c.css.util.InvalidParamException;
14+
import org.w3c.css.values.CssExpression;
15+
import org.w3c.css.values.CssValue;
16+
17+
/**
18+
* @since CSS3
19+
*/
20+
public class CssSubscriptSizeOverride extends CssProperty {
21+
22+
public CssValue value;
23+
24+
/**
25+
* Create a new CssSubscriptSizeOverride
26+
*/
27+
public CssSubscriptSizeOverride() {
28+
}
29+
30+
/**
31+
* Creates a new CssSubscriptSizeOverride
32+
*
33+
* @param expression The expression for this property
34+
* @throws InvalidParamException Expressions are incorrect
35+
*/
36+
public CssSubscriptSizeOverride(ApplContext ac, CssExpression expression, boolean check)
37+
throws InvalidParamException {
38+
throw new InvalidParamException("value",
39+
expression.getValue().toString(),
40+
getPropertyName(), ac);
41+
}
42+
43+
public CssSubscriptSizeOverride(ApplContext ac, CssExpression expression)
44+
throws InvalidParamException {
45+
this(ac, expression, false);
46+
}
47+
48+
/**
49+
* Returns the value of this property
50+
*/
51+
public Object get() {
52+
return value;
53+
}
54+
55+
56+
/**
57+
* Returns the name of this property
58+
*/
59+
public final String getPropertyName() {
60+
return "subscript-size-override";
61+
}
62+
63+
/**
64+
* Returns true if this property is "softly" inherited
65+
* e.g. his value is equals to inherit
66+
*/
67+
public boolean isSoftlyInherited() {
68+
return value.equals(inherit);
69+
}
70+
71+
/**
72+
* Returns a string representation of the object.
73+
*/
74+
public String toString() {
75+
return value.toString();
76+
}
77+
78+
/**
79+
* Add this property to the CssStyle.
80+
*
81+
* @param style The CssStyle
82+
*/
83+
public void addToStyle(ApplContext ac, CssStyle style) {
84+
Css3Style s = (Css3Style) style;
85+
if (s.fontFaceCssSubscriptSizeOverride != null) {
86+
style.addRedefinitionWarning(ac, this);
87+
}
88+
s.fontFaceCssSubscriptSizeOverride = this;
89+
}
90+
91+
92+
/**
93+
* Compares two properties for equality.
94+
*
95+
* @param property The other property.
96+
*/
97+
public boolean equals(CssProperty property) {
98+
return (property instanceof CssSubscriptSizeOverride &&
99+
value.equals(((CssSubscriptSizeOverride) property).value));
100+
}
101+
102+
103+
/**
104+
* Get this property in the style.
105+
*
106+
* @param style The style where the property is
107+
* @param resolve if true, resolve the style to find this property
108+
*/
109+
public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
110+
if (resolve) {
111+
return ((Css3Style) style).getFontFaceCssSubscriptSizeOverride();
112+
} else {
113+
return ((Css3Style) style).fontFaceCssSubscriptSizeOverride;
114+
}
115+
}
116+
}
117+

0 commit comments

Comments
 (0)