Package org.jmol.g3d
Class TextRenderer
java.lang.Object
org.jmol.g3d.TextRenderer
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 Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate intprivate static final Map<Font,Map<String, TextRenderer>> private static final Map<Font,Map<String, TextRenderer>> private booleanprivate intprivate intprivate byte[]private static final byte[]private intprivate static boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static voidprivate static TextRenderergetPlotText3D(int x, int y, Graphics3D g3d, String text, Font font3d, boolean antialias) (package private) static intplot(int x, int y, int z, int argb, int bgargb, String text, Font font3d, Graphics3D g3d, JmolRendererInterface jr, boolean antialias) private static intplotByCharacter(int x, int y, int z, int argb, int bgargb, String text, Font font3d, Graphics3D g3d, JmolRendererInterface jmolRenderer, boolean antialias) private voidsetTranslucency(String text, Font font3d, Graphics3D g3d) retrieve grey-scale pixel map from the platform, then round it off
-
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
-
htFont3dAntialias
-
-
Constructor Details
-
TextRenderer
- 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
retrieve grey-scale pixel map from the platform, then round it off- Parameters:
text-font3d-g3d-
-