Class Java2DTextRenderer

  • All Implemented Interfaces:
    TextRenderer

    public class Java2DTextRenderer
    extends java.lang.Object
    implements TextRenderer
    Renders to a Graphics2D instance.
    Author:
    Joshua Marinacci, Torbjoern Gannholm
    • Constructor Detail

      • Java2DTextRenderer

        public Java2DTextRenderer()
    • Method Detail

      • setSmoothingThreshold

        public void setSmoothingThreshold​(float fontsize)
        Description copied from interface: TextRenderer
        Set the smoothing threashold. This is a font size above which all text will be anti-aliased. Text below this size will not be antialiased. Set to -1 for no antialiasing. Set to 0 for all antialising. Else, set to the threshold font size. does not take font scaling into account.
        Specified by:
        setSmoothingThreshold in interface TextRenderer
      • setSmoothingLevel

        public void setSmoothingLevel​(int level)
        Specified by:
        setSmoothingLevel in interface TextRenderer
        Parameters:
        level - no-op
      • getRenderingHints

        public java.lang.Object getRenderingHints()
        If anti-alias text is enabled, the value from RenderingHints to use for AA smoothing in Java2D. Defaults to RenderingHints.VALUE_TEXT_ANTIALIAS_ON.
        Returns:
        Current AA rendering hint
      • setRenderingHints

        public void setRenderingHints​(java.lang.Object renderingHints)
        If anti-alias text is enabled, the value from RenderingHints to use for AA smoothing in Java2D. Defaults to RenderingHints.VALUE_TEXT_ANTIALIAS_ON.
        Parameters:
        renderingHints - rendering hint for AA smoothing in Java2D
      • getGlyphPositions

        public float[] getGlyphPositions​(OutputDevice outputDevice,
                                         FSFont font,
                                         java.lang.String text)