public class SvgStyleResolver extends Object implements ICssResolver
| Modifier and Type | Field and Description |
|---|---|
static float |
DEFAULT_FONT_SIZE |
static Set<IStyleInheritance> |
INHERITANCE_RULES |
| Constructor and Description |
|---|
SvgStyleResolver(INode rootNode,
SvgProcessorContext context)
Creates a
SvgStyleResolver. |
SvgStyleResolver(InputStream defaultCssStream,
SvgProcessorContext context)
Creates a
SvgStyleResolver with a given default CSS. |
SvgStyleResolver(SvgProcessorContext context)
Creates a
SvgStyleResolver. |
| Modifier and Type | Method and Description |
|---|---|
List<CssFontFaceRule> |
getFonts()
Gets the list of fonts.
|
static boolean |
isElementNested(IElementNode element,
String parentElementNameForSearch)
Checks whether element is nested within the passed parent element.
|
static void |
resolveFontSizeStyle(Map<String,String> styles,
SvgCssContext cssContext,
String parentFontSizeStr)
Resolves the font size stored inside the current element.
|
Map<String,String> |
resolveNativeStyles(INode node,
AbstractCssContext cssContext)
Resolves node styles without inheritance of parent element styles.
|
Map<String,String> |
resolveStyles(INode element,
AbstractCssContext context) |
public static final Set<IStyleInheritance> INHERITANCE_RULES
public static final float DEFAULT_FONT_SIZE
public SvgStyleResolver(InputStream defaultCssStream, SvgProcessorContext context) throws IOException
SvgStyleResolver with a given default CSS.defaultCssStream - the default CSScontext - the processor contextIOException - if any input/output issue occurspublic SvgStyleResolver(SvgProcessorContext context)
SvgStyleResolver.context - the processor contextpublic SvgStyleResolver(INode rootNode, SvgProcessorContext context)
SvgStyleResolver. This constructor will instantiate its internal
style sheet and it will collect the css declarations from the provided node.rootNode - node to collect css fromcontext - the processor contextpublic static void resolveFontSizeStyle(Map<String,String> styles, SvgCssContext cssContext, String parentFontSizeStr)
styles - attributes map of the current elementcssContext - SvgCssContext instance in order to resolve relative font sizeparentFontSizeStr - parent font size valuepublic static boolean isElementNested(IElementNode element, String parentElementNameForSearch)
element - IElementNode element to checkparentElementNameForSearch - expected parent element nametrue if element is nested within the expected parent, false otherwisepublic Map<String,String> resolveStyles(INode element, AbstractCssContext context)
resolveStyles in interface ICssResolverpublic Map<String,String> resolveNativeStyles(INode node, AbstractCssContext cssContext)
node - the nodecssContext - the CSS context (RootFontSize, etc.)public List<CssFontFaceRule> getFonts()
CssFontFaceRule instancesCopyright © 1998–2025 Apryse Group NV. All rights reserved.