Package com.itextpdf.svg.css.impl
Class SvgStyleResolver
java.lang.Object
com.itextpdf.svg.css.impl.SvgStyleResolver
- All Implemented Interfaces:
-
ICssResolver
Default implementation of SVG`s styles and attribute resolver .
-
Field Summary
-
Constructor Summary
ConstructorDescriptionSvgStyleResolver
(INode rootNode, SvgProcessorContext context) Creates aSvgStyleResolver
.SvgStyleResolver
(SvgProcessorContext context) Creates aSvgStyleResolver
.SvgStyleResolver
(InputStream defaultCssStream, SvgProcessorContext context) Creates aSvgStyleResolver
with a given default CSS. -
Method Summary
Modifier and TypeMethodDescriptiongetFonts()
Gets the list of fonts.static boolean
isElementNested
(IElementNode element, String parentElementNameForSearch) static void
resolveFontSizeStyle
(Map<String, String> styles, SvgCssContext cssContext, String parentFontSizeStr) resolveNativeStyles
(INode node, AbstractCssContext cssContext) Resolves node styles without inheritance of parent element styles.resolveStyles
(INode element, AbstractCssContext context) Resolves the styles of a node given the passed context.
-
Field Details
-
INHERITANCE_RULES
-
-
Constructor Details
-
SvgStyleResolver
public SvgStyleResolver(InputStream defaultCssStream, SvgProcessorContext context) throws IOException Creates aSvgStyleResolver
with a given default CSS.- Parameters:
-
defaultCssStream
- the default CSS -
context
- the processor context - Throws:
-
IOException
- if any input/output issue occurs
-
SvgStyleResolver
Creates aSvgStyleResolver
.- Parameters:
-
context
- the processor context
-
SvgStyleResolver
Creates aSvgStyleResolver
. This constructor will instantiate its internal style sheet and it will collect the css declarations from the provided node.- Parameters:
-
rootNode
- node to collect css from -
context
- the processor context
-
-
Method Details
-
resolveFontSizeStyle
public static void resolveFontSizeStyle(Map<String, String> styles, SvgCssContext cssContext, String parentFontSizeStr) -
isElementNested
-
resolveStyles
Description copied from interface:ICssResolver
Resolves the styles of a node given the passed context.- Specified by:
-
resolveStyles
in interfaceICssResolver
- Parameters:
-
element
- the node -
context
- the CSS context (RootFontSize, etc.) - Returns:
- the map containing the resolved styles
-
resolveNativeStyles
Resolves node styles without inheritance of parent element styles.- Parameters:
-
node
- the node -
cssContext
- the CSS context (RootFontSize, etc.) - Returns:
- the map containing the resolved styles that are defined in the body of the element
-
getFonts
Gets the list of fonts.- Returns:
-
the list of
CssFontFaceRule
instances
-