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
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected AbstractStyleDatabase.FontFormatfontFormatFromContentType(String conType) protected AbstractStyleDatabase.FontFormatfontFormatFromRule(String format) Gets the real name of the default font.floatgetExSizeInPt(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 booleanisFontFamilyAvailable(String fontFamily) protected booleanisFontFamilyAvailable(String requestedFamily, CSSComputedProperties style) protected booleanloadFontFace(String familyName, AbstractStyleDatabase.FontFormat fontFormat, InputStream is, ExtendedCSSFontFaceRule rule) voidTry to load the font family according to the given font face rule, and make it available to this object.voidsetInitialColor(String initialColor) Sets the initial (default) value for the 'color' property on this device.booleanDoes 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, waitMethods 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:StyleDatabaseGives 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:
getExSizeInPtin 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:StyleDatabaseGives the initial (default) value for the 'color' property on this device.- Specified by:
getInitialColorin interfaceStyleDatabase- Returns:
- the default color value.
-
setInitialColor
Description copied from interface:StyleDatabaseSets the initial (default) value for the 'color' property on this device.- Specified by:
setInitialColorin interfaceStyleDatabase- Parameters:
initialColor- the String representing default color value.
-
getDefaultGenericFontFamily
Description copied from interface:StyleDatabaseGets 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:
getDefaultGenericFontFamilyin interfaceStyleDatabase- Returns:
- the name of the default real font.
-
getSystemFontDeclaration
Description copied from interface:StyleDatabaseGives the style declaration adequate to provide the given system font.- Specified by:
getSystemFontDeclarationin 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:StyleDatabaseGets the used font family name according to the given style.- Specified by:
getUsedFontFamilyin interfaceStyleDatabase- Parameters:
computedStyle- the computed style.- Returns:
- the name of the used font family.
-
isFontFamilyAvailable
-
loadFontFaceRule
Description copied from interface:StyleDatabaseTry to load the font family according to the given font face rule, and make it available to this object.- Specified by:
loadFontFaceRulein 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:StyleDatabaseDoes this medium support the given property-value pair?- Specified by:
supportsin interfaceStyleDatabase- Parameters:
featureName- the property name.value- the optional property value to be tested against.- Returns:
trueif the property (with the given value, if any) is supported,falseotherwise.
-
isFontFamilyAvailable
-