Class Text

    • Constructor Detail

      • Text

        public Text​(java.lang.String text)
        Constructs a Text with its role initialized.
        Parameters:
        text - the contents, as a String
    • Method Detail

      • getText

        public java.lang.String getText()
        Gets the contents of the Text object that will be rendered.
        Returns:
        the string with the contents
      • setText

        public void setText​(java.lang.String text)
        Sets the contents of the Text object.
        Parameters:
        text - the new contents
      • getTextRise

        public float getTextRise()
        Gets the text rise.
        Returns:
        the vertical distance from the text's default base line, as a float.
      • setTextRise

        public Text setTextRise​(float textRise)
        Sets the text rise.
        Parameters:
        textRise - a vertical distance from the text's default base line.
        Returns:
        this Text
      • getHorizontalScaling

        public java.lang.Float getHorizontalScaling()
        Gets the horizontal scaling property, which determines how wide the text should be stretched.
        Returns:
        the horizontal spacing, as a float
      • setSkew

        public Text setSkew​(float alpha,
                            float beta)
        Skews the text to simulate italic and other effects. Try alpha=0 and beta=12.
        Parameters:
        alpha - the first angle in degrees
        beta - the second angle in degrees
        Returns:
        this Text
      • setHorizontalScaling

        public Text setHorizontalScaling​(float horizontalScaling)
        The horizontal scaling parameter adjusts the width of glyphs by stretching or compressing them in the horizontal direction.
        Parameters:
        horizontalScaling - the scaling parameter. 1 means no scaling will be applied, 0.5 means the text will be scaled by half. 2 means the text will be twice as wide as normal one.
        Returns:
        this Text
      • disableOtfFeatures

        public Text disableOtfFeatures()
        Disable otf features applying for this text element.
        Returns:
        this Text element