Package eu.kartoffelquadrat.svgpatcher
Class CssPatcher
java.lang.Object
eu.kartoffelquadrat.svgpatcher.Patcher
eu.kartoffelquadrat.svgpatcher.CssPatcher
Little helper class to add an internal css definition to the SVG file that prevents manual
selection of any text objects by the user. See:
https://gist.github.com/23maverick23/64b3b587c88697558fac (no text select css definitions) And:
https://developer.mozilla.org/en-US/docs/Web/SVG/Element/style (svg css embed mechanism)
- Author:
- Maximilian Schiedermeier, 2022s
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionCssPatcher(Document svg, String customCssFileReference) CssPatcher constructor. -
Method Summary
-
Constructor Details
-
CssPatcher
CssPatcher constructor. Invokes super patcher constructor.- Parameters:
svg- as the document to operate on.customCssFileReference- absolute path as string to CSS definitions to include in svg.
-
-
Method Details
-
execute
Adds a new child node to the root svg node: "style".- Specified by:
executein classPatcher- Returns:
- the identical svg object you passed as input, but with patched style node.
- Throws:
IOException- if patching involves loading of external files which cannot be resolved.
-