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:

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

Constructor Index

 o CssFontFamily()
Create a new CssFontFamily
 o CssFontFamily(CssExpression)
Create a new CssFontFamily

Method Index

 o addToStyle(CssStyle)
Add this property to the CssStyle.
 o containsGenericFamily()
Returns true if this property contains a generic family name
 o elements()
Returns all fonts name
 o equals(CssProperty)
Compares two properties for equality.
 o get()
Returns the font (null if no font)
 o getPropertyInStyle(CssStyle, boolean)
Get this property in the style.
 o getPropertyName()
Returns the name of this property
 o isSoftlyInherited()
Returns true if this property is "softly" inherited e.g.
 o size()
Returns the size
 o toString()
Returns a string representation of the object.

Constructors

 o CssFontFamily
 public CssFontFamily()
Create a new CssFontFamily

 o CssFontFamily
 public CssFontFamily(CssExpression expression) throws InvalidParamException
Create a new CssFontFamily

Parameters:
expression - the font name
Throws: InvalidParamException
The expression is incorrect

Methods

 o elements
 public Enumeration elements()
Returns all fonts name

 o size
 public int size()
Returns the size

 o get
 public Object get()
Returns the font (null if no font)

Overrides:
get in class CssProperty
 o isSoftlyInherited
 public boolean isSoftlyInherited()
Returns true if this property is "softly" inherited e.g. his value equals inherit

Overrides:
isSoftlyInherited in class CssProperty
 o toString
 public String toString()
Returns a string representation of the object.

Overrides:
toString in class CssProperty
 o getPropertyName
 public String getPropertyName()
Returns the name of this property

Overrides:
getPropertyName in class CssProperty
 o addToStyle
 public void addToStyle(CssStyle style)
Add this property to the CssStyle.

Parameters:
style - The CssStyle
Overrides:
addToStyle in class CssProperty
 o 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
 o equals
 public boolean equals(CssProperty property)
Compares two properties for equality.

Parameters:
value - The other property.
Overrides:
equals in class CssProperty
 o containsGenericFamily
 public boolean containsGenericFamily()
Returns true if this property contains a generic family name


All Packages  Class Hierarchy  This Package  Previous  Next  Index