org.apache.batik.bridge

Class TextUtilities

public abstract class TextUtilities extends Object implements CSSConstants, ErrorConstants

A collection of utility method for text.
Method Summary
static ObjectconvertBaselineShift(Element e)
Converts a baseline-shift CSS value to a value usable as a text attribute, or null.
static FloatconvertFontSize(Element e)
Converts the font-size CSS value to a float value.
static FloatconvertFontStretch(Element e)
Converts the font-stretch CSS value to a float value.
static FloatconvertFontStyle(Element e)
Converts the font-style CSS value to a float value.
static FloatconvertFontWeight(Element e)
Converts the font-weight CSS value to a float value.
static FloatconvertKerning(Element e)
Converts a kerning CSS value to a value usable as a text attribute, or null.
static FloatconvertLetterSpacing(Element e)
Converts a letter-spacing CSS value to a value usable as a text attribute, or null.
static TextNode.AnchorconvertTextAnchor(Element e)
Converts the text-anchor CSS value to a TextNode.Anchor.
static FloatconvertWordSpacing(Element e)
Converts a word-spacing CSS value to a value usable as a text attribute, or null.
static StringgetElementContent(Element e)
Returns the content of the given element.
static ArrayListsvgHorizontalCoordinateArrayToUserSpace(Element element, String attrName, String valueStr, BridgeContext ctx)
Returns the float list that represents a set of horizontal values or percentage.
static ArrayListsvgRotateArrayToFloats(Element element, String attrName, String valueStr, BridgeContext ctx)
static ArrayListsvgVerticalCoordinateArrayToUserSpace(Element element, String attrName, String valueStr, BridgeContext ctx)
Returns the float list that represents a set of values or percentage.

Method Detail

convertBaselineShift

public static Object convertBaselineShift(Element e)
Converts a baseline-shift CSS value to a value usable as a text attribute, or null.

Parameters: e the element

convertFontSize

public static Float convertFontSize(Element e)
Converts the font-size CSS value to a float value.

Parameters: e the element

convertFontStretch

public static Float convertFontStretch(Element e)
Converts the font-stretch CSS value to a float value.

Parameters: e the element

convertFontStyle

public static Float convertFontStyle(Element e)
Converts the font-style CSS value to a float value.

Parameters: e the element

convertFontWeight

public static Float convertFontWeight(Element e)
Converts the font-weight CSS value to a float value.

Parameters: e the element

convertKerning

public static Float convertKerning(Element e)
Converts a kerning CSS value to a value usable as a text attribute, or null.

Parameters: e the element

convertLetterSpacing

public static Float convertLetterSpacing(Element e)
Converts a letter-spacing CSS value to a value usable as a text attribute, or null.

Parameters: e the element

convertTextAnchor

public static TextNode.Anchor convertTextAnchor(Element e)
Converts the text-anchor CSS value to a TextNode.Anchor.

Parameters: e the element

convertWordSpacing

public static Float convertWordSpacing(Element e)
Converts a word-spacing CSS value to a value usable as a text attribute, or null.

Parameters: e the element

getElementContent

public static String getElementContent(Element e)
Returns the content of the given element.

svgHorizontalCoordinateArrayToUserSpace

public static ArrayList svgHorizontalCoordinateArrayToUserSpace(Element element, String attrName, String valueStr, BridgeContext ctx)
Returns the float list that represents a set of horizontal values or percentage.

Parameters: element the element that defines the specified coordinates attrName the name of the attribute (used by error handling) valueStr the delimited string containing values of the coordinate ctx the bridge context

svgRotateArrayToFloats

public static ArrayList svgRotateArrayToFloats(Element element, String attrName, String valueStr, BridgeContext ctx)

svgVerticalCoordinateArrayToUserSpace

public static ArrayList svgVerticalCoordinateArrayToUserSpace(Element element, String attrName, String valueStr, BridgeContext ctx)
Returns the float list that represents a set of values or percentage.

Parameters: element the element that defines the specified coordinates attrName the name of the attribute (used by error handling) valueStr the delimited string containing values of the coordinate ctx the bridge context

Copyright B) 2007 Apache Software Foundation. All Rights Reserved.