|
Modifier and Type |
Method and Description |
|
canDisplay |
boolean canDisplay(char c)
Checks if this Font has a glyph for the specified
character.
public boolean canDisplay(char c)
-
Checks if this Font has a glyph for the specified
character.
Note: This method cannot handle supplementary
characters. To support all Unicode characters, including
supplementary characters, use the canDisplay(int)
method or canDisplayUpTo methods.
- Parameters:
c - the character for which a glyph is needed
- Returns:
true if this Font has a glyph for this
character; false otherwise.- Since:
- 1.2
|
|
canDisplay |
boolean canDisplay(int codePoint)
Checks if this Font has a glyph for the specified
character.
public boolean canDisplay(int codePoint)
-
Checks if this Font has a glyph for the specified
character.
- Parameters:
codePoint - the character (Unicode code point) for which a glyph
is needed.
- Returns:
true if this Font has a glyph for the
character; false otherwise.
- Throws:
java.lang.IllegalArgumentException - if the code point is not a valid Unicode
code point.- Since:
- 1.5
- See Also:
Character.isValidCodePoint(int)
|
|
canDisplayUpTo |
int canDisplayUpTo(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 .
public int canDisplayUpTo(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 . This method is a convenience overload.
- Parameters:
text - the specified array of char valuesstart - the specified starting offset (in
char s) into the specified array of
char valueslimit - the specified ending offset (in
char s) into the specified array of
char values
- Returns:
- an offset into
text that points
to the first character in text that this
Font cannot display; or -1 if
this Font can display all characters in
text . - Since:
- 1.2
|
|
canDisplayUpTo |
int canDisplayUpTo(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 .
public int canDisplayUpTo(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 .
- Parameters:
iter - a CharacterIterator objectstart - the specified starting offset into the specified
CharacterIterator .limit - the specified ending offset into the specified
CharacterIterator .
- Returns:
- an offset into
iter that points
to the first character in iter that this
Font cannot display; or -1 if
this Font can display all characters in
iter . - Since:
- 1.2
|
|
canDisplayUpTo |
int canDisplayUpTo(java.lang.String str)
Indicates whether or not this Font can display a
specified String .
public int canDisplayUpTo(java.lang.String str)
-
Indicates whether or not this Font can display a
specified String . For strings with Unicode encoding,
it is important to know if a particular font can display the
string. This method returns an offset into the String
str which is the first character this
Font cannot display without using the missing glyph
code. If the Font can display all characters, -1 is
returned.
- Parameters:
str - a String object
- Returns:
- an offset into
str that points
to the first character in str that this
Font cannot display; or -1 if
this Font can display all characters in
str . - Since:
- 1.2
|
|
createGlyphVector |
java.awt.font.GlyphVector createGlyphVector(java.awt.font.FontRenderContext frc,
char[] chars)
Creates a GlyphVector by
mapping characters to glyphs one-to-one based on the
Unicode cmap in this Font .
public java.awt.font.GlyphVector createGlyphVector(java.awt.font.FontRenderContext frc,
char[] chars)
-
Creates a GlyphVector by
mapping characters to glyphs one-to-one based on the
Unicode cmap in this Font . This method does no other
processing besides the mapping of glyphs to characters. This
means that this method is not useful for some scripts, such
as Arabic, Hebrew, Thai, and Indic, that require reordering,
shaping, or ligature substitution.
- Parameters:
frc - the specified FontRenderContext chars - the specified array of characters
- Returns:
- a new
GlyphVector created with the
specified array of characters and the specified
FontRenderContext .
|
|
createGlyphVector |
java.awt.font.GlyphVector createGlyphVector(java.awt.font.FontRenderContext frc,
java.text.CharacterIterator ci)
Creates a GlyphVector by
mapping the specified characters to glyphs one-to-one based on the
Unicode cmap in this Font .
public java.awt.font.GlyphVector createGlyphVector(java.awt.font.FontRenderContext frc,
java.text.CharacterIterator ci)
-
Creates a GlyphVector by
mapping the specified characters to glyphs one-to-one based on the
Unicode cmap in this Font . This method does no other
processing besides the mapping of glyphs to characters. This
means that this method is not useful for some scripts, such
as Arabic, Hebrew, Thai, and Indic, that require reordering,
shaping, or ligature substitution.
- Parameters:
frc - the specified FontRenderContext ci - the specified CharacterIterator
- Returns:
- a new
GlyphVector created with the
specified CharacterIterator and the specified
FontRenderContext .
|
|
createGlyphVector |
java.awt.font.GlyphVector createGlyphVector(java.awt.font.FontRenderContext frc,
int[] glyphCodes)
Creates a GlyphVector by
mapping characters to glyphs one-to-one based on the
Unicode cmap in this Font .
public java.awt.font.GlyphVector createGlyphVector(java.awt.font.FontRenderContext frc,
int[] glyphCodes)
-
Creates a GlyphVector by
mapping characters to glyphs one-to-one based on the
Unicode cmap in this Font . This method does no other
processing besides the mapping of glyphs to characters. This
means that this method is not useful for some scripts, such
as Arabic, Hebrew, Thai, and Indic, that require reordering,
shaping, or ligature substitution.
- Parameters:
frc - the specified FontRenderContext glyphCodes - the specified integer array
- Returns:
- a new
GlyphVector created with the
specified integer array and the specified
FontRenderContext .
|
|
createGlyphVector |
java.awt.font.GlyphVector createGlyphVector(java.awt.font.FontRenderContext frc,
java.lang.String str)
Creates a GlyphVector by
mapping characters to glyphs one-to-one based on the
Unicode cmap in this Font .
public java.awt.font.GlyphVector createGlyphVector(java.awt.font.FontRenderContext frc,
java.lang.String str)
-
Creates a GlyphVector by
mapping characters to glyphs one-to-one based on the
Unicode cmap in this Font . This method does no other
processing besides the mapping of glyphs to characters. This
means that this method is not useful for some scripts, such
as Arabic, Hebrew, Thai, and Indic, that require reordering,
shaping, or ligature substitution.
- Parameters:
frc - the specified FontRenderContext str - the specified String
- Returns:
- a new
GlyphVector created with the
specified String and the specified
FontRenderContext .
|
|
deriveFont |
Font deriveFont(java.awt.geom.AffineTransform trans)
Creates a new Font object by replicating the current
Font object and applying a new transform to it.
public Font deriveFont(java.awt.geom.AffineTransform trans)
-
Creates a new Font object by replicating the current
Font object and applying a new transform to it.
- Parameters:
trans - the AffineTransform associated with the
new Font
- Returns:
- a new
Font object.
- Throws:
java.lang.IllegalArgumentException - if trans is
null - Since:
- 1.2
|
|
deriveFont |
Font deriveFont(float size)
Creates a new Font object by replicating the current
Font object and applying a new size to it.
public Font deriveFont(float size)
-
Creates a new Font object by replicating the current
Font object and applying a new size to it.
- Parameters:
size - the size for the new Font .
- Returns:
- a new
Font object. - Since:
- 1.2
|
|
deriveFont |
Font deriveFont(int style)
Creates a new Font object by replicating the current
Font object and applying a new style to it.
public Font deriveFont(int style)
-
Creates a new Font object by replicating the current
Font object and applying a new style to it.
- Parameters:
style - the style for the new Font
- Returns:
- a new
Font object. - Since:
- 1.2
|
|
deriveFont |
Font deriveFont(int style,
java.awt.geom.AffineTransform trans)
Creates a new Font object by replicating this
Font object and applying a new style and transform.
public Font deriveFont(int style,
java.awt.geom.AffineTransform trans)
-
Creates a new Font object by replicating this
Font object and applying a new style and transform.
- Parameters:
style - the style for the new Font trans - the AffineTransform associated with the
new Font
- Returns:
- a new
Font object.
- Throws:
java.lang.IllegalArgumentException - if trans is
null - Since:
- 1.2
|
|
deriveFont |
Font deriveFont(int style,
float size)
Creates a new Font object by replicating this
Font object and applying a new style and size.
public Font deriveFont(int style,
float size)
-
Creates a new Font object by replicating this
Font object and applying a new style and size.
- Parameters:
style - the style for the new Font size - the size for the new Font
- Returns:
- a new
Font object. - Since:
- 1.2
|
|
deriveFont |
Font deriveFont(java.util.Map<? extends 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.
public Font deriveFont(java.util.Map<? extends 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.
- Parameters:
attributes - a map of attributes enabled for the new
Font
- Returns:
- a new
Font object. - Since:
- 1.2
|
|
equals |
boolean equals(java.lang.Object obj)
Compares this Font object to the specified
Object .
public boolean equals(java.lang.Object obj)
-
Compares this Font object to the specified
Object .
- Overrides:
equals in class java.lang.Object
- Parameters:
obj - the Object to compare
- Returns:
true if the objects are the same
or if the argument is a Font object
describing the same font as this object;
false otherwise.- Since:
- JDK1.0
- See Also:
Object.hashCode() ,
HashMap
|
|
getAttributes |
java.util.Map<java.awt.font.TextAttribute,?> getAttributes()
Returns a map of font attributes available in this
Font .
public java.util.Map<java.awt.font.TextAttribute,?> getAttributes()
-
Returns a map of font attributes available in this
Font . Attributes include things like ligatures and
glyph substitution.
- Returns:
- the attributes map of this
Font .
|
|
getAvailableAttributes |
java.text.AttributedCharacterIterator.Attribute[] getAvailableAttributes()
Returns the keys of all the attributes supported by this
Font .
public java.text.AttributedCharacterIterator.Attribute[] getAvailableAttributes()
-
Returns the keys of all the attributes supported by this
Font . These attributes can be used to derive other
fonts.
- Returns:
- an array containing the keys of all the attributes
supported by this
Font . - Since:
- 1.2
|
|
getBaselineFor |
byte getBaselineFor(char c)
Returns the baseline appropriate for displaying this character.
public byte getBaselineFor(char c)
-
Returns the baseline appropriate for displaying this character.
Large fonts can support different writing systems, and each system can
use a different baseline.
The character argument determines the writing system to use. Clients
should not assume all characters use the same baseline.
- Parameters:
c - a character used to identify the writing system
- Returns:
- the baseline appropriate for the specified character.
- Since:
- 1.2
- See Also:
LineMetrics.getBaselineOffsets() ,
ROMAN_BASELINE ,
CENTER_BASELINE ,
HANGING_BASELINE
|
|
getFamily |
java.lang.String getFamily()
Returns the family name of this Font .
public java.lang.String getFamily()
-
Returns the family name of this Font .
The family name of a font is font specific. Two fonts such as
Helvetica Italic and Helvetica Bold have the same family name,
Helvetica, whereas their font face names are
Helvetica Bold and Helvetica Italic. The list of
available family names may be obtained by using the
GraphicsEnvironment.getAvailableFontFamilyNames() method.
Use getName to get the logical name of the font.
Use getFontName to get the font face name of the font.
- Returns:
- a
String that is the family name of this
Font . - Since:
- JDK1.1
- See Also:
getName() ,
getFontName()
|
|
getFamily |
java.lang.String getFamily(java.util.Locale l)
Returns the family name of this Font , localized for
the specified locale.
public java.lang.String getFamily(java.util.Locale l)
-
Returns the family name of this Font , localized for
the specified locale.
The family name of a font is font specific. Two fonts such as
Helvetica Italic and Helvetica Bold have the same family name,
Helvetica, whereas their font face names are
Helvetica Bold and Helvetica Italic. The list of
available family names may be obtained by using the
GraphicsEnvironment.getAvailableFontFamilyNames() method.
Use getFontName to get the font face name of the font.
- Parameters:
l - locale for which to get the family name
- Returns:
- a
String representing the family name of the
font, localized for the specified locale. - Since:
- 1.2
- See Also:
getFontName() ,
Locale
|
|
getFontName |
java.lang.String getFontName()
Returns the font face name of this Font .
public java.lang.String getFontName()
-
Returns the font face name of this Font . For example,
Helvetica Bold could be returned as a font face name.
Use getFamily to get the family name of the font.
Use getName to get the logical name of the font.
- Returns:
- a
String representing the font face name of
this Font . - Since:
- 1.2
- See Also:
getFamily() ,
getName()
|
|
getFontName |
java.lang.String getFontName(java.util.Locale l)
Returns the font face name of the Font , localized
for the specified locale.
public java.lang.String getFontName(java.util.Locale l)
-
Returns the font face name of the Font , localized
for the specified locale. For example, Helvetica Fett could be
returned as the font face name.
Use getFamily to get the family name of the font.
- Parameters:
l - a locale for which to get the font face name
- Returns:
- a
String representing the font face name,
localized for the specified locale. - See Also:
getFamily() ,
Locale
|
|
getItalicAngle |
float getItalicAngle()
Returns the italic angle of this Font .
public float getItalicAngle()
-
Returns the italic angle of this Font . The italic angle
is the inverse slope of the caret which best matches the posture of this
Font .
- Returns:
- the angle of the ITALIC style of this
Font . - See Also:
TextAttribute.POSTURE
|
|
getLineMetrics |
java.awt.font.LineMetrics getLineMetrics(char[] chars,
int beginIndex,
int limit,
java.awt.font.FontRenderContext frc)
Returns a LineMetrics object created with the
specified arguments.
public java.awt.font.LineMetrics getLineMetrics(char[] chars,
int beginIndex,
int limit,
java.awt.font.FontRenderContext frc)
-
Returns a LineMetrics object created with the
specified arguments.
- Parameters:
chars - an array of charactersbeginIndex - the initial offset of chars limit - the end offset of chars frc - the specified FontRenderContext
- Returns:
- a
LineMetrics object created with the
specified arguments.
|
|
getLineMetrics |
java.awt.font.LineMetrics getLineMetrics(java.text.CharacterIterator ci,
int beginIndex,
int limit,
java.awt.font.FontRenderContext frc)
Returns a LineMetrics object created with the
specified arguments.
public java.awt.font.LineMetrics getLineMetrics(java.text.CharacterIterator ci,
int beginIndex,
int limit,
java.awt.font.FontRenderContext frc)
-
Returns a LineMetrics object created with the
specified arguments.
- Parameters:
ci - the specified CharacterIterator beginIndex - the initial offset in ci limit - the end offset of ci frc - the specified FontRenderContext
- Returns:
- a
LineMetrics object created with the
specified arguments.
|
|
getLineMetrics |
java.awt.font.LineMetrics getLineMetrics(java.lang.String str,
java.awt.font.FontRenderContext frc)
Returns a LineMetrics object created with the specified
String and FontRenderContext .
public java.awt.font.LineMetrics getLineMetrics(java.lang.String str,
java.awt.font.FontRenderContext frc)
-
Returns a LineMetrics object created with the specified
String and FontRenderContext .
- Parameters:
str - the specified String frc - the specified FontRenderContext
- Returns:
- a
LineMetrics object created with the
specified String and FontRenderContext .
|
|
getLineMetrics |
java.awt.font.LineMetrics getLineMetrics(java.lang.String str,
int beginIndex,
int limit,
java.awt.font.FontRenderContext frc)
Returns a LineMetrics object created with the
specified arguments.
public java.awt.font.LineMetrics getLineMetrics(java.lang.String str,
int beginIndex,
int limit,
java.awt.font.FontRenderContext frc)
-
Returns a LineMetrics object created with the
specified arguments.
- Parameters:
str - the specified String beginIndex - the initial offset of str limit - the end offset of str frc - the specified FontRenderContext
- Returns:
- a
LineMetrics object created with the
specified arguments.
|
|
getMaxCharBounds |
java.awt.geom.Rectangle2D getMaxCharBounds(java.awt.font.FontRenderContext frc)
Returns the bounds for the character with the maximum
bounds as defined in the specified FontRenderContext .
public java.awt.geom.Rectangle2D getMaxCharBounds(java.awt.font.FontRenderContext frc)
-
Returns the bounds for the character with the maximum
bounds as defined in the specified FontRenderContext .
Note: The returned bounds is in baseline-relative coordinates
(see class notes ).
- Parameters:
frc - the specified FontRenderContext
- Returns:
- a
Rectangle2D that is the bounding box
for the character with the maximum bounds.
|
|
getMissingGlyphCode |
int getMissingGlyphCode()
Returns the glyphCode which is used when this Font
does not have a glyph for a specified unicode code point.
public int getMissingGlyphCode()
-
Returns the glyphCode which is used when this Font
does not have a glyph for a specified unicode code point.
- Returns:
- the glyphCode of this
Font . - Since:
- 1.2
|
|
getName |
java.lang.String getName()
Returns the logical name of this Font .
public java.lang.String getName()
-
Returns the logical name of this Font .
Use getFamily to get the family name of the font.
Use getFontName to get the font face name of the font.
- Returns:
- a
String representing the logical name of
this Font . - Since:
- JDK1.0
- See Also:
getFamily() ,
getFontName()
|
|
getNumGlyphs |
int getNumGlyphs()
Returns the number of glyphs in this Font .
public int getNumGlyphs()
-
Returns the number of glyphs in this Font . Glyph codes
for this Font range from 0 to
getNumGlyphs() - 1.
- Returns:
- the number of glyphs in this
Font . - Since:
- 1.2
|
|
getPeer |
java.awt.peer.FontPeer getPeer()
Deprecated. Font rendering is now platform independent.
@Deprecated
public java.awt.peer.FontPeer getPeer()
Deprecated. Font rendering is now platform independent.
-
Gets the peer of this Font .
- Returns:
- the peer of the
Font . - Since:
- JDK1.1
|
|
getPSName |
java.lang.String getPSName()
Returns the postscript name of this Font .
public java.lang.String getPSName()
-
Returns the postscript name of this Font .
Use getFamily to get the family name of the font.
Use getFontName to get the font face name of the font.
- Returns:
- a
String representing the postscript name of
this Font . - Since:
- 1.2
|
|
getSize |
int getSize()
Returns the point size of this Font , rounded to
an integer.
public int getSize()
-
Returns the point size of this Font , rounded to
an integer.
Most users are familiar with the idea of using point size to
specify the size of glyphs in a font. This point size defines a
measurement between the baseline of one line to the baseline of the
following line in a single spaced text document. The point size is
based on typographic points, approximately 1/72 of an inch.
The Java(tm)2D API adopts the convention that one point is
equivalent to one unit in user coordinates. When using a
normalized transform for converting user space coordinates to
device space coordinates 72 user
space units equal 1 inch in device space. In this case one point
is 1/72 of an inch.
- Returns:
- the point size of this
Font in 1/72 of an
inch units. - Since:
- JDK1.0
- See Also:
getSize2D() ,
GraphicsConfiguration.getDefaultTransform() ,
GraphicsConfiguration.getNormalizingTransform()
|
|
getSize2D |
float getSize2D()
Returns the point size of this Font in
float value.
public float getSize2D()
-
Returns the point size of this Font in
float value.
- Returns:
- the point size of this
Font as a
float value. - Since:
- 1.2
- See Also:
getSize()
|
|
getStringBounds |
java.awt.geom.Rectangle2D getStringBounds(char[] chars,
int beginIndex,
int limit,
java.awt.font.FontRenderContext frc)
Returns the logical bounds of the specified array of characters
in the specified FontRenderContext .
public java.awt.geom.Rectangle2D getStringBounds(char[] chars,
int beginIndex,
int limit,
java.awt.font.FontRenderContext frc)
-
Returns the logical bounds of the specified array of characters
in the specified FontRenderContext . The logical
bounds contains the origin, ascent, advance, and height, which
includes the leading. The logical bounds does not always enclose
all the text. For example, in some languages and in some fonts,
accent marks can be positioned above the ascent or below the
descent. To obtain a visual bounding box, which encloses all the
text, use the getBounds method of
TextLayout .
Note: The returned bounds is in baseline-relative coordinates
(see class notes ).
- Parameters:
chars - an array of charactersbeginIndex - the initial offset in the array of
characterslimit - the end offset in the array of charactersfrc - the specified FontRenderContext
- Returns:
- a
Rectangle2D that is the bounding box of the
specified array of characters in the specified
FontRenderContext .
- Throws:
java.lang.IndexOutOfBoundsException - if beginIndex is
less than zero, or limit is greater than the
length of chars , or beginIndex
is greater than limit .- Since:
- 1.2
- See Also:
FontRenderContext ,
createGlyphVector(java.awt.font.FontRenderContext, java.lang.String)
|
|
getStringBounds |
java.awt.geom.Rectangle2D getStringBounds(java.text.CharacterIterator ci,
int beginIndex,
int limit,
java.awt.font.FontRenderContext frc)
Returns the logical bounds of the characters indexed in the
specified CharacterIterator in the
specified FontRenderContext .
public java.awt.geom.Rectangle2D getStringBounds(java.text.CharacterIterator ci,
int beginIndex,
int limit,
java.awt.font.FontRenderContext frc)
-
Returns the logical bounds of the characters indexed in the
specified CharacterIterator in the
specified FontRenderContext . The logical bounds
contains the origin, ascent, advance, and height, which includes
the leading. The logical bounds does not always enclose all the
text. For example, in some languages and in some fonts, accent
marks can be positioned above the ascent or below the descent.
To obtain a visual bounding box, which encloses all the text,
use the getBounds method of
TextLayout .
Note: The returned bounds is in baseline-relative coordinates
(see class notes ).
- Parameters:
ci - the specified CharacterIterator beginIndex - the initial offset in ci limit - the end offset in ci frc - the specified FontRenderContext
- Returns:
- a
Rectangle2D that is the bounding box of the
characters indexed in the specified CharacterIterator
in the specified FontRenderContext .
- Throws:
java.lang.IndexOutOfBoundsException - if beginIndex is
less than the start index of ci , or
limit is greater than the end index of
ci , or beginIndex is greater
than limit - Since:
- 1.2
- See Also:
FontRenderContext ,
createGlyphVector(java.awt.font.FontRenderContext, java.lang.String)
|
|
getStringBounds |
java.awt.geom.Rectangle2D getStringBounds(java.lang.String str,
java.awt.font.FontRenderContext frc)
Returns the logical bounds of the specified String in
the specified FontRenderContext .
public java.awt.geom.Rectangle2D getStringBounds(java.lang.String str,
java.awt.font.FontRenderContext frc)
-
Returns the logical bounds of the specified String in
the specified FontRenderContext . The logical bounds
contains the origin, ascent, advance, and height, which includes
the leading. The logical bounds does not always enclose all the
text. For example, in some languages and in some fonts, accent
marks can be positioned above the ascent or below the descent.
To obtain a visual bounding box, which encloses all the text,
use the getBounds method of
TextLayout .
Note: The returned bounds is in baseline-relative coordinates
(see class notes ).
- Parameters:
str - the specified String frc - the specified FontRenderContext
- Returns:
- a
Rectangle2D that is the bounding box of the
specified String in the specified
FontRenderContext . - Since:
- 1.2
- See Also:
FontRenderContext ,
createGlyphVector(java.awt.font.FontRenderContext, java.lang.String)
|
|
getStringBounds |
java.awt.geom.Rectangle2D getStringBounds(java.lang.String str,
int beginIndex,
int limit,
java.awt.font.FontRenderContext frc)
Returns the logical bounds of the specified String in
the specified FontRenderContext .
public java.awt.geom.Rectangle2D getStringBounds(java.lang.String str,
int beginIndex,
int limit,
java.awt.font.FontRenderContext frc)
-
Returns the logical bounds of the specified String in
the specified FontRenderContext . The logical bounds
contains the origin, ascent, advance, and height, which includes
the leading. The logical bounds does not always enclose all the
text. For example, in some languages and in some fonts, accent
marks can be positioned above the ascent or below the descent.
To obtain a visual bounding box, which encloses all the text,
use the getBounds method of
TextLayout .
Note: The returned bounds is in baseline-relative coordinates
(see class notes ).
- Parameters:
str - the specified String beginIndex - the initial offset of str limit - the end offset of str frc - the specified FontRenderContext
- Returns:
- a
Rectangle2D that is the bounding box of the
specified String in the specified
FontRenderContext .
- Throws:
java.lang.IndexOutOfBoundsException - if beginIndex is
less than zero, or limit is greater than the
length of str , or beginIndex
is greater than limit .- Since:
- 1.2
- See Also:
FontRenderContext ,
createGlyphVector(java.awt.font.FontRenderContext, java.lang.String)
|
|
getStyle |
int getStyle()
Returns the style of this Font .
public int getStyle()
-
Returns the style of this Font . The style can be
PLAIN, BOLD, ITALIC, or BOLD+ITALIC.
- Returns:
- the style of this
Font - Since:
- JDK1.0
- See Also:
isPlain() ,
isBold() ,
isItalic()
|
|
getTransform |
java.awt.geom.AffineTransform getTransform()
Returns a copy of the transform associated with this
Font .
public java.awt.geom.AffineTransform getTransform()
-
Returns a copy of the transform associated with this
Font . This transform is not necessarily the one
used to construct the font. If the font has algorithmic
superscripting or width adjustment, this will be incorporated
into the returned AffineTransform .
Typically, fonts will not be transformed. Clients generally
should call isTransformed() first, and only call this
method if isTransformed returns true.
- Returns:
- an
AffineTransform object representing the
transform attribute of this Font object.
|
|
hashCode |
int hashCode()
Returns a hashcode for this Font .
public int hashCode()
-
Returns a hashcode for this Font .
- Overrides:
hashCode in class java.lang.Object
- Returns:
- a hashcode value for this
Font . - Since:
- JDK1.0
- See Also:
Object.equals(java.lang.Object) ,
System.identityHashCode(java.lang.Object)
|
|
hasLayoutAttributes |
boolean hasLayoutAttributes()
Return true if this Font contains attributes that require extra
layout processing.
public boolean hasLayoutAttributes()
-
Return true if this Font contains attributes that require extra
layout processing.
- Returns:
- true if the font has layout attributes
- Since:
- 1.6
|
|
hasUniformLineMetrics |
boolean hasUniformLineMetrics()
Checks whether or not this Font has uniform
line metrics.
public boolean hasUniformLineMetrics()
-
Checks whether or not this Font has uniform
line metrics. A logical Font might be a
composite font, which means that it is composed of different
physical fonts to cover different code ranges. Each of these
fonts might have different LineMetrics . If the
logical Font is a single
font then the metrics would be uniform.
- Returns:
true if this Font has
uniform line metrics; false otherwise.
|
|
isBold |
boolean isBold()
Indicates whether or not this Font object's style is
BOLD.
public boolean isBold()
-
Indicates whether or not this Font object's style is
BOLD.
- Returns:
true if this Font object's
style is BOLD;
false otherwise.- Since:
- JDK1.0
- See Also:
getStyle()
|
|
isItalic |
boolean isItalic()
Indicates whether or not this Font object's style is
ITALIC.
public boolean isItalic()
-
Indicates whether or not this Font object's style is
ITALIC.
- Returns:
true if this Font object's
style is ITALIC;
false otherwise.- Since:
- JDK1.0
- See Also:
getStyle()
|
|
isPlain |
boolean isPlain()
Indicates whether or not this Font object's style is
PLAIN.
public boolean isPlain()
-
Indicates whether or not this Font object's style is
PLAIN.
- Returns:
true if this Font has a
PLAIN sytle;
false otherwise.- Since:
- JDK1.0
- See Also:
getStyle()
|
|
isTransformed |
boolean isTransformed()
Indicates whether or not this Font object has a
transform that affects its size in addition to the Size
attribute.
public boolean isTransformed()
-
Indicates whether or not this Font object has a
transform that affects its size in addition to the Size
attribute.
- Returns:
true if this Font object
has a non-identity AffineTransform attribute.
false otherwise.- Since:
- 1.4
- See Also:
getTransform()
|
|
layoutGlyphVector |
java.awt.font.GlyphVector layoutGlyphVector(java.awt.font.FontRenderContext frc,
char[] text,
int start,
int limit,
int flags)
Returns a new GlyphVector object, performing full
layout of the text if possible.
public java.awt.font.GlyphVector layoutGlyphVector(java.awt.font.FontRenderContext frc,
char[] text,
int start,
int limit,
int flags)
-
Returns a new GlyphVector object, performing full
layout of the text if possible. Full layout is required for
complex text, such as Arabic or Hindi. Support for different
scripts depends on the font and implementation.
Layout requires bidi analysis, as performed by
Bidi , and should only be performed on text that
has a uniform direction. The direction is indicated in the
flags parameter,by using LAYOUT_RIGHT_TO_LEFT to indicate a
right-to-left (Arabic and Hebrew) run direction, or
LAYOUT_LEFT_TO_RIGHT to indicate a left-to-right (English)
run direction.
In addition, some operations, such as Arabic shaping, require
context, so that the characters at the start and limit can have
the proper shapes. Sometimes the data in the buffer outside
the provided range does not have valid data. The values
LAYOUT_NO_START_CONTEXT and LAYOUT_NO_LIMIT_CONTEXT can be
added to the flags parameter to indicate that the text before
start, or after limit, respectively, should not be examined
for context.
All other values for the flags parameter are reserved.
- Parameters:
frc - the specified FontRenderContext text - the text to layoutstart - the start of the text to use for the GlyphVector limit - the limit of the text to use for the GlyphVector flags - control flags as described above
- Returns:
- a new
GlyphVector representing the text between
start and limit, with glyphs chosen and positioned so as to best represent
the text
- Throws:
java.lang.ArrayIndexOutOfBoundsException - if start or limit is
out of bounds- Since:
- 1.4
- See Also:
Bidi ,
LAYOUT_LEFT_TO_RIGHT ,
LAYOUT_RIGHT_TO_LEFT ,
LAYOUT_NO_START_CONTEXT ,
LAYOUT_NO_LIMIT_CONTEXT
|
|
toString |
java.lang.String toString()
Converts this Font object to a String
representation.
public java.lang.String toString()
-
Converts this Font object to a String
representation.
- Overrides:
toString in class java.lang.Object
- Returns:
- a
String representation of this
Font object. - Since:
- JDK1.0
|