Package org.jmol.g3d

Class TextRenderer


  • class TextRenderer
    extends Object
    implementation for text rendering

    uses java fonts by rendering into an offscreen buffer. strings are rasterized, and 4-bit translucency is stored as byte[] tmap.

    Author:
    Miguel, miguel@jmol.org, Bob Hanson, hansonr@stolaf.edu
    • Field Detail

      • height

        private int height
      • ascent

        private int ascent
      • width

        private int width
      • mapWidth

        private int mapWidth
      • size

        private int size
      • tmap

        private byte[] tmap
      • isInvalid

        private boolean isInvalid
      • translucency

        private static final byte[] translucency
      • working

        private static boolean working
    • Constructor Detail

      • TextRenderer

        private TextRenderer​(String text,
                             Font font3d)
        Parameters:
        text -
        font3d -
    • Method Detail

      • clearFontCache

        static void clearFontCache()
      • plotByCharacter

        private static int plotByCharacter​(int x,
                                           int y,
                                           int z,
                                           int argb,
                                           int bgargb,
                                           String text,
                                           Font font3d,
                                           Graphics3D g3d,
                                           JmolRendererInterface jmolRenderer,
                                           boolean antialias)
      • setTranslucency

        private void setTranslucency​(String text,
                                     Font font3d,
                                     Graphics3D g3d)
        retrieve grey-scale pixel map from the platform, then round it off
        Parameters:
        text -
        font3d -
        g3d -