public class CssFontHelper extends AbstractLogEnabled implements Component, Serviceable
Modifier and Type | Field and Description |
---|---|
private static Pattern |
__CSS_CLASS_NAME
Pattern for CSS class
|
private Map<String,Set<String>> |
_glyphs |
private Map<String,Long> |
_lastUpdates |
private SourceResolver |
_resolver |
static String |
ROLE
The Avalon role
|
Constructor and Description |
---|
CssFontHelper() |
Modifier and Type | Method and Description |
---|---|
private org.w3c.dom.css.CSSStyleSheet |
_getCssStyleSheet(Source source) |
private Set<String> |
_getFontFamily(org.w3c.dom.css.CSSStyleSheet styleSheet) |
private boolean |
_matchFontFamily(Set<String> fontFamilies,
org.w3c.dom.css.CSSStyleDeclaration style) |
Set<String> |
getFontClassNames(org.w3c.dom.css.CSSStyleSheet styleSheet)
Get CSS class name to use for all icons.
|
Set<String> |
getGlyphClassNames(String cssURI,
String prefix)
Get the CSS class names for glyphes
|
boolean |
hasFontFaceRule(String cssURI)
Determines if the CSS file has a 'font-face' rule
|
void |
service(ServiceManager manager) |
getLogger, setLogger
private static final Pattern __CSS_CLASS_NAME
private SourceResolver _resolver
private Map<String,Long> _lastUpdates
public CssFontHelper()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public Set<String> getGlyphClassNames(String cssURI, String prefix)
cssURI
- The URI of CSS fileprefix
- The glyph prefix. Can be null.public boolean hasFontFaceRule(String cssURI)
cssURI
- The URI of CSS filepublic Set<String> getFontClassNames(org.w3c.dom.css.CSSStyleSheet styleSheet)
styleSheet
- The CSS stylesheet to parseprivate boolean _matchFontFamily(Set<String> fontFamilies, org.w3c.dom.css.CSSStyleDeclaration style)
private org.w3c.dom.css.CSSStyleSheet _getCssStyleSheet(Source source) throws MalformedURLException, IOException
MalformedURLException
IOException
private Set<String> _getFontFamily(org.w3c.dom.css.CSSStyleSheet styleSheet)