java.awt
Class Font

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.awt.Font
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable
Direct Known Subclasses:
FontUIResource sample code for javax.swing.plaf.FontUIResource definition code for javax.swing.plaf.FontUIResource

public class Font
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements Serializable sample code for java.io.Serializable definition code for java.io.Serializable

The Font class represents fonts, which are used to render text in a visible way. A font provides the information needed to map sequences of characters to sequences of glyphs and to render sequences of glyphs on Graphics and Component objects.

Characters and Glyphs

A character is a symbol that represents an item such as a letter, a digit, or punctuation in an abstract way. For example, 'g', LATIN SMALL LETTER G, is a character.

A glyph is a shape used to render a character or a sequence of characters. In simple writing systems, such as Latin, typically one glyph represents one character. In general, however, characters and glyphs do not have one-to-one correspondence. For example, the character 'á' LATIN SMALL LETTER A WITH ACUTE, can be represented by two glyphs: one for 'a' and one for '´'. On the other hand, the two-character string "fi" can be represented by a single glyph, an "fi" ligature. In complex writing systems, such as Arabic or the South and South-East Asian writing systems, the relationship between characters and glyphs can be more complicated and involve context-dependent selection of glyphs as well as glyph reordering. A font encapsulates the collection of glyphs needed to render a selected set of characters as well as the tables needed to map sequences of characters to corresponding sequences of glyphs.

Physical and Logical Fonts

The Java 2 platform distinguishes between two kinds of fonts: physical fonts and logical fonts.

Physical fonts are the actual font libraries containing glyph data and tables to map from character sequences to glyph sequences, using a font technology such as TrueType or PostScript Type 1. All implementations of the Java 2 platform must support TrueType fonts; support for other font technologies is implementation dependent. Physical fonts may use names such as Helvetica, Palatino, HonMincho, or any number of other font names. Typically, each physical font supports only a limited set of writing systems, for example, only Latin characters or only Japanese and Basic Latin. The set of available physical fonts varies between configurations. Applications that require specific fonts can bundle them and instantiate them using the createFont sample code for java.awt.Font.createFont(int, java.io.InputStream) definition code for java.awt.Font.createFont(int, java.io.InputStream) method.

Logical fonts are the five font families defined by the Java platform which must be supported by any Java runtime environment: Serif, SansSerif, Monospaced, Dialog, and DialogInput. These logical fonts are not actual font libraries. Instead, the logical font names are mapped to physical fonts by the Java runtime environment. The mapping is implementation and usually locale dependent, so the look and the metrics provided by them vary. Typically, each logical font name maps to several physical fonts in order to cover a large range of characters.

Peered AWT components, such as Label sample code for java.awt.Label definition code for java.awt.Label and TextField sample code for java.awt.TextField definition code for java.awt.TextField , can only use logical fonts.

For a discussion of the relative advantages and disadvantages of using physical or logical fonts, see the Internationalization FAQ document.

Font Faces and Names

A Font can have many faces, such as heavy, medium, oblique, gothic and regular. All of these faces have similar typographic design.

There are three different names that you can get from a Font object. The logical font name is simply the name that was used to construct the font. The font face name, or just font name for short, is the name of a particular font face, like Helvetica Bold. The family name is the name of the font family that determines the typographic design across several faces, like Helvetica.

The Font class represents an instance of a font face from a collection of font faces that are present in the system resources of the host system. As examples, Arial Bold and Courier Bold Italic are font faces. There can be several Font objects associated with a font face, each differing in size, style, transform and font features. The getAllFonts sample code for java.awt.GraphicsEnvironment.getAllFonts() definition code for java.awt.GraphicsEnvironment.getAllFonts() method of the GraphicsEnvironment class returns an array of all font faces available in the system. These font faces are returned as Font objects with a size of 1, identity transform and default font features. These base fonts can then be used to derive new Font objects with varying sizes, styles, transforms and font features via the deriveFont methods in this class.

See Also:
Serialized Form

Field Summary
static int BOLD sample code for java.awt.Font.BOLD definition code for java.awt.Font.BOLD
          The bold style constant.
static int CENTER_BASELINE sample code for java.awt.Font.CENTER_BASELINE definition code for java.awt.Font.CENTER_BASELINE
          The baseline used in ideographic scripts like Chinese, Japanese, and Korean when laying out text.
static int HANGING_BASELINE sample code for java.awt.Font.HANGING_BASELINE definition code for java.awt.Font.HANGING_BASELINE
          The baseline used in Devanigiri and similar scripts when laying out text.
static int ITALIC sample code for java.awt.Font.ITALIC definition code for java.awt.Font.ITALIC
          The italicized style constant.
static int LAYOUT_LEFT_TO_RIGHT sample code for java.awt.Font.LAYOUT_LEFT_TO_RIGHT definition code for java.awt.Font.LAYOUT_LEFT_TO_RIGHT
          A flag to layoutGlyphVector indicating that text is left-to-right as determined by Bidi analysis.
static int LAYOUT_NO_LIMIT_CONTEXT sample code for java.awt.Font.LAYOUT_NO_LIMIT_CONTEXT definition code for java.awt.Font.LAYOUT_NO_LIMIT_CONTEXT
          A flag to layoutGlyphVector indicating that text in the char array after the indicated limit should not be examined.
static int LAYOUT_NO_START_CONTEXT sample code for java.awt.Font.LAYOUT_NO_START_CONTEXT definition code for java.awt.Font.LAYOUT_NO_START_CONTEXT
          A flag to layoutGlyphVector indicating that text in the char array before the indicated start should not be examined.
static int LAYOUT_RIGHT_TO_LEFT sample code for java.awt.Font.LAYOUT_RIGHT_TO_LEFT definition code for java.awt.Font.LAYOUT_RIGHT_TO_LEFT
          A flag to layoutGlyphVector indicating that text is right-to-left as determined by Bidi analysis.
protected  String sample code for java.lang.String definition code for java.lang.String name sample code for java.awt.Font.name definition code for java.awt.Font.name
          The logical name of this Font, as passed to the constructor.
static int PLAIN sample code for java.awt.Font.PLAIN definition code for java.awt.Font.PLAIN
          The plain style constant.
protected  float pointSize sample code for java.awt.Font.pointSize definition code for java.awt.Font.pointSize
          The point size of this Font in float.
static int ROMAN_BASELINE sample code for java.awt.Font.ROMAN_BASELINE definition code for java.awt.Font.ROMAN_BASELINE
          The baseline used in most Roman scripts when laying out text.
protected  int size sample code for java.awt.Font.size definition code for java.awt.Font.size
          The point size of this Font, rounded to integer.
protected  int style sample code for java.awt.Font.style definition code for java.awt.Font.style
          The style of this Font, as passed to the constructor.
static int TRUETYPE_FONT sample code for java.awt.Font.TRUETYPE_FONT definition code for java.awt.Font.TRUETYPE_FONT
          Identify a font resource of type TRUETYPE.
static int TYPE1_FONT sample code for java.awt.Font.TYPE1_FONT definition code for java.awt.Font.TYPE1_FONT
          Identify a font resource of type TYPE1.
 
Constructor Summary
Font sample code for java.awt.Font.Font(java.util.Map) definition code for java.awt.Font.Font(java.util.Map) (Map sample code for java.util.Map definition code for java.util.Map <? extends AttributedCharacterIterator.Attribute sample code for java.text.AttributedCharacterIterator.Attribute definition code for java.text.AttributedCharacterIterator.Attribute ,?> attributes)
          Creates a new Font with the specified attributes.
Font sample code for java.awt.Font.Font(java.lang.String, int, int) definition code for java.awt.Font.Font(java.lang.String, int, int) (String sample code for java.lang.String definition code for java.lang.String  name, int style, int size)
          Creates a new Font from the specified name, style and point size.
 
Method Summary
 boolean canDisplay sample code for java.awt.Font.canDisplay(char) definition code for java.awt.Font.canDisplay(char) (char c)
          Checks if this Font has a glyph for the specified character.
 boolean canDisplay sample code for java.awt.Font.canDisplay(int) definition code for java.awt.Font.canDisplay(int) (int codePoint)
          Checks if this Font has a glyph for the specified character.
 int canDisplayUpTo sample code for java.awt.Font.canDisplayUpTo(char[], int, int) definition code for java.awt.Font.canDisplayUpTo(char[], int, int) (char[] text, int start, int limit)
          Indicates whether or not this Font can display the characters in the specified text starting at start and ending at limit.
 int canDisplayUpTo sample code for java.awt.Font.canDisplayUpTo(java.text.CharacterIterator, int, int) definition code for java.awt.Font.canDisplayUpTo(java.text.CharacterIterator, int, int) (CharacterIterator sample code for java.text.CharacterIterator definition code for java.text.CharacterIterator  iter, int start, int limit)
          Indicates whether or not this Font can display the text specified by the iter starting at start and ending at limit.
 int canDisplayUpTo sample code for java.awt.Font.canDisplayUpTo(java.lang.String) definition code for java.awt.Font.canDisplayUpTo(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  str)
          Indicates whether or not this Font can display a specified String.
static Font sample code for java.awt.Font definition code for java.awt.Font createFont sample code for java.awt.Font.createFont(int, java.io.File) definition code for java.awt.Font.createFont(int, java.io.File) (int fontFormat, File sample code for java.io.File definition code for java.io.File  fontFile)
          Returns a new Font using the specified font type and the specified font file.
static Font sample code for java.awt.Font definition code for java.awt.Font createFont sample code for java.awt.Font.createFont(int, java.io.InputStream) definition code for java.awt.Font.createFont(int, java.io.InputStream) (int fontFormat, InputStream sample code for java.io.InputStream definition code for java.io.InputStream  fontStream)
          Returns a new Font using the specified font type and input data.
 GlyphVector sample code for java.awt.font.GlyphVector definition code for java.awt.font.GlyphVector createGlyphVector sample code for java.awt.Font.createGlyphVector(java.awt.font.FontRenderContext, char[]) definition code for java.awt.Font.createGlyphVector(java.awt.font.FontRenderContext, char[]) (FontRenderContext sample code for java.awt.font.FontRenderContext definition code for java.awt.font.FontRenderContext  frc, char[] chars)
          Creates a GlyphVector sample code for java.awt.font.GlyphVector definition code for java.awt.font.GlyphVector by mapping characters to glyphs one-to-one based on the Unicode cmap in this Font.
 GlyphVector sample code for java.awt.font.GlyphVector definition code for java.awt.font.GlyphVector createGlyphVector sample code for java.awt.Font.createGlyphVector(java.awt.font.FontRenderContext, java.text.CharacterIterator) definition code for java.awt.Font.createGlyphVector(java.awt.font.FontRenderContext, java.text.CharacterIterator) (FontRenderContext sample code for java.awt.font.FontRenderContext definition code for java.awt.font.FontRenderContext  frc, CharacterIterator sample code for java.text.CharacterIterator definition code for java.text.CharacterIterator  ci)
          Creates a GlyphVector sample code for java.awt.font.GlyphVector definition code for java.awt.font.GlyphVector by mapping the specified characters to glyphs one-to-one based on the Unicode cmap in this Font.
 GlyphVector sample code for java.awt.font.GlyphVector definition code for java.awt.font.GlyphVector createGlyphVector sample code for java.awt.Font.createGlyphVector(java.awt.font.FontRenderContext, int[]) definition code for java.awt.Font.createGlyphVector(java.awt.font.FontRenderContext, int[]) (FontRenderContext sample code for java.awt.font.FontRenderContext definition code for java.awt.font.FontRenderContext  frc, int[] glyphCodes)
          Creates a GlyphVector sample code for java.awt.font.GlyphVector definition code for java.awt.font.GlyphVector by mapping characters to glyphs one-to-one based on the Unicode cmap in this Font.
 GlyphVector sample code for java.awt.font.GlyphVector definition code for java.awt.font.GlyphVector createGlyphVector sample code for java.awt.Font.createGlyphVector(java.awt.font.FontRenderContext, java.lang.String) definition code for java.awt.Font.createGlyphVector(java.awt.font.FontRenderContext, java.lang.String) (FontRenderContext sample code for java.awt.font.FontRenderContext definition code for java.awt.font.FontRenderContext  frc, String sample code for java.lang.String definition code for java.lang.String  str)
          Creates a GlyphVector sample code for java.awt.font.GlyphVector definition code for java.awt.font.GlyphVector by mapping characters to glyphs one-to-one based on the Unicode cmap in this Font.
static Font sample code for java.awt.Font definition code for java.awt.Font decode sample code for java.awt.Font.decode(java.lang.String) definition code for java.awt.Font.decode(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  str)
          Returns the Font that the str argument describes.
 Font sample code for java.awt.Font definition code for java.awt.Font deriveFont sample code for java.awt.Font.deriveFont(java.awt.geom.AffineTransform) definition code for java.awt.Font.deriveFont(java.awt.geom.AffineTransform) (AffineTransform sample code for java.awt.geom.AffineTransform definition code for java.awt.geom.AffineTransform  trans)
          Creates a new Font object by replicating the current Font object and applying a new transform to it.
 Font sample code for java.awt.Font definition code for java.awt.Font deriveFont sample code for java.awt.Font.deriveFont(float) definition code for java.awt.Font.deriveFont(float) (float size)
          Creates a new Font object by replicating the current Font object and applying a new size to it.
 Font sample code for java.awt.Font definition code for java.awt.Font deriveFont sample code for java.awt.Font.deriveFont(int) definition code for java.awt.Font.deriveFont(int) (int style)
          Creates a new Font object by replicating the current Font object and applying a new style to it.
 Font sample code for java.awt.Font definition code for java.awt.Font deriveFont sample code for java.awt.Font.deriveFont(int, java.awt.geom.AffineTransform) definition code for java.awt.Font.deriveFont(int, java.awt.geom.AffineTransform) (int style, AffineTransform sample code for java.awt.geom.AffineTransform definition code for java.awt.geom.AffineTransform  trans)
          Creates a new Font object by replicating this Font object and applying a new style and transform.
 Font sample code for java.awt.Font definition code for java.awt.Font deriveFont sample code for java.awt.Font.deriveFont(int, float) definition code for java.awt.Font.deriveFont(int, float) (int style, float size)
          Creates a new Font object by replicating this Font object and applying a new style and size.
 Font sample code for java.awt.Font definition code for java.awt.Font deriveFont sample code for java.awt.Font.deriveFont(java.util.Map) definition code for java.awt.Font.deriveFont(java.util.Map) (Map sample code for java.util.Map definition code for java.util.Map <? extends AttributedCharacterIterator.Attribute sample code for java.text.AttributedCharacterIterator.Attribute definition code for java.text.AttributedCharacterIterator.Attribute ,?> attributes)
          Creates a new Font object by replicating the current Font object and applying a new set of font attributes to it.
 boolean equals sample code for java.awt.Font.equals(java.lang.Object) definition code for java.awt.Font.equals(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  obj)
          Compares this Font object to the specified Object.
protected  void finalize sample code for java.awt.Font.finalize() definition code for java.awt.Font.finalize() ()
          Disposes the native Font object.
 Map sample code for java.util.Map definition code for java.util.Map <TextAttribute sample code for java.awt.font.TextAttribute definition code for java.awt.font.TextAttribute ,?> getAttributes sample code for java.awt.Font.getAttributes() definition code for java.awt.Font.getAttributes() ()
          Returns a map of font attributes available in this Font.
 AttributedCharacterIterator.Attribute sample code for java.text.AttributedCharacterIterator.Attribute definition code for java.text.AttributedCharacterIterator.Attribute [] getAvailableAttributes sample code for java.awt.Font.getAvailableAttributes() definition code for java.awt.Font.getAvailableAttributes() ()
          Returns the keys of all the attributes supported by this Font.
 byte getBaselineFor sample code for java.awt.Font.getBaselineFor(char) definition code for java.awt.Font.getBaselineFor(char) (char c)
          Returns the baseline appropriate for displaying this character.
 String sample code for java.lang.String definition code for java.lang.String getFamily sample code for java.awt.Font.getFamily() definition code for java.awt.Font.getFamily() ()
          Returns the family name of this Font.
 String sample code for java.lang.String definition code for java.lang.String getFamily sample code for java.awt.Font.getFamily(java.util.Locale) definition code for java.awt.Font.getFamily(java.util.Locale) (Locale sample code for java.util.Locale definition code for java.util.Locale  l)
          Returns the family name of this Font, localized for the specified locale.
static Font sample code for java.awt.Font definition code for java.awt.Font getFont sample code for java.awt.Font.getFont(java.util.Map) definition code for java.awt.Font.getFont(java.util.Map) (Map sample code for java.util.Map definition code for java.util.Map <? extends AttributedCharacterIterator.Attribute sample code for java.text.AttributedCharacterIterator.Attribute definition code for java.text.AttributedCharacterIterator.Attribute ,?> attributes)
          Returns a Font appropriate to this attribute set.
static Font sample code for java.awt.Font definition code for java.awt.Font getFont sample code for java.awt.Font.getFont(java.lang.String) definition code for java.awt.Font.getFont(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  nm)
          Returns a Font object from the system properties list.
static Font sample code for java.awt.Font definition code for java.awt.Font getFont sample code for java.awt.Font.getFont(java.lang.String, java.awt.Font) definition code for java.awt.Font.getFont(java.lang.String, java.awt.Font) (String sample code for java.lang.String definition code for java.lang.String  nm, Font sample code for java.awt.Font definition code for java.awt.Font  font)
          Gets the specified Font from the system properties list.
 String sample code for java.lang.String definition code for java.lang.String getFontName sample code for java.awt.Font.getFontName() definition code for java.awt.Font.getFontName() ()
          Returns the font face name of this Font.
 String sample code for java.lang.String definition code for java.lang.String getFontName sample code for java.awt.Font.getFontName(java.util.Locale) definition code for java.awt.Font.getFontName(java.util.Locale) (Locale sample code for java.util.Locale definition code for java.util.Locale  l)
          Returns the font face name of the Font, localized for the specified locale.
 float getItalicAngle sample code for java.awt.Font.getItalicAngle() definition code for java.awt.Font.getItalicAngle() ()
          Returns the italic angle of this Font.
 LineMetrics sample code for java.awt.font.LineMetrics definition code for java.awt.font.LineMetrics getLineMetrics sample code for java.awt.Font.getLineMetrics(char[], int, int, java.awt.font.FontRenderContext) definition code for java.awt.Font.getLineMetrics(char[], int, int, java.awt.font.FontRenderContext) (char[] chars, int beginIndex, int limit, FontRenderContext sample code for java.awt.font.FontRenderContext definition code for java.awt.font.FontRenderContext  frc)
          Returns a LineMetrics object created with the specified arguments.
 LineMetrics sample code for java.awt.font.LineMetrics definition code for java.awt.font.LineMetrics getLineMetrics sample code for java.awt.Font.getLineMetrics(java.text.CharacterIterator, int, int, java.awt.font.FontRenderContext) definition code for java.awt.Font.getLineMetrics(java.text.CharacterIterator, int, int, java.awt.font.FontRenderContext) (CharacterIterator sample code for java.text.CharacterIterator definition code for java.text.CharacterIterator  ci, int beginIndex, int limit, FontRenderContext sample code for java.awt.font.FontRenderContext definition code for java.awt.font.FontRenderContext  frc)
          Returns a LineMetrics object created with the specified arguments.
 LineMetrics sample code for java.awt.font.LineMetrics definition code for java.awt.font.LineMetrics getLineMetrics sample code for java.awt.Font.getLineMetrics(java.lang.String, java.awt.font.FontRenderContext) definition code for java.awt.Font.getLineMetrics(java.lang.String, java.awt.font.FontRenderContext) (String sample code for java.lang.String definition code for java.lang.String  str, FontRenderContext sample code for java.awt.font.FontRenderContext definition code for java.awt.font.FontRenderContext  frc)
          Returns a LineMetrics sample code for java.awt.font.LineMetrics definition code for java.awt.font.LineMetrics object created with the specified String and FontRenderContext sample code for java.awt.font.FontRenderContext definition code for java.awt.font.FontRenderContext .
 LineMetrics sample code for java.awt.font.LineMetrics definition code for java.awt.font.LineMetrics getLineMetrics sample code for java.awt.Font.getLineMetrics(java.lang.String, int, int, java.awt.font.FontRenderContext) definition code for java.awt.Font.getLineMetrics(java.lang.String, int, int, java.awt.font.FontRenderContext) (String sample code for java.lang.String definition code for java.lang.String  str, int beginIndex, int limit, FontRenderContext sample code for java.awt.font.FontRenderContext definition code for java.awt.font.FontRenderContext  frc)
          Returns a LineMetrics object created with the specified arguments.
 Rectangle2D sample code for java.awt.geom.Rectangle2D definition code for java.awt.geom.Rectangle2D getMaxCharBounds sample code for java.awt.Font.getMaxCharBounds(java.awt.font.FontRenderContext) definition code for java.awt.Font.getMaxCharBounds(java.awt.font.FontRenderContext) (FontRenderContext sample code for java.awt.font.FontRenderContext definition code for java.awt.font.FontRenderContext  frc)
          Returns the bounds for the character with the maximum bounds as defined in the specified FontRenderContext.
 int getMissingGlyphCode sample code for java.awt.Font.getMissingGlyphCode() definition code for java.awt.Font.getMissingGlyphCode() ()
          Returns the glyphCode which is used when this Font does not have a glyph for a specified unicode.
 String sample code for java.lang.String definition code for java.lang.String getName sample code for java.awt.Font.getName() definition code for java.awt.Font.getName() ()
          Returns the logical name of this Font.
 int getNumGlyphs sample code for java.awt.Font.getNumGlyphs() definition code for java.awt.Font.getNumGlyphs() ()
          Returns the number of glyphs in this Font.
 FontPeer sample code for java.awt.peer.FontPeer definition code for java.awt.peer.FontPeer getPeer sample code for java.awt.Font.getPeer() definition code for java.awt.Font.getPeer() ()
          Deprecated. Font rendering is now platform independent.
 String sample code for java.lang.String definition code for java.lang.String getPSName sample code for java.awt.Font.getPSName() definition code for java.awt.Font.getPSName() ()
          Returns the postscript name of this Font.
 int getSize sample code for java.awt.Font.getSize() definition code for java.awt.Font.getSize() ()
          Returns the point size of this Font, rounded to an integer.
 float getSize2D sample code for java.awt.Font.getSize2D() definition code for java.awt.Font.getSize2D() ()
          Returns the point size of this Font in float value.
 Rectangle2D sample code for java.awt.geom.Rectangle2D definition code for java.awt.geom.Rectangle2D getStringBounds sample code for java.awt.Font.getStringBounds(char[], int, int, java.awt.font.FontRenderContext) definition code for java.awt.Font.getStringBounds(char[], int, int, java.awt.font.FontRenderContext) (char[] chars, int beginIndex, int limit, FontRenderContext sample code for java.awt.font.FontRenderContext definition code for java.awt.font.FontRenderContext  frc)
          Returns the logical bounds of the specified array of characters in the specified FontRenderContext.
 Rectangle2D sample code for java.awt.geom.Rectangle2D definition code for java.awt.geom.Rectangle2D getStringBounds sample code for java.awt.Font.getStringBounds(java.text.CharacterIterator, int, int, java.awt.font.FontRenderContext) definition code for java.awt.Font.getStringBounds(java.text.CharacterIterator, int, int, java.awt.font.FontRenderContext) (CharacterIterator sample code for java.text.CharacterIterator definition code for java.text.CharacterIterator  ci, int beginIndex, int limit, FontRenderContext sample code for java.awt.font.FontRenderContext definition code for java.awt.font.FontRenderContext  frc)
          Returns the logical bounds of the characters indexed in the specified CharacterIterator sample code for java.text.CharacterIterator definition code for java.text.CharacterIterator in the specified FontRenderContext.
 Rectangle2D sample code for java.awt.geom.Rectangle2D definition code for java.awt.geom.Rectangle2D getStringBounds sample code for java.awt.Font.getStringBounds(java.lang.String, java.awt.font.FontRenderContext) definition code for java.awt.Font.getStringBounds(java.lang.String, java.awt.font.FontRenderContext) (String sample code for java.lang.String definition code for java.lang.String  str, FontRenderContext sample code for java.awt.font.FontRenderContext definition code for java.awt.font.FontRenderContext  frc)
          Returns the logical bounds of the specified String in the specified FontRenderContext.
 Rectangle2D sample code for java.awt.geom.Rectangle2D definition code for java.awt.geom.Rectangle2D getStringBounds sample code for java.awt.Font.getStringBounds(java.lang.String, int, int, java.awt.font.FontRenderContext) definition code for java.awt.Font.getStringBounds(java.lang.String, int, int, java.awt.font.FontRenderContext) (String sample code for java.lang.String definition code for java.lang.String  str, int beginIndex, int limit, FontRenderContext sample code for java.awt.font.FontRenderContext definition code for java.awt.font.FontRenderContext  frc)
          Returns the logical bounds of the specified String in the specified FontRenderContext.