Skip to content

Commit c8043c1

Browse files
authored
Merge pull request #335 from w3c/font-face-4
Font face 4
2 parents 8a314d2 + cb6c2a8 commit c8043c1

31 files changed

+2716
-58
lines changed

org/w3c/css/properties/CSS3Properties.properties

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -498,31 +498,20 @@ flood-color: org.w3c.css.properties.css3.CssFloodColo
498498
flood-opacity: org.w3c.css.properties.css3.CssFloodOpacity
499499
lighting-color: org.w3c.css.properties.css3.CssLightingColor
500500

501-
@font-face.unicode-range: org.w3c.css.properties.css2.font.UnicodeRange
502-
@font-face.units-per-em: org.w3c.css.properties.css2.font.UnitsPerEm
503-
@font-face.src: org.w3c.css.properties.css3.fontface.CssSrc
504-
@font-face.panose-1: org.w3c.css.properties.css2.font.Panose1
505-
@font-face.stemv: org.w3c.css.properties.css2.font.Stemv
506-
@font-face.stemh: org.w3c.css.properties.css2.font.Stemh
507-
@font-face.slope: org.w3c.css.properties.css2.font.Slope
508-
@font-face.cap-height: org.w3c.css.properties.css2.font.CapHeight
509-
@font-face.x-hegiht: org.w3c.css.properties.css2.font.XHeight
510-
@font-face.widths: org.w3c.css.properties.css2.font.Widths
511-
@font-face.ascent: org.w3c.css.properties.css2.font.Ascent
512-
@font-face.descent: org.w3c.css.properties.css2.font.Descent
513-
@font-face.bbox: org.w3c.css.properties.css2.font.Bbox
514-
@font-face.baseline: org.w3c.css.properties.css2.font.Baseline
515-
@font-face.centerline: org.w3c.css.properties.css2.font.Centerline
516-
@font-face.definition-src: org.w3c.css.properties.css2.font.DefinitionSrc
517-
@font-face.mathline: org.w3c.css.properties.css2.font.Mathline
518-
@font-face.topline: org.w3c.css.properties.css2.font.Topline
519-
@font-face.font-style: org.w3c.css.properties.css2.font.FontStyle
520-
@font-face.font-variant: org.w3c.css.properties.css2.font.FontVariant
521-
@font-face.font-weight: org.w3c.css.properties.css2.font.FontWeight
522-
@font-face.font-size: org.w3c.css.properties.css2.font.FontSize
523-
@font-face.font-family: org.w3c.css.properties.css2.font.FontFamily
524-
@font-face.font-stretch: org.w3c.css.properties.css2.font.FontStretch
501+
@font-face.ascent-override: org.w3c.css.properties.css3.fontface.CssAscentOverride
502+
@font-face.descent-override: org.w3c.css.properties.css3.fontface.CssDescentOverride
525503
@font-face.font-display: org.w3c.css.properties.css3.fontface.CssFontDisplay
504+
@font-face.font-family: org.w3c.css.properties.css3.fontface.CssFontFamily
505+
@font-face.font-feature-settings: org.w3c.css.properties.css3.fontface.CssFontFeatureSettings
506+
@font-face.font-language-override: org.w3c.css.properties.css3.fontface.CssFontLanguageOverride
507+
@font-face.font-named-instance org.w3c.css.properties.css3.fontface.CssFontNamedInstance
508+
@font-face.font-stretch: org.w3c.css.properties.css3.fontface.CssFontStretch
509+
@font-face.font-style: org.w3c.css.properties.css3.fontface.CssFontStyle
510+
@font-face.font-variation-settings: org.w3c.css.properties.css3.fontface.CssFontVariationSettings
511+
@font-face.font-weight: org.w3c.css.properties.css3.fontface.CssFontWeight
512+
@font-face.line-gap-override: org.w3c.css.properties.css3.fontface.CssLineGapOverride
513+
@font-face.src: org.w3c.css.properties.css3.fontface.CssSrc
514+
@font-face.unicode-range: org.w3c.css.properties.css3.fontface.CssUnicodeRange
526515

527516
// mediafeatures
528517
mf.any-hover: org.w3c.css.atrules.css3.media.MediaAnyHover
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
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 CssAscentOverride extends CssProperty {
21+
22+
public CssValue value;
23+
24+
/**
25+
* Create a new CssAscentOverride
26+
*/
27+
public CssAscentOverride() {
28+
}
29+
30+
/**
31+
* Creates a new CssAscentOverride
32+
*
33+
* @param expression The expression for this property
34+
* @throws InvalidParamException
35+
* Expressions are incorrect
36+
*/
37+
public CssAscentOverride(ApplContext ac, CssExpression expression, boolean check)
38+
throws InvalidParamException {
39+
throw new InvalidParamException("value",
40+
expression.getValue().toString(),
41+
getPropertyName(), ac);
42+
}
43+
44+
public CssAscentOverride(ApplContext ac, CssExpression expression)
45+
throws InvalidParamException {
46+
this(ac, expression, false);
47+
}
48+
49+
/**
50+
* Returns the value of this property
51+
*/
52+
public Object get() {
53+
return value;
54+
}
55+
56+
57+
/**
58+
* Returns the name of this property
59+
*/
60+
public final String getPropertyName() {
61+
return "ascent-override";
62+
}
63+
64+
/**
65+
* Returns true if this property is "softly" inherited
66+
* e.g. his value is equals to inherit
67+
*/
68+
public boolean isSoftlyInherited() {
69+
return value.equals(inherit);
70+
}
71+
72+
/**
73+
* Returns a string representation of the object.
74+
*/
75+
public String toString() {
76+
return value.toString();
77+
}
78+
79+
/**
80+
* Add this property to the CssStyle.
81+
*
82+
* @param style The CssStyle
83+
*/
84+
public void addToStyle(ApplContext ac, CssStyle style) {
85+
Css3Style s = (Css3Style) style;
86+
if (s.fontFaceCssAscentOverride != null) {
87+
style.addRedefinitionWarning(ac, this);
88+
}
89+
s.fontFaceCssAscentOverride = this;
90+
}
91+
92+
93+
/**
94+
* Compares two properties for equality.
95+
*
96+
* @param property The other property.
97+
*/
98+
public boolean equals(CssProperty property) {
99+
return (property instanceof CssAscentOverride &&
100+
value.equals(((CssAscentOverride) property).value));
101+
}
102+
103+
104+
/**
105+
* Get this property in the style.
106+
*
107+
* @param style The style where the property is
108+
* @param resolve if true, resolve the style to find this property
109+
*/
110+
public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
111+
if (resolve) {
112+
return ((Css3Style) style).getFontFaceCssAscentOverride();
113+
} else {
114+
return ((Css3Style) style).fontFaceCssAscentOverride;
115+
}
116+
}
117+
}
118+
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
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 CssDescentOverride extends CssProperty {
21+
22+
public CssValue value;
23+
24+
/**
25+
* Create a new CssDescentOverride
26+
*/
27+
public CssDescentOverride() {
28+
}
29+
30+
/**
31+
* Creates a new CssDescentOverride
32+
*
33+
* @param expression The expression for this property
34+
* @throws InvalidParamException
35+
* Expressions are incorrect
36+
*/
37+
public CssDescentOverride(ApplContext ac, CssExpression expression, boolean check)
38+
throws InvalidParamException {
39+
throw new InvalidParamException("value",
40+
expression.getValue().toString(),
41+
getPropertyName(), ac);
42+
}
43+
44+
public CssDescentOverride(ApplContext ac, CssExpression expression)
45+
throws InvalidParamException {
46+
this(ac, expression, false);
47+
}
48+
49+
/**
50+
* Returns the value of this property
51+
*/
52+
public Object get() {
53+
return value;
54+
}
55+
56+
57+
/**
58+
* Returns the name of this property
59+
*/
60+
public final String getPropertyName() {
61+
return "descent-override";
62+
}
63+
64+
/**
65+
* Returns true if this property is "softly" inherited
66+
* e.g. his value is equals to inherit
67+
*/
68+
public boolean isSoftlyInherited() {
69+
return value.equals(inherit);
70+
}
71+
72+
/**
73+
* Returns a string representation of the object.
74+
*/
75+
public String toString() {
76+
return value.toString();
77+
}
78+
79+
/**
80+
* Add this property to the CssStyle.
81+
*
82+
* @param style The CssStyle
83+
*/
84+
public void addToStyle(ApplContext ac, CssStyle style) {
85+
Css3Style s = (Css3Style) style;
86+
if (s.fontFaceCssDescentOverride != null) {
87+
style.addRedefinitionWarning(ac, this);
88+
}
89+
s.fontFaceCssDescentOverride = this;
90+
}
91+
92+
93+
/**
94+
* Compares two properties for equality.
95+
*
96+
* @param property The other property.
97+
*/
98+
public boolean equals(CssProperty property) {
99+
return (property instanceof CssDescentOverride &&
100+
value.equals(((CssDescentOverride) property).value));
101+
}
102+
103+
104+
/**
105+
* Get this property in the style.
106+
*
107+
* @param style The style where the property is
108+
* @param resolve if true, resolve the style to find this property
109+
*/
110+
public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
111+
if (resolve) {
112+
return ((Css3Style) style).getFontFaceCssDescentOverride();
113+
} else {
114+
return ((Css3Style) style).fontFaceCssDescentOverride;
115+
}
116+
}
117+
}
118+

0 commit comments

Comments
 (0)