Table of Contents

Class SvgTextUtil

Namespace
iText.Svg.Utils
Assembly
itext.svg.dll

Class containing utility methods for text operations in the context of SVG processing

public sealed class SvgTextUtil
Inheritance
SvgTextUtil
Inherited Members

Methods

FilterReferenceValue(string)

The reference value may contain a hashtag character or 'url' designation and this method will filter them.

public static string FilterReferenceValue(string name)

Parameters

name string

value to be filtered

Returns

string

filtered value

IsOnlyWhiteSpace(string)

Check if the String is only composed of whitespace characters

public static bool IsOnlyWhiteSpace(string s)

Parameters

s string

string to check

Returns

bool

true if the string only contains whitespace characters, false otherwise

ProcessWhiteSpace(TextSvgBranchRenderer, bool)

Process the whitespace inside the Text Tree.

public static void ProcessWhiteSpace(TextSvgBranchRenderer root, bool isLeadingElement)

Parameters

root TextSvgBranchRenderer

root of the text-renderer subtree

isLeadingElement bool

true if this element is a leading element(either the first child or the first element after an absolute position change)

Remarks

Process the whitespace inside the Text Tree. Whitespace is collapsed and new lines are handled A leading element in each subtree is handled different: the preceding whitespace is trimmed instead of kept

ResolveFontSize(ISvgTextNodeRenderer, float)

Resolve the font size stored inside the passed renderer

public static float ResolveFontSize(ISvgTextNodeRenderer renderer, float parentFontSize)

Parameters

renderer ISvgTextNodeRenderer

renderer containing the font size declaration

parentFontSize float

parent font size to fall back on if the renderer does not contain a font size declarations or if the stored declaration is invalid

Returns

float

float containing the font-size, or the parent font size if the renderer's declaration cannot be resolved

TrimLeadingWhitespace(string)

Trim all the leading whitespace characters from the passed string

public static string TrimLeadingWhitespace(string toTrim)

Parameters

toTrim string

string to trim

Returns

string

string with all leading whitespace characters removed

TrimTrailingWhitespace(string)

Trim all the trailing whitespace characters from the passed string

public static string TrimTrailingWhitespace(string toTrim)

Parameters

toTrim string

string to trim

Returns

string

string with al trailing whitespace characters removed