gestalt.util
Class FontTextureCreator

java.lang.Object
  extended by gestalt.util.FontTextureCreator

public class FontTextureCreator
extends java.lang.Object

FontTextureCreator draws attributed strings as bitmaps. NOTE the implementation of 'newline' is still flaky. a 'newline' at the beginning of a string should be avoided. multiple consecutive 'newlines' will be interpreted as one single newline. a 'newline' at the end of a paragraph is ignored.


Nested Class Summary
static class FontTextureCreator.TextFragment
           
static class FontTextureCreator.TextProperty
           
 
Field Summary
static int alignment
           
static java.awt.Color background
           
static int CENTERED
           
static java.awt.Color foreground
           
static int LEFT
           
static float linewidth
           
static int padding
           
static int RIGHT
           
static java.util.Vector<FontTextureCreator.TextFragment> textfragments
           
 
Constructor Summary
FontTextureCreator()
           
 
Method Summary
static java.text.AttributedString getAttributedString(java.util.Vector<FontTextureCreator.TextFragment> theTextFragments)
           
static ByteBitmap getBitmap(java.text.AttributedString theString, float theWidth)
           
static ByteBitmap getBitmap(java.text.AttributedString theString, float theWidth, boolean theAntialias)
           
static ByteBitmap getBitmap(java.text.AttributedString theString, float theWidth, boolean theAntialias, java.lang.StringBuffer myLayoutedString)
           
static ByteBitmap getBitmap(float theWidth)
           
static ByteBitmap getBitmap(float theWidth, boolean theAntialias)
           
static ByteBitmap getBitmap(java.util.Vector<FontTextureCreator.TextFragment> theTextFragments, float theWidth)
           
static ByteBitmap getBitmap(java.util.Vector<FontTextureCreator.TextFragment> theTextFragments, float theWidth, boolean theAntialias)
           
static java.awt.image.BufferedImage getBufferedImage(java.text.AttributedString theString, float theWidth)
           
static java.awt.image.BufferedImage getBufferedImage(java.text.AttributedString theString, float theWidth, boolean theAntialias)
           
static java.awt.image.BufferedImage getBufferedImage(java.text.AttributedString theString, float theWidth, boolean theAntialias, java.lang.StringBuffer myLayoutedString)
           
static java.awt.Font getFont(java.io.InputStream theStream, float theSize)
           
static java.awt.Font getFont(java.io.InputStream theStream, float theSize, int theStyle)
           
static java.awt.Font getFont(java.io.InputStream theStream, float theSize, int theStyle, int theType)
           
static java.awt.Font getInstalledFont(java.lang.String theFontName, float theSize)
           
static java.awt.Font getInstalledFont(java.lang.String theFontName, float theSize, int theStyle)
           
static int getLayoutedString(java.text.AttributedString theString, float theWidth, boolean theAntialias, java.lang.StringBuffer myLayoutedString)
           
static double getStringWidth(java.awt.Font theFont, java.lang.String theText, boolean theAntialias)
           
static boolean isInstalled(java.lang.String theString)
           
static java.lang.String[] list()
           
static int suggestTextureWidth(java.awt.Font theFont, java.lang.String theText, boolean theAntialias)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEFT

public static final int LEFT
See Also:
Constant Field Values

CENTERED

public static final int CENTERED
See Also:
Constant Field Values

RIGHT

public static final int RIGHT
See Also:
Constant Field Values

foreground

public static java.awt.Color foreground

background

public static java.awt.Color background

padding

public static int padding

alignment

public static int alignment

linewidth

public static float linewidth

textfragments

public static final java.util.Vector<FontTextureCreator.TextFragment> textfragments
Constructor Detail

FontTextureCreator

public FontTextureCreator()
Method Detail

getFont

public static java.awt.Font getFont(java.io.InputStream theStream,
                                    float theSize)

getFont

public static java.awt.Font getFont(java.io.InputStream theStream,
                                    float theSize,
                                    int theStyle)

getFont

public static java.awt.Font getFont(java.io.InputStream theStream,
                                    float theSize,
                                    int theStyle,
                                    int theType)

getInstalledFont

public static java.awt.Font getInstalledFont(java.lang.String theFontName,
                                             float theSize,
                                             int theStyle)

getInstalledFont

public static java.awt.Font getInstalledFont(java.lang.String theFontName,
                                             float theSize)

getBitmap

public static ByteBitmap getBitmap(java.text.AttributedString theString,
                                   float theWidth)

getBitmap

public static ByteBitmap getBitmap(java.text.AttributedString theString,
                                   float theWidth,
                                   boolean theAntialias)

getBitmap

public static ByteBitmap getBitmap(java.text.AttributedString theString,
                                   float theWidth,
                                   boolean theAntialias,
                                   java.lang.StringBuffer myLayoutedString)

getBitmap

public static ByteBitmap getBitmap(java.util.Vector<FontTextureCreator.TextFragment> theTextFragments,
                                   float theWidth)

getBitmap

public static ByteBitmap getBitmap(java.util.Vector<FontTextureCreator.TextFragment> theTextFragments,
                                   float theWidth,
                                   boolean theAntialias)

getBitmap

public static ByteBitmap getBitmap(float theWidth,
                                   boolean theAntialias)

getBitmap

public static ByteBitmap getBitmap(float theWidth)

getBufferedImage

public static java.awt.image.BufferedImage getBufferedImage(java.text.AttributedString theString,
                                                            float theWidth)

getBufferedImage

public static java.awt.image.BufferedImage getBufferedImage(java.text.AttributedString theString,
                                                            float theWidth,
                                                            boolean theAntialias)

getStringWidth

public static double getStringWidth(java.awt.Font theFont,
                                    java.lang.String theText,
                                    boolean theAntialias)

suggestTextureWidth

public static int suggestTextureWidth(java.awt.Font theFont,
                                      java.lang.String theText,
                                      boolean theAntialias)

getBufferedImage

public static java.awt.image.BufferedImage getBufferedImage(java.text.AttributedString theString,
                                                            float theWidth,
                                                            boolean theAntialias,
                                                            java.lang.StringBuffer myLayoutedString)

getLayoutedString

public static int getLayoutedString(java.text.AttributedString theString,
                                    float theWidth,
                                    boolean theAntialias,
                                    java.lang.StringBuffer myLayoutedString)

list

public static java.lang.String[] list()

isInstalled

public static boolean isInstalled(java.lang.String theString)

getAttributedString

public static java.text.AttributedString getAttributedString(java.util.Vector<FontTextureCreator.TextFragment> theTextFragments)


processing library gestalt_p5 by Patrick Kochlik + Dennis Paul. (c) 2009