All Packages Class Hierarchy This Package Previous Next Index
Class org.w3c.css.properties.CssFontFamily
java.lang.Object
|
+----org.w3c.css.properties.CssProperty
|
+----org.w3c.css.properties.CssFontFamily
- public class CssFontFamily
- extends CssProperty
- implements CssOperator
'font-family'
Value: [[<family-name> | <generic-family>],]*
[<family-name> | <generic-family>]
Initial: UA specific
Applies to: all elements
Inherited: yes
Percentage values: N/A
The value is a prioritized list of font family names and/or generic family
names. Unlike most other CSS1 properties, values are separated by a comma
to indicate that they are alternatives:
BODY { font-family: gill, helvetica, sans-serif }
There are two types of list values:
-
<family-name>
- The name of a font family of choice. In the last example, "gill" and
"helvetica" are font families.
-
<generic-family>
- In the example above, the last value is a generic family name. The
following generic families are defined:
-
'serif' (e.g. Times)
-
'sans-serif' (e.g. Helvetica)
-
'cursive' (e.g. Zapf-Chancery)
-
'fantasy' (e.g. Western)
-
'monospace' (e.g. Courier)
Style sheet designers are encouraged to offer a generic font family
as a last alternative.
Font names containing whitespace should be quoted:
BODY { font-family: "new century schoolbook", serif }
<BODY STYLE="font-family: 'My own font', fantasy">
If quoting is omitted, any whitespace characters before and after the font
name are ignored and any sequence of whitespace characters inside the font
name is converted to a single space.
- See Also:
- CssFont
-
CssFontFamily()
- Create a new CssFontFamily
-
CssFontFamily(CssExpression)
- Create a new CssFontFamily
-
addToStyle(CssStyle)
- Add this property to the CssStyle.
-
containsGenericFamily()
- Returns true if this property contains a generic family name
-
elements()
- Returns all fonts name
-
equals(CssProperty)
- Compares two properties for equality.
-
get()
- Returns the font (null if no font)
-
getPropertyInStyle(CssStyle, boolean)
- Get this property in the style.
-
getPropertyName()
- Returns the name of this property
-
isSoftlyInherited()
- Returns true if this property is "softly" inherited
e.g.
-
size()
- Returns the size
-
toString()
- Returns a string representation of the object.
CssFontFamily
public CssFontFamily()
- Create a new CssFontFamily
CssFontFamily
public CssFontFamily(CssExpression expression) throws InvalidParamException
- Create a new CssFontFamily
- Parameters:
- expression - the font name
- Throws: InvalidParamException
- The expression is incorrect
elements
public Enumeration elements()
- Returns all fonts name
size
public int size()
- Returns the size
get
public Object get()
- Returns the font (null if no font)
- Overrides:
- get in class CssProperty
isSoftlyInherited
public boolean isSoftlyInherited()
- Returns true if this property is "softly" inherited
e.g. his value equals inherit
- Overrides:
- isSoftlyInherited in class CssProperty
toString
public String toString()
- Returns a string representation of the object.
- Overrides:
- toString in class CssProperty
getPropertyName
public String getPropertyName()
- Returns the name of this property
- Overrides:
- getPropertyName in class CssProperty
addToStyle
public void addToStyle(CssStyle style)
- Add this property to the CssStyle.
- Parameters:
- style - The CssStyle
- Overrides:
- addToStyle in class CssProperty
getPropertyInStyle
public CssProperty getPropertyInStyle(CssStyle style,
boolean resolve)
- Get this property in the style.
- Parameters:
- style - The style where the property is
- resolve - if true, resolve the style to find this property
- Overrides:
- getPropertyInStyle in class CssProperty
equals
public boolean equals(CssProperty property)
- Compares two properties for equality.
- Parameters:
- value - The other property.
- Overrides:
- equals in class CssProperty
containsGenericFamily
public boolean containsGenericFamily()
- Returns true if this property contains a generic family name
All Packages Class Hierarchy This Package Previous Next Index