Class TextUtilities

  • All Implemented Interfaces:
    ErrorConstants, CSSConstants

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

      • TextUtilities

        public TextUtilities()
    • Method Detail

      • getElementContent

        public static java.lang.String getElementContent​(org.w3c.dom.Element e)
        Returns the content of the given element.
      • svgHorizontalCoordinateArrayToUserSpace

        public static java.util.ArrayList svgHorizontalCoordinateArrayToUserSpace​(org.w3c.dom.Element element,
                                                                                  java.lang.String attrName,
                                                                                  java.lang.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 java.util.ArrayList svgVerticalCoordinateArrayToUserSpace​(org.w3c.dom.Element element,
                                                                                java.lang.String attrName,
                                                                                java.lang.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 java.util.ArrayList svgRotateArrayToFloats​(org.w3c.dom.Element element,
                                                                 java.lang.String attrName,
                                                                 java.lang.String valueStr,
                                                                 BridgeContext ctx)
      • convertFontSize

        public static java.lang.Float convertFontSize​(org.w3c.dom.Element e)
        Converts the font-size CSS value to a float value.
        Parameters:
        e - the element
      • convertFontStyle

        public static java.lang.Float convertFontStyle​(org.w3c.dom.Element e)
        Converts the font-style CSS value to a float value.
        Parameters:
        e - the element
      • convertFontStretch

        public static java.lang.Float convertFontStretch​(org.w3c.dom.Element e)
        Converts the font-stretch CSS value to a float value.
        Parameters:
        e - the element
      • convertFontWeight

        public static java.lang.Float convertFontWeight​(org.w3c.dom.Element e)
        Converts the font-weight CSS value to a float value.
        Parameters:
        e - the element
      • convertTextAnchor

        public static TextNode.Anchor convertTextAnchor​(org.w3c.dom.Element e)
        Converts the text-anchor CSS value to a TextNode.Anchor.
        Parameters:
        e - the element
      • convertBaselineShift

        public static java.lang.Object convertBaselineShift​(org.w3c.dom.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 java.lang.Float convertKerning​(org.w3c.dom.Element e)
        Converts a kerning CSS value to a value usable as a text attribute, or null.
        Parameters:
        e - the element
      • convertLetterSpacing

        public static java.lang.Float convertLetterSpacing​(org.w3c.dom.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 java.lang.Float convertWordSpacing​(org.w3c.dom.Element e)
        Converts a word-spacing CSS value to a value usable as a text attribute, or null.
        Parameters:
        e - the element