|
|||||||||
| Home >> All >> java >> [ awt overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.awt
Class Font

java.lang.Objectjava.awt.Font
- All Implemented Interfaces:
- java.io.Serializable
- public class Font
- extends java.lang.Object
- implements java.io.Serializable
- extends java.lang.Object
This class represents a windowing system font.
| Field Summary | |
static int |
BOLD
Constant indicating a "bold" font. |
static int |
CENTER_BASELINE
Constant indicating the baseline mode characteristic of Chinese. |
static int |
HANGING_BASELINE
Constant indicating the baseline mode characteristic of Devanigri. |
static int |
ITALIC
Constant indicating an "italic" font. |
static int |
LAYOUT_LEFT_TO_RIGHT
A flag for layoutGlyphVector, indicating that the
orientation of a text run is from left to right. |
static int |
LAYOUT_NO_LIMIT_CONTEXT
A flag for layoutGlyphVector, indicating that the
text does not contain valid characters after the
limit position. |
static int |
LAYOUT_NO_START_CONTEXT
A flag for layoutGlyphVector, indicating that the
text does not contain valid characters before the
start position. |
static int |
LAYOUT_RIGHT_TO_LEFT
A flag for layoutGlyphVector, indicating that the
orientation of a text run is from right to left. |
protected java.lang.String |
name
The logical name of this font. |
private gnu.java.awt.peer.ClasspathFontPeer |
peer
|
static int |
PLAIN
Constant indicating a "plain" font. |
protected float |
pointSize
The size of this font in points. |
static int |
ROMAN_BASELINE
Constant indicating the baseline mode characteristic of Roman. |
private static long |
serialVersionUID
|
protected int |
size
The size of this font in points, rounded. |
protected int |
style
The style of this font -- PLAIN, BOLD, ITALIC or BOLD+ITALIC. |
static int |
TRUETYPE_FONT
Indicates to createFont that the supplied font data
is in TrueType format. |
| Constructor Summary | |
|
Font(java.util.Map attrs)
|
|
Font(java.lang.String name,
int style,
int size)
Initializes a new instance of Font with the specified
attributes. |
(package private) |
Font(java.lang.String name,
java.util.Map attrs)
|
| Method Summary | |
boolean |
canDisplay(char c)
Checks if specified character maps to a glyph in this font. |
int |
canDisplayUpTo(char[] text,
int start,
int limit)
Checks how much of a given sequence of text can be mapped to glyphs in this font. |
int |
canDisplayUpTo(java.text.CharacterIterator i,
int start,
int limit)
Checks how much of a given sequence of text can be mapped to glyphs in this font. |
int |
canDisplayUpTo(java.lang.String s)
Checks how much of a given string can be mapped to glyphs in this font. |
static Font |
createFont(int fontFormat,
java.io.InputStream is)
Creates a new font with point size 1 and PLAIN 55 style,
reading font data from the provided input stream. |
java.awt.font.GlyphVector |
createGlyphVector(java.awt.font.FontRenderContext ctx,
char[] chars)
Maps characters to glyphs in a one-to-one relationship, returning a new java.awt.font.GlyphVector with a mapped glyph for each input character. |
java.awt.font.GlyphVector |
createGlyphVector(java.awt.font.FontRenderContext ctx,
java.text.CharacterIterator i)
Maps characters to glyphs in a one-to-one relationship, returning a new java.awt.font.GlyphVector with a mapped glyph for each input character. |
java.awt.font.GlyphVector |
createGlyphVector(java.awt.font.FontRenderContext ctx,
int[] glyphCodes)
Extracts a sequence of glyphs from a font, returning a new java.awt.font.GlyphVector with a mapped glyph for each input glyph code. |
java.awt.font.GlyphVector |
createGlyphVector(java.awt.font.FontRenderContext ctx,
java.lang.String str)
Maps characters to glyphs in a one-to-one relationship, returning a new java.awt.font.GlyphVector with a mapped glyph for each input character. |
static Font |
decode(java.lang.String fontspec)
Creates a Font object from the specified string, which
is in one of the following formats:
|
Font |
deriveFont(java.awt.geom.AffineTransform a)
Produces a new Font based on the current font, subjected to a new affine transformation. |
Font |
deriveFont(float size)
Produces a new Font based on the current font, adjusted to a new size. |
Font |
deriveFont(int style)
Produces a new Font based on the current font, adjusted to a new style. |
Font |
deriveFont(int style,
java.awt.geom.AffineTransform a)
Produces a new Font based on the current font, adjusted to a new style and subjected to a new affine transformation. |
Font |
deriveFont(int style,
float size)
Produces a new Font based on the current font, adjusted to a new size and style. |
Font |
deriveFont(java.util.Map attributes)
Produces a new Font based on the current font, adjusted to a new set of attributes. |
boolean |
equals(java.lang.Object obj)
Tests whether or not the specified object is equal to this font. |
java.util.Map |
getAttributes()
Returns a map of chracter attributes which this font currently has set. |
java.text.AttributedCharacterIterator.Attribute[] |
getAvailableAttributes()
Returns an array of chracter attribute keys which this font understands. |
byte |
getBaselineFor(char c)
Returns a baseline code (one of ROMAN_BASELINE 55 , CENTER_BASELINE 55 or HANGING_BASELINE 55 ) indicating which baseline
this font will measure baseline offsets for, when presenting glyph
metrics for a given character. |
java.lang.String |
getFamily()
Returns the family name of this font. |
java.lang.String |
getFamily(java.util.Locale lc)
Returns the family name of this font. |
static Font |
getFont(java.util.Map attributes)
Returns a font appropriate for the given attribute set. |
static Font |
getFont(java.lang.String propname)
Returns a Font object from the passed property name. |
static Font |
getFont(java.lang.String propname,
Font defval)
Returns a Font object from the passed property name. |
(package private) static Font |
getFontFromToolkit(java.lang.String name,
java.util.Map attribs)
|
java.lang.String |
getFontName()
Returns the font face name of the font. |
java.lang.String |
getFontName(java.util.Locale lc)
Returns the font face name of the font. |
float |
getItalicAngle()
Returns the italic angle of this font, a measurement of its slant when style is ITALIC 55 . |
java.awt.font.LineMetrics |
getLineMetrics(char[] chars,
int begin,
int limit,
java.awt.font.FontRenderContext rc)
Returns a java.awt.font.LineMetrics object constructed with the specified text and java.awt.font.FontRenderContext. |
java.awt.font.LineMetrics |
getLineMetrics(java.text.CharacterIterator ci,
int begin,
int limit,
java.awt.font.FontRenderContext rc)
Returns a java.awt.font.LineMetrics object constructed with the specified text and java.awt.font.FontRenderContext. |
java.awt.font.LineMetrics |
getLineMetrics(java.lang.String str,
java.awt.font.FontRenderContext frc)
Determines the line metrics for a run of text. |
java.awt.font.LineMetrics |
getLineMetrics(java.lang.String text,
int begin,
int limit,
java.awt.font.FontRenderContext rc)
Returns a java.awt.font.LineMetrics object constructed with the specified text and java.awt.font.FontRenderContext. |
java.awt.geom.Rectangle2D |
getMaxCharBounds(java.awt.font.FontRenderContext rc)
Returns the maximal bounding box of all the bounding boxes in this font, when the font's bounding boxes are evaluated in a given java.awt.font.FontRenderContext |
int |
getMissingGlyphCode()
Returns the glyph code this font uses to represent missing glyphs. |
java.lang.String |
getName()
Returns the logical name of the font. |
int |
getNumGlyphs()
Returns the overall number of glyphs in this font. |
java.awt.peer.FontPeer |
getPeer()
Deprecated. |
(package private) static gnu.java.awt.peer.ClasspathFontPeer |
getPeerFromToolkit(java.lang.String name,
java.util.Map attrs)
|
java.lang.String |
getPSName()
Returns the PostScript Name of this font. |
int |
getSize()
Returns the size of the font, in typographics points (1/72 of an inch), rounded to an integer. |
float |
getSize2D()
Returns the size of the font, in typographics points (1/72 of an inch). |
java.awt.geom.Rectangle2D |
getStringBounds(char[] chars,
int begin,
int limit,
java.awt.font.FontRenderContext frc)
Returns the logical bounds of the specified string when rendered with this font in the specified java.awt.font.FontRenderContext. |
java.awt.geom.Rectangle2D |
getStringBounds(java.text.CharacterIterator ci,
int begin,
int limit,
java.awt.font.FontRenderContext frc)
Returns the logical bounds of the specified string when rendered with this font in the specified java.awt.font.FontRenderContext. |
java.awt.geom.Rectangle2D |
getStringBounds(java.lang.String str,
java.awt.font.FontRenderContext frc)
Returns the logical bounds of the specified string when rendered with this font in the specified java.awt.font.FontRenderContext. |
java.awt.geom.Rectangle2D |
getStringBounds(java.lang.String str,
int begin,
int limit,
java.awt.font.FontRenderContext frc)
Returns the logical bounds of the specified string when rendered with this font in the specified java.awt.font.FontRenderContext. |
int |
getStyle()
Returns integer code representing the sum of style flags of this font, a combination of either PLAIN 55 , BOLD 55 , or ITALIC 55 . |
java.awt.geom.AffineTransform |
getTransform()
Returns a copy of the affine transformation this font is currently subject to, if any. |
int |
hashCode()
Returns a hash value for this font. |
boolean |
hasUniformLineMetrics()
Indicates whether this font's line metrics are uniform. |
boolean |
isBold()
Tests whether or not this font is bold. |
boolean |
isItalic()
Tests whether or not this font is italic. |
boolean |
isPlain()
Tests whether or not this is a plain font. |
boolean |
isTransformed()
Indicates whether this font is subject to a non-identity affine transformation. |
java.awt.font.GlyphVector |
layoutGlyphVector(java.awt.font.FontRenderContext frc,
char[] chars,
int start,
int limit,
int flags)
Produces a glyph vector representing a full layout fo the specified text in this font. |
private void |
readObject(java.io.ObjectInputStream ois)
Reads the normal fields from the stream and then constructs the peer from the style and size through getPeerFromToolkit(). |
(package private) static gnu.java.awt.ClasspathToolkit |
tk()
|
java.lang.String |
toString()
Returns a string representation of this font. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
PLAIN
public static final int PLAIN
- Constant indicating a "plain" font.
- See Also:
- Constant Field Values
BOLD
public static final int BOLD
- Constant indicating a "bold" font.
- See Also:
- Constant Field Values
ITALIC
public static final int ITALIC
- Constant indicating an "italic" font.
- See Also:
- Constant Field Values
ROMAN_BASELINE
public static final int ROMAN_BASELINE
- Constant indicating the baseline mode characteristic of Roman.
- See Also:
- Constant Field Values
CENTER_BASELINE
public static final int CENTER_BASELINE
- Constant indicating the baseline mode characteristic of Chinese.
- See Also:
- Constant Field Values
HANGING_BASELINE
public static final int HANGING_BASELINE
- Constant indicating the baseline mode characteristic of Devanigri.
- See Also:
- Constant Field Values
TRUETYPE_FONT
public static final int TRUETYPE_FONT
- Indicates to
createFontthat the supplied font data is in TrueType format.Specification Note: The Sun JavaDoc for J2SE 1.4 does not indicate whether this value also subsumes OpenType. OpenType is essentially the same format as TrueType, but allows to define glyph shapes in the same way as PostScript, using cubic bezier curves.
- Since:
- 1.3
- See Also:
- Constant Field Values
LAYOUT_LEFT_TO_RIGHT
public static final int LAYOUT_LEFT_TO_RIGHT
- A flag for
layoutGlyphVector, indicating that the orientation of a text run is from left to right.- Since:
- 1.4
- See Also:
- Constant Field Values
LAYOUT_RIGHT_TO_LEFT
public static final int LAYOUT_RIGHT_TO_LEFT
- A flag for
layoutGlyphVector, indicating that the orientation of a text run is from right to left.- Since:
- 1.4
- See Also:
- Constant Field Values
LAYOUT_NO_START_CONTEXT
public static final int LAYOUT_NO_START_CONTEXT
- A flag for
layoutGlyphVector, indicating that the text does not contain valid characters before thestartposition. If this flag is set,layoutGlyphVectordoes not examine the text beforestart, even if this would be necessary to select the correct glyphs (e.g., for Arabic text).- Since:
- 1.4
- See Also:
- Constant Field Values
LAYOUT_NO_LIMIT_CONTEXT
public static final int LAYOUT_NO_LIMIT_CONTEXT
- A flag for
layoutGlyphVector, indicating that the text does not contain valid characters after thelimitposition. If this flag is set,layoutGlyphVectordoes not examine the text afterlimit, even if this would be necessary to select the correct glyphs (e.g., for Arabic text).- Since:
- 1.4
- See Also:
- Constant Field Values
name
protected java.lang.String name
- The logical name of this font.
- Since:
- 1.0
size
protected int size
- The size of this font in points, rounded.
- Since:
- 1.0
pointSize
protected float pointSize
- The size of this font in points.
- Since:
- 1.0
style
protected int style
- The style of this font -- PLAIN, BOLD, ITALIC or BOLD+ITALIC.
- Since:
- 1.0
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
peer
private transient gnu.java.awt.peer.ClasspathFontPeer peer
| Constructor Detail |
Font
public Font(java.lang.String name, int style, int size)
- Initializes a new instance of
Fontwith the specified attributes.
Font
public Font(java.util.Map attrs)
Font
Font(java.lang.String name, java.util.Map attrs)
| Method Detail |
decode
public static Font decode(java.lang.String fontspec)
- Creates a
Fontobject from the specified string, which is in one of the following formats:- fontname-style-pointsize
- fontname-style
- fontname-pointsize
- fontname
The style should be one of BOLD, ITALIC, or BOLDITALIC. The default style if none is specified is PLAIN. The default size if none is specified is 12.
tk
static gnu.java.awt.ClasspathToolkit tk()
getFontFromToolkit
static Font getFontFromToolkit(java.lang.String name, java.util.Map attribs)
getPeerFromToolkit
static gnu.java.awt.peer.ClasspathFontPeer getPeerFromToolkit(java.lang.String name, java.util.Map attrs)
getFont
public static Font getFont(java.lang.String propname, Font defval)
- Returns a
Fontobject from the passed property name.
getFont
public static Font getFont(java.lang.String propname)
- Returns a
Fontobject from the passed property name.
getName
public java.lang.String getName()
- Returns the logical name of the font. A logical name is the name the
font was constructed with. It may be the name of a logical font (one
of 6 required names in all java environments) or it may be a face
name.
getSize
public int getSize()
- Returns the size of the font, in typographics points (1/72 of an inch),
rounded to an integer.
getSize2D
public float getSize2D()
- Returns the size of the font, in typographics points (1/72 of an inch).
isPlain
public boolean isPlain()
- Tests whether or not this is a plain font. This will be true if
and only if neither the bold nor the italics style is set.
isBold
public boolean isBold()
- Tests whether or not this font is bold.
isItalic
public boolean isItalic()
- Tests whether or not this font is italic.
getFamily
public java.lang.String getFamily()
- Returns the family name of this font. A family name describes a design
or "brand name" (such as Helvetica or Palatino). It is less specific
than a font face name (such as Helvetica Bold).
- Since:
- 1.2
getStyle
public int getStyle()
- Returns integer code representing the sum of style flags of this font, a
combination of either
PLAIN55 ,BOLD55 , orITALIC55 .
canDisplay
public boolean canDisplay(char c)
- Checks if specified character maps to a glyph in this font.
- Since:
- 1.2
canDisplayUpTo
public int canDisplayUpTo(java.lang.String s)
- Checks how much of a given string can be mapped to glyphs in
this font.
- Since:
- 1.2
canDisplayUpTo
public int canDisplayUpTo(char[] text,
int start,
int limit)
- Checks how much of a given sequence of text can be mapped to glyphs in
this font.
- Since:
- 1.2
canDisplayUpTo
public int canDisplayUpTo(java.text.CharacterIterator i, int start, int limit)
- Checks how much of a given sequence of text can be mapped to glyphs in
this font.
- Since:
- 1.2
createFont
public static Font createFont(int fontFormat, java.io.InputStream is) throws FontFormatException, java.io.IOException
- Creates a new font with point size 1 and
PLAIN55 style, reading font data from the provided input stream. The resulting font can have further fonts derived from it using itsderiveFontmethod.- Since:
- 1.3
createGlyphVector
public java.awt.font.GlyphVector createGlyphVector(java.awt.font.FontRenderContext ctx, java.lang.String str)
- Maps characters to glyphs in a one-to-one relationship, returning a new
java.awt.font.GlyphVector with a mapped glyph for each input character. This
sort of mapping is often sufficient for some scripts such as Roman, but
is inappropriate for scripts with special shaping or contextual layout
requirements such as Arabic, Indic, Hebrew or Thai.
createGlyphVector
public java.awt.font.GlyphVector createGlyphVector(java.awt.font.FontRenderContext ctx, java.text.CharacterIterator i)
- Maps characters to glyphs in a one-to-one relationship, returning a new
java.awt.font.GlyphVector with a mapped glyph for each input character. This
sort of mapping is often sufficient for some scripts such as Roman, but
is inappropriate for scripts with special shaping or contextual layout
requirements such as Arabic, Indic, Hebrew or Thai.
createGlyphVector
public java.awt.font.GlyphVector createGlyphVector(java.awt.font.FontRenderContext ctx, char[] chars)
- Maps characters to glyphs in a one-to-one relationship, returning a new
java.awt.font.GlyphVector with a mapped glyph for each input character. This
sort of mapping is often sufficient for some scripts such as Roman, but
is inappropriate for scripts with special shaping or contextual layout
requirements such as Arabic, Indic, Hebrew or Thai.
createGlyphVector
public java.awt.font.GlyphVector createGlyphVector(java.awt.font.FontRenderContext ctx, int[] glyphCodes)
- Extracts a sequence of glyphs from a font, returning a new java.awt.font.GlyphVector with a mapped glyph for each input glyph code.
deriveFont
public Font deriveFont(int style, float size)
- Produces a new Font based on the current font, adjusted to a
new size and style.
- Since:
- 1.2
deriveFont
public Font deriveFont(float size)
- Produces a new Font based on the current font, adjusted to a
new size.
- Since:
- 1.2
deriveFont
public Font deriveFont(int style)
- Produces a new Font based on the current font, adjusted to a
new style.
- Since:
- 1.2
deriveFont
public Font deriveFont(int style, java.awt.geom.AffineTransform a)
- Produces a new Font based on the current font, adjusted to a
new style and subjected to a new affine transformation.
- Since:
- 1.2
deriveFont
public Font deriveFont(java.awt.geom.AffineTransform a)
- Produces a new Font based on the current font, subjected
to a new affine transformation.
- Since:
- 1.2
deriveFont
public Font deriveFont(java.util.Map attributes)
- Produces a new Font based on the current font, adjusted to a
new set of attributes.
- Since:
- 1.2
getAttributes
public java.util.Map getAttributes()
- Returns a map of chracter attributes which this font currently has set.
getAvailableAttributes
public java.text.AttributedCharacterIterator.Attribute[] getAvailableAttributes()
- Returns an array of chracter attribute keys which this font understands.
getBaselineFor
public byte getBaselineFor(char c)
- Returns a baseline code (one of
ROMAN_BASELINE55 ,CENTER_BASELINE55 orHANGING_BASELINE55 ) indicating which baseline this font will measure baseline offsets for, when presenting glyph metrics for a given character. Baseline offsets describe the position of a glyph relative to an invisible line drawn under, through the center of, or over a line of rendered text, respectively. Different scripts use different baseline modes, so clients should not assume all baseline offsets in a glyph vector are from a common baseline.- Since:
- 1.2
getFamily
public java.lang.String getFamily(java.util.Locale lc)
- Returns the family name of this font. A family name describes a
typographic style (such as Helvetica or Palatino). It is more specific
than a logical font name (such as Sans Serif) but less specific than a
font face name (such as Helvetica Bold).
- Since:
- 1.2
getFont
public static Font getFont(java.util.Map attributes)
- Returns a font appropriate for the given attribute set.
- Since:
- 1.2
getFontName
public java.lang.String getFontName()
- Returns the font face name of the font. A font face name describes a
specific variant of a font family (such as Helvetica Bold). It is more
specific than both a font family name (such as Helvetica) and a logical
font name (such as Sans Serif).
- Since:
- 1.2
getFontName
public java.lang.String getFontName(java.util.Locale lc)
- Returns the font face name of the font. A font face name describes a
specific variant of a font family (such as Helvetica Bold). It is more
specific than both a font family name (such as Helvetica).
- Since:
- 1.2
getItalicAngle
public float getItalicAngle()
- Returns the italic angle of this font, a measurement of its slant when
style is
ITALIC55 . The precise meaning is the inverse slope of a caret line which "best measures" the font's italic posture.
getLineMetrics
public java.awt.font.LineMetrics getLineMetrics(java.lang.String text, int begin, int limit, java.awt.font.FontRenderContext rc)
- Returns a java.awt.font.LineMetrics object constructed with the specified
text and java.awt.font.FontRenderContext.
getLineMetrics
public java.awt.font.LineMetrics getLineMetrics(char[] chars, int begin, int limit, java.awt.font.FontRenderContext rc)
- Returns a java.awt.font.LineMetrics object constructed with the specified
text and java.awt.font.FontRenderContext.
getLineMetrics
public java.awt.font.LineMetrics getLineMetrics(java.text.CharacterIterator ci, int begin, int limit, java.awt.font.FontRenderContext rc)
- Returns a java.awt.font.LineMetrics object constructed with the specified
text and java.awt.font.FontRenderContext.
getMaxCharBounds
public java.awt.geom.Rectangle2D getMaxCharBounds(java.awt.font.FontRenderContext rc)
- Returns the maximal bounding box of all the bounding boxes in this
font, when the font's bounding boxes are evaluated in a given java.awt.font.FontRenderContext
getMissingGlyphCode
public int getMissingGlyphCode()
- Returns the glyph code this font uses to represent missing glyphs. This
code will be present in glyph vectors when the font was unable to
locate a glyph to represent a particular character code.
- Since:
- 1.2
getNumGlyphs
public int getNumGlyphs()
- Returns the overall number of glyphs in this font. This number is one
more than the greatest glyph code used in any glyph vectors this font
produces. In other words, glyph codes are taken from the range
[ 0, getNumGlyphs() - 1 ].- Since:
- 1.2
getPSName
public java.lang.String getPSName()
- Returns the PostScript Name of this font.
- Since:
- 1.2
getStringBounds
public java.awt.geom.Rectangle2D getStringBounds(java.lang.String str, java.awt.font.FontRenderContext frc)
- Returns the logical bounds of the specified string when rendered with this
font in the specified java.awt.font.FontRenderContext. This box will include the
glyph origin, ascent, advance, height, and leading, but may not include all
diacritics or accents. To get the complete visual bounding box of all the
glyphs in a run of text, use the TextLayout.getBounds()>
TextLayout.getBounds()55 method of java.awt.font.TextLayout.
getStringBounds
public java.awt.geom.Rectangle2D getStringBounds(java.lang.String str, int begin, int limit, java.awt.font.FontRenderContext frc)
- Returns the logical bounds of the specified string when rendered with this
font in the specified java.awt.font.FontRenderContext. This box will include the
glyph origin, ascent, advance, height, and leading, but may not include all
diacritics or accents. To get the complete visual bounding box of all the
glyphs in a run of text, use the TextLayout.getBounds()>
TextLayout.getBounds()55 method of java.awt.font.TextLayout.- Since:
- 1.2
getStringBounds
public java.awt.geom.Rectangle2D getStringBounds(java.text.CharacterIterator ci, int begin, int limit, java.awt.font.FontRenderContext frc)
- Returns the logical bounds of the specified string when rendered with this
font in the specified java.awt.font.FontRenderContext. This box will include the
glyph origin, ascent, advance, height, and leading, but may not include all
diacritics or accents. To get the complete visual bounding box of all the
glyphs in a run of text, use the TextLayout.getBounds()>
TextLayout.getBounds()55 method of java.awt.font.TextLayout.- Since:
- 1.2
getStringBounds
public java.awt.geom.Rectangle2D getStringBounds(char[] chars, int begin, int limit, java.awt.font.FontRenderContext frc)
- Returns the logical bounds of the specified string when rendered with this
font in the specified java.awt.font.FontRenderContext. This box will include the
glyph origin, ascent, advance, height, and leading, but may not include all
diacritics or accents. To get the complete visual bounding box of all the
glyphs in a run of text, use the TextLayout.getBounds()>
TextLayout.getBounds()55 method of java.awt.font.TextLayout.- Since:
- 1.2
getTransform
public java.awt.geom.AffineTransform getTransform()
- Returns a copy of the affine transformation this font is currently
subject to, if any.
hasUniformLineMetrics
public boolean hasUniformLineMetrics()
- Indicates whether this font's line metrics are uniform. A font may be
composed of several "subfonts", each covering a different code range,
and each with their own line metrics. A font with no subfonts, or
subfonts with identical line metrics, is said to have "uniform" line
metrics.
isTransformed
public boolean isTransformed()
- Indicates whether this font is subject to a non-identity affine
transformation.
layoutGlyphVector
public java.awt.font.GlyphVector layoutGlyphVector(java.awt.font.FontRenderContext frc, char[] chars, int start, int limit, int flags)
- Produces a glyph vector representing a full layout fo the specified
text in this font. Full layouts may include complex shaping and
reordering operations, for scripts such as Arabic or Hindi.
Bidirectional (bidi) layout is not performed in this method; text
should have its bidi direction specified with one of the flags
LAYOUT_LEFT_TO_RIGHT55 orLAYOUT_RIGHT_TO_LEFT55 . Some types of layout (notably Arabic glyph shaping) may examine context characters beyond the bounds of the indicated range, in order to select an appropriate shape. The flagsLAYOUT_NO_START_CONTEXT55 andLAYOUT_NO_LIMIT_CONTEXT55 can be provided to prevent these extra context areas from being examined, for instance if they contain invalid characters.
getPeer
public java.awt.peer.FontPeer getPeer()
- Deprecated.
- Returns a native peer object for this font.
- Returns a native peer object for this font.
hashCode
public int hashCode()
- Returns a hash value for this font.
equals
public boolean equals(java.lang.Object obj)
- Tests whether or not the specified object is equal to this font. This
will be true if and only if:
- The object is not
null. - The object is an instance of
Font. - The object has the same names, style, size, and transform as this object.
- The object is not
toString
public java.lang.String toString()
- Returns a string representation of this font.
getLineMetrics
public java.awt.font.LineMetrics getLineMetrics(java.lang.String str, java.awt.font.FontRenderContext frc)
- Determines the line metrics for a run of text.
readObject
private void readObject(java.io.ObjectInputStream ois) throws java.io.IOException, java.lang.ClassNotFoundException
- Reads the normal fields from the stream and then constructs the
peer from the style and size through getPeerFromToolkit().
|
|||||||||
| Home >> All >> java >> [ awt overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
java.awt.Font