Create a SVG text element.

@param x first point x
@param y first point y
@param text Content of text element.
@return New text element.
551001
public Element svgText(double x, double y, String text) {
    return SVGUtil.svgText(document, x, y, text);
  }
1245116
def add_text(self, text, x, y, side='left', size=None,
                 rotation=None, ha='left', va='center',
                 family=None, **kws):
        """"""
        axes = self.axes
        if side == 'right':
            axes = self.get_right_axes()
        dynamic_size = False
        if size is None:
            size = self.conf.legendfont.get_size()
            dynamic_size = True
        t = axes.text(x, y, text, ha=ha, va=va, size=size,
                      rotation=rotation, family=family, **kws)
        self.conf.added_texts.append((dynamic_size, t))
        self.draw()
449149
public void setNodeText(Node n, String text) {
        if (n == null)
            return;
        Node nc = null;
        while ((nc = n.getFirstChild()) != null) {
            n.removeChild(nc);
        }
        if (n.getAttributes().getNamedItemNS(XFA_DATA_SCHEMA, "dataNode") != null)
            n.getAttributes().removeNamedItemNS(XFA_DATA_SCHEMA, "dataNode");
        n.appendChild(domDocument.createTextNode(text));
        changed = true;
    }
568738
public static Element svgRect(Document document, double x, double y, double w, double h) {
    Element rect = SVGUtil.svgElement(document, SVGConstants.SVG_RECT_TAG);
    SVGUtil.setAtt(rect, SVGConstants.SVG_X_ATTRIBUTE, x);
    SVGUtil.setAtt(rect, SVGConstants.SVG_Y_ATTRIBUTE, y);
    SVGUtil.setAtt(rect, SVGConstants.SVG_WIDTH_ATTRIBUTE, w);
    SVGUtil.setAtt(rect, SVGConstants.SVG_HEIGHT_ATTRIBUTE, h);
    return rect;
  }
1334514
public void append(final Object text) {
		if (text instanceof Message) {
			append(translate(text), true);
		} else if (text != null) {
			append(text.toString(), true);
		}
	}
1209972
protected void drawText(Graphics2D g, String text)
    {
        // top left corner
        int x = getAbsoluteContentX();
        int y = getAbsoluteContentY();

        //Align Y with baseline
        FontMetrics fm = g.getFontMetrics();
        Rectangle2D rect = fm.getStringBounds(text, g);
        int ofs = getFirstInlineBoxBaseline();
        if (ofs == -1)
            ofs = ctx.getBaselineOffset(); //use the font baseline
        
        // Draw the string
        g.drawString(text,
                     x + ((int) rect.getX()) - ((int) Math.round(rect.getWidth())),
                     y + ofs);
    }
566702
private function addTextToImage($text, $x, $y)
    {
        imagettftext($this->image, $this->get('font_size'), 0, $x, $y, $this->get('text_color'), $this->dir.'/instruction.ttf', $text);
    }
1241907
public void moveText(float x, float y) {
        state.xTLM += x;
        state.yTLM += y;
        content.append(x).append(' ').append(y).append(" Td").append_i(separator);
    }
391697
public static TextBox newTextBox (String text, int maxLength, int visibleLength)
    {
        return initTextBox(new TextBox(), text, maxLength, visibleLength);
    }
937311
public static Element svgWaitIcon(Document document, double x, double y, double w, double h) {
    Element g = SVGUtil.svgElement(document, SVGConstants.SVG_G_TAG);
    setAtt(g, SVGConstants.SVG_TRANSFORM_ATTRIBUTE, "translate(" + x + " " + y + ") scale(" + w + " " + h + ")");
    Element thro = SVGUtil.svgElement(document, SVGConstants.SVG_PATH_TAG);
    setAtt(thro, SVGConstants.SVG_D_ATTRIBUTE, THROBBER_PATH);
    setStyle(thro, THROBBER_STYLE);
    Element anim = SVGUtil.svgElement(document, SVGConstants.SVG_ANIMATE_TRANSFORM_TAG);
    setAtt(anim, SVGConstants.SVG_ATTRIBUTE_NAME_ATTRIBUTE, SVGConstants.SVG_TRANSFORM_ATTRIBUTE);
    setAtt(anim, SVGConstants.SVG_ATTRIBUTE_TYPE_ATTRIBUTE, "XML");
    setAtt(anim, SVGConstants.SVG_TYPE_ATTRIBUTE, SVGConstants.SVG_ROTATE_ATTRIBUTE);
    setAtt(anim, SVGConstants.SVG_FROM_ATTRIBUTE, "0 .5 .5");
    setAtt(anim, SVGConstants.SVG_TO_ATTRIBUTE, "360 .5 .5");
    setAtt(anim, SVGConstants.SVG_BEGIN_ATTRIBUTE, fmt(Math.random() * 2) + "s");
    setAtt(anim, SVGConstants.SVG_DUR_ATTRIBUTE, "2s");
    setAtt(anim, SVGConstants.SVG_REPEAT_COUNT_ATTRIBUTE, "indefinite");
    setAtt(anim, SVGConstants.SVG_FILL_ATTRIBUTE, "freeze");
    thro.appendChild(anim);
    g.appendChild(thro);
    return g;
  }
1280659
public static XmlOrderedResult textContentDiffers(String name, String originalElementText, String newElementText) {
        return new XmlOrderedResult(false, String.format("The xml element <%s>%s</%s> should be placed before <%s>%s</%s>",
                name, newElementText, name, name, originalElementText, name));
    }
258660
public static TextElement code(String text) {
		TextElement element = text(text);
		element.textStyles.add(TextStyle.CODE);
		return element;
	}
1030225
public static Link create(final String text, final TextStyle ts, final File file) {
		return new Link(text, ts, file.toURI().toString());
	}
804528
function createNode(nodeName, isSvg) {
    var node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName);
    node.normalizedNodeName = nodeName;
    return node;
  }
192942
public static Link create(final String text, final NamedObject table) {
        return new Link(text, null, '#'+table.getName());
    }
552826
static final DocumentFragment createContent(Document doc, String text) {

        // [#150] Text might hold XML content, which can be leniently identified by the presence
        //        of either < or & characters (other entities, like >, ", ' are not stricly XML content)
        if (text != null && (text.contains("<") || text.contains("&"))) {
            DocumentBuilder builder = JOOX.builder();

            try {

                // [#128] Trimming will get rid of leading and trailing whitespace, which would
                // otherwise cause a HIERARCHY_REQUEST_ERR raised by the parser
                text = text.trim();

                // There is a processing instruction. We can safely assume
                // valid XML and parse it as such
                if (text.startsWith("<?xml")) {
                    Document parsed = builder.parse(new InputSource(new StringReader(text)));
                    DocumentFragment fragment = parsed.createDocumentFragment();
                    fragment.appendChild(parsed.getDocumentElement());

                    return (DocumentFragment) doc.importNode(fragment, true);
                }

                // Any XML document fragment. To be on the safe side, fragments
                // are wrapped in a dummy root node
                else {
                    String wrapped = "<dummy>" + text + "</dummy>";
                    Document parsed = builder.parse(new InputSource(new StringReader(wrapped)));
                    DocumentFragment fragment = parsed.createDocumentFragment();
                    NodeList children = parsed.getDocumentElement().getChildNodes();

                    // appendChild removes children also from NodeList!
                    while (children.getLength() > 0) {
                        fragment.appendChild(children.item(0));
                    }

                    return (DocumentFragment) doc.importNode(fragment, true);
                }
            }

            // This does not occur
            catch (IOException ignore) {}

            // The XML content is invalid
            catch (SAXException ignore) {}
        }

        // Plain text or invalid XML
        return null;
    }
590136
public static Link create(final String text, final TextStyle ts, final URL url) {
		return new Link(text, ts, url.toString());
	}