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 int
private int
private static final Map
<Font, Map<String, TextRenderer>> private static final Map
<Font, Map<String, TextRenderer>> private boolean
private int
private int
private byte[]
private static final byte[]
private int
private static boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static void
private static TextRenderer
getPlotText3D
(int x, int y, Graphics3D g3d, String text, Font font3d, boolean antialias) (package private) static int
plot
(int x, int y, int z, int argb, int bgargb, String text, Font font3d, Graphics3D g3d, JmolRendererInterface jr, boolean antialias) private static int
plotByCharacter
(int x, int y, int z, int argb, int bgargb, String text, Font font3d, Graphics3D g3d, JmolRendererInterface jmolRenderer, boolean antialias) private void
setTranslucency
(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
-
-