Class TextUtilities

java.lang.Object
org.apache.batik.bridge.TextUtilities
All Implemented Interfaces:
ErrorConstants, CSSConstants

public abstract class TextUtilities extends Object implements CSSConstants, ErrorConstants
A collection of utility method for text.
Version:
$Id: TextUtilities.java 1802297 2017-07-18 13:58:12Z ssteiner $
  • Constructor Details

    • TextUtilities

      public TextUtilities()
  • Method Details

    • 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
    • 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
    • svgRotateArrayToFloats

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

      public static Float convertFontSize(Element e)
      Converts the font-size 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
    • convertFontStretch

      public static Float convertFontStretch(Element e)
      Converts the font-stretch 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
    • convertTextAnchor

      public static TextNode.Anchor convertTextAnchor(Element e)
      Converts the text-anchor CSS value to a TextNode.Anchor.
      Parameters:
      e - the element
    • 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
    • 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
    • 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