java.lang.Object
io.sf.carte.doc.style.css.om.AbstractStyleDatabase
- All Implemented Interfaces:
StyleDatabase
Abstract base class for CSS Style databases.
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected AbstractStyleDatabase.FontFormat
fontFormatFromContentType
(String conType) protected AbstractStyleDatabase.FontFormat
fontFormatFromRule
(String format) Gets the real name of the default font.float
getExSizeInPt
(String familyName, float size) Gives the size of the 'ex' unit, expressed in 'pt' (typographic points) unit.Gives the initial (default) value for the 'color' property on this device.getSystemFontDeclaration
(String systemFontName) Gives the style declaration adequate to provide the given system font.getUsedFontFamily
(CSSComputedProperties computedStyle) Gets the used font family name according to the given style.protected abstract boolean
isFontFamilyAvailable
(String fontFamily) protected boolean
isFontFamilyAvailable
(String requestedFamily, CSSComputedProperties style) protected boolean
loadFontFace
(String familyName, AbstractStyleDatabase.FontFormat fontFormat, InputStream is, ExtendedCSSFontFaceRule rule) void
Try to load the font family according to the given font face rule, and make it available to this object.void
setInitialColor
(String initialColor) Sets the initial (default) value for the 'color' property on this device.boolean
Does this medium support the given property-value pair?Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.sf.carte.doc.style.css.StyleDatabase
getColorDepth, getDefaultGenericFontFamily, getDeviceHeight, getDeviceWidth, getFontSizeFromIdentifier, getNaturalUnit, getWidthSize, isFontFaceName
-
Field Details
-
DEFAULT_GENERIC_FONT_FAMILY
- See Also:
-
-
Constructor Details
-
AbstractStyleDatabase
public AbstractStyleDatabase()
-
-
Method Details
-
getExSizeInPt
Description copied from interface:StyleDatabase
Gives the size of the 'ex' unit, expressed in 'pt' (typographic points) unit.Although this type of information really belongs to
CSSCanvas
, having even an approximate value here is helpful.- Specified by:
getExSizeInPt
in interfaceStyleDatabase
- Parameters:
familyName
- the font family name.size
- the font size in 'pt' units.- Returns:
- the size of the 'ex' unit, in units of 'pt'.
-
getInitialColor
Description copied from interface:StyleDatabase
Gives the initial (default) value for the 'color' property on this device.- Specified by:
getInitialColor
in interfaceStyleDatabase
- Returns:
- the default color value.
-
setInitialColor
Description copied from interface:StyleDatabase
Sets the initial (default) value for the 'color' property on this device.- Specified by:
setInitialColor
in interfaceStyleDatabase
- Parameters:
initialColor
- the String representing default color value.
-
getDefaultGenericFontFamily
Description copied from interface:StyleDatabase
Gets the real name of the default font.For example, if the default generic font name is 'serif', this method should return the same as getDefaultGenericFontFamily("serif").
- Specified by:
getDefaultGenericFontFamily
in interfaceStyleDatabase
- Returns:
- the name of the default real font.
-
getSystemFontDeclaration
Description copied from interface:StyleDatabase
Gives the style declaration adequate to provide the given system font.- Specified by:
getSystemFontDeclaration
in interfaceStyleDatabase
- Parameters:
systemFontName
- the system font name.- Returns:
- the style declaration, or null if the system font name was not recognized.
-
getUsedFontFamily
Description copied from interface:StyleDatabase
Gets the used font family name according to the given style.- Specified by:
getUsedFontFamily
in interfaceStyleDatabase
- Parameters:
computedStyle
- the computed style.- Returns:
- the name of the used font family.
-
isFontFamilyAvailable
-
loadFontFaceRule
Description copied from interface:StyleDatabase
Try to load the font family according to the given font face rule, and make it available to this object.- Specified by:
loadFontFaceRule
in interfaceStyleDatabase
- Parameters:
rule
- the font face rule.
-
fontFormatFromContentType
-
fontFormatFromRule
-
loadFontFace
protected boolean loadFontFace(String familyName, AbstractStyleDatabase.FontFormat fontFormat, InputStream is, ExtendedCSSFontFaceRule rule) throws IOException - Throws:
IOException
-
supports
Description copied from interface:StyleDatabase
Does this medium support the given property-value pair?- Specified by:
supports
in interfaceStyleDatabase
- Parameters:
featureName
- the property name.value
- the optional property value to be tested against.- Returns:
true
if the property (with the given value, if any) is supported,false
otherwise.
-
isFontFamilyAvailable
-