Package org.apache.batik.dom.svg

Examples of org.apache.batik.dom.svg.SVGOMTextElement


        assertTrue(child instanceof GenericText);

        /* The fourth child is the <text> element. */
        child = children.item(3);
        assertTrue(child instanceof SVGOMTextElement);
        final SVGOMTextElement textElement = (SVGOMTextElement) child;

        /* The fifth child is the ignorable whitespace after the <text>. */
        child = children.item(4);
        assertTrue(child instanceof GenericText);

        /* Test the text element. */
        final NamedNodeMap attributes = textElement.getAttributes();
        final Node node = attributes.getNamedItem("fill");
        assertTrue(node instanceof Attr);
        final Attr attribute = (Attr) node;
        child = attribute.getFirstChild();
        assertTrue(child instanceof GenericText);
View Full Code Here


        //FIXME TEST
        if (node instanceof SVGOMTextElement){
          boolean useVectorFont = false;
         
          SVGOMTextElement textElement = (SVGOMTextElement)node;
          //Get <text> position values (can be a list)
          List<Float> xValues = getSVGLengthListAsFloat(textElement.getX().getBaseVal());
          List<Float> yValues = getSVGLengthListAsFloat(textElement.getY().getBaseVal());
//          /*//Not used
          String textContent = TextUtilities.getElementContent(textElement);
          textContent = textContent.replaceAll("\\n","");
          textContent = textContent.trim();
//           */
          /*
          //TODO USE?
          textElement.getTextLength();
          textElement.getRotate();
           */
          if (textElement.getSVGContext() instanceof SVGTextElementBridge){
            SVGTextElementBridge b = (SVGTextElementBridge)textElement.getSVGContext();
            GraphicsNode gr = b.createGraphicsNode(ctx, textElement);
            TextNode tNode = (TextNode)gr;
            b.buildGraphicsNode(ctx, textElement, tNode);
            List<?> textRuns = tNode.getTextRuns();
            logger.debug("Text runs: " + textRuns);
View Full Code Here

TOP

Related Classes of org.apache.batik.dom.svg.SVGOMTextElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.