public final class SvgTextUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
applyTextDecoration(ISvgTextNodeRenderer renderer,
boolean doFill,
boolean doStroke,
SvgDrawContext context)
Processes text-decoration attribute which is shorthand for text-decoration-line and text-decoration-style.
|
static String |
filterReferenceValue(String name)
The reference value may contain a hashtag character or 'url' designation and this method will filter them.
|
static boolean |
isOnlyWhiteSpace(String s)
Check if the String is only composed of whitespace characters
|
static void |
processWhiteSpace(TextSvgBranchRenderer root,
boolean isLeadingElement)
Deprecated.
|
static void |
processWhiteSpace(TextSvgBranchRenderer root,
boolean isLeadingElement,
SvgDrawContext context)
Process the whitespace inside the Text Tree.
|
static float |
resolveFontSize(ISvgTextNodeRenderer renderer,
float parentFontSize)
Deprecated.
will be removed together with
TextLeafSvgNodeRenderer.getTextContentLength(float, PdfFont) |
static String |
trimLeadingWhitespace(String toTrim)
Trim all the leading whitespace characters from the passed string
|
static String |
trimTrailingWhitespace(String toTrim)
Trim all the trailing whitespace characters from the passed string
|
public static String trimLeadingWhitespace(String toTrim)
toTrim - string to trimpublic static String trimTrailingWhitespace(String toTrim)
toTrim - string to trim@Deprecated public static void processWhiteSpace(TextSvgBranchRenderer root, boolean isLeadingElement)
processWhiteSpace(TextSvgBranchRenderer, boolean, SvgDrawContext) insteadroot - root of the text-renderer subtreeisLeadingElement - true if this element is a leading element(either the first child or the first element after an absolute position change)public static void processWhiteSpace(TextSvgBranchRenderer root, boolean isLeadingElement, SvgDrawContext context)
root - root of the text-renderer subtreeisLeadingElement - true if this element is a leading element(either the first child or the first element after an absolute position change)context - the svg draw contextpublic static boolean isOnlyWhiteSpace(String s)
s - string to check@Deprecated public static float resolveFontSize(ISvgTextNodeRenderer renderer, float parentFontSize)
TextLeafSvgNodeRenderer.getTextContentLength(float, PdfFont)renderer - renderer containing the font size declarationparentFontSize - parent font size to fall back on if the renderer does not contain a font size declarations or if the stored declaration is invalidpublic static String filterReferenceValue(String name)
name - value to be filteredpublic static void applyTextDecoration(ISvgTextNodeRenderer renderer, boolean doFill, boolean doStroke, SvgDrawContext context)
Note, that text-decoration from styles (resolved in SvgStyleResolver) takes precedence when both are specified.
renderer - to apply text-decoration fordoFill - boolean specifying whether text should be filleddoStroke - boolean specifying whether text should be strokedcontext - current SVG draw contextCopyright © 1998–2025 Apryse Group NV. All rights reserved.