Package org.jmol.g3d

Class TextRenderer

java.lang.Object
org.jmol.g3d.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 Details

    • 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
    • htFont3d

      private static final Map<Font,Map<String,TextRenderer>> htFont3d
    • htFont3dAntialias

      private static final Map<Font,Map<String,TextRenderer>> htFont3dAntialias
  • Constructor Details

    • TextRenderer

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

    • clearFontCache

      static void clearFontCache()
    • plot

      static int plot(int x, int y, int z, int argb, int bgargb, String text, Font font3d, Graphics3D g3d, JmolRendererInterface jr, boolean antialias)
    • 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)
    • getPlotText3D

      private static TextRenderer getPlotText3D(int x, int y, Graphics3D g3d, String text, Font font3d, 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 -