Package org.apache.fop.fo.properties
Class CommonFont
java.lang.Object
org.apache.fop.fo.properties.CommonFont
Collection of CommonFont properties
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final PropertyCache
<CommonFont> cache holding canonical CommonFont instances (only those with absolute font-size and font-size-adjust)private final FontFamilyProperty
The "font-family" property.private final EnumProperty
The "font-selection-strategy" property.final Length
The "font-size" property.final Numeric
The "font-size-adjust" property.private final EnumProperty
The "font-stretch" property.private final EnumProperty
The "font-style" property.private final EnumProperty
The "font-variant" property.private final EnumProperty
The "font-weight" property.private int
hashcode of this instance -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
CommonFont
(FontFamilyProperty fontFamily, EnumProperty fontSelectionStrategy, EnumProperty fontStretch, EnumProperty fontStyle, EnumProperty fontVariant, EnumProperty fontWeight, Length fontSize, Numeric fontSizeAdjust) Construct a CommonFont instance -
Method Summary
Modifier and TypeMethodDescriptionboolean
private String[]
int
getFontState
(FontInfo fontInfo) Create and return an array ofFontTriplets
based on the properties stored in the instance variables.int
int
int
int
static CommonFont
getInstance
(PropertyList pList) Returns a CommonFont instance for the given PropertyList If the font-size and font-size-adjust properties are absolute the entire instance will be cached.int
hashCode()
-
Field Details
-
CACHE
cache holding canonical CommonFont instances (only those with absolute font-size and font-size-adjust) -
hash
private int hashhashcode of this instance -
fontFamily
The "font-family" property. -
fontSelectionStrategy
The "font-selection-strategy" property. -
fontStretch
The "font-stretch" property. -
fontStyle
The "font-style" property. -
fontVariant
The "font-variant" property. -
fontWeight
The "font-weight" property. -
fontSize
The "font-size" property. -
fontSizeAdjust
The "font-size-adjust" property.
-
-
Constructor Details
-
CommonFont
private CommonFont(FontFamilyProperty fontFamily, EnumProperty fontSelectionStrategy, EnumProperty fontStretch, EnumProperty fontStyle, EnumProperty fontVariant, EnumProperty fontWeight, Length fontSize, Numeric fontSizeAdjust) Construct a CommonFont instance- Parameters:
fontFamily
- the font-family propertyfontSelectionStrategy
- the font-selection-strategy propertyfontStretch
- the font-stretch propertyfontStyle
- the font-style propertyfontVariant
- the font-variant propertyfontWeight
- the font-weight propertyfontSize
- the font-size (possibly non-cached)fontSizeAdjust
- the font-size-adjust (possibly non-cached)
-
-
Method Details
-
getInstance
Returns a CommonFont instance for the given PropertyList If the font-size and font-size-adjust properties are absolute the entire instance will be cached. If not, then a distinct instance will be returned, with as much cached information as possible.- Parameters:
pList
- the PropertyList to get the properties from- Returns:
- a CommonFont instance corresponding to the properties
- Throws:
PropertyException
- if there was a problem getting the properties
-
getFontFamily
- Returns:
- an array with the font-family names
-
getFirstFontFamily
- Returns:
- the first font-family name in the list
-
getFontSelectionStrategy
public int getFontSelectionStrategy()- Returns:
- the "font-selection-strategy" property
-
getFontStretch
public int getFontStretch()- Returns:
- the "font-stretch" property
-
getFontStyle
public int getFontStyle()- Returns:
- the "font-style" property
-
getFontVariant
public int getFontVariant()- Returns:
- the "font-variant" property
-
getFontWeight
public int getFontWeight()- Returns:
- the "font-weight" property
-
getFontSize
- Returns:
- the "font-size" property.
-
getFontSizeAdjust
- Returns:
- the "font-size-adjust" property.
-
getFontState
Create and return an array ofFontTriplets
based on the properties stored in the instance variables.- Parameters:
fontInfo
- a font info object- Returns:
- a font triplet
-
equals
-
hashCode
public int hashCode()
-