java.awt.Font Maven / Gradle / Ivy
/*
, 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. // *NOTICE
(c) 2005-2007 Sun Microsystems, Inc. All Rights Reserved.Neither this file nor any files generated from it describe a complete specification, and they may only be used as described below. For example, no permission is given for you to incorporate this file, in whole or in part, in an implementation of a Java specification.
Sun Microsystems Inc. owns the copyright in this file and it is provided to you for informative, as opposed to normative, use. The file and any files generated from it may be used to generate other informative documentation, such as a unified set of documents of API signatures for a platform that includes technologies expressed as Java APIs. The file may also be used to produce "compilation stubs," which allow applications to be compiled and validated for such platforms.
Any work generated from this file, such as unified javadocs or compiled stub files, must be accompanied by this notice in its entirety.
This work corresponds to the API signatures of JSR 217: Personal Basis Profile 1.1. In the event of a discrepency between this work and the JSR 217 specification, which is available at http://www.jcp.org/en/jsr/detail?id=217, the latter takes precedence. */ package java.awt; import java.io.*; // import java.awt.font.FontRenderContext; // import java.awt.font.GlyphVector; // import java.awt.font.LineMetrics; // import java.awt.font.TextAttribute; // import java.awt.font.TextLayout; // import java.awt.font.TransformAttribute; // import java.awt.geom.AffineTransform; // import java.awt.geom.Rectangle2D; // import java.awt.peer.FontPeer; import java.lang.ref.SoftReference; import java.text.AttributedCharacterIterator.Attribute; import java.text.CharacterIterator; import java.text.StringCharacterIterator; import java.util.HashMap; import java.util.Hashtable; import java.util.Locale; import java.util.Map; // import sun.awt.font.NativeFontWrapper; // import sun.awt.font.StandardGlyphVector; // import sun.java2d.FontSupport; // import sun.java2d.SunGraphicsEnvironment; // PBP/PP 6217602 /** * 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 onGraphics
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. * * 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. * *
* 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. *
* *
* For a discussion of the relative advantages and disadvantages of using * physical or logical fonts, see the * Internationalization FAQ * document. * *
Font Faces and Names
* * AFont
* 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 severalFont
objects * associated with a font face, each differing in size, style * and font features. * * * @version 1.181, 01/23/03 */ public class Font implements Serializable { /** * The plain style constant. */ public static final int PLAIN = 0; /** * The bold style constant. This can be combined with the other style * constants (except PLAIN) for mixed styles. */ public static final int BOLD = 1; /** * The italicized style constant. This can be combined with the other * style constants (except PLAIN) for mixed styles. */ public static final int ITALIC = 2; // /** // * The baseline used in most Roman scripts when laying out text. // */ // public static final int ROMAN_BASELINE = 0; // // /** // * The baseline used in ideographic scripts like Chinese, Japanese, // * and Korean when laying out text. // */ // public static final int CENTER_BASELINE = 0; // // /** // * The baseline used in Devanigiri and similar scripts when laying // * out text. // */ // public static final int HANGING_BASELINE = 0; // // /** // * Create a Font of type TRUETYPE. // * In future other types may be added to support other font types. // */ // public static final int TRUETYPE_FONT = 0; /** * The logical name of thisFont
, as passed to the * constructor. * @since JDK1.0 * * @serial * @see #getName */ protected String name; /** * The style of thisFont
, as passed to the constructor. * This style can be PLAIN, BOLD, ITALIC, or BOLD+ITALIC. * @since JDK1.0 * * @serial * @see #getStyle() */ protected int style; /** * The point size of thisFont
, rounded to integer. * @since JDK1.0 * * @serial * @see #getSize() */ protected int size; /** // * The point size of thisFont
infloat
. // * // * @serial // * @see #getSize() // * @see #getSize2D() // */ // protected float pointSize; // // /** // * A flag to layoutGlyphVector indicating that text is left-to-right as // * determined by Bidi analysis. // */ // public static final int LAYOUT_LEFT_TO_RIGHT = 0; // // /** // * A flag to layoutGlyphVector indicating that text is right-to-left as // * determined by Bidi analysis. // */ // public static final int LAYOUT_RIGHT_TO_LEFT = 0; // // /** // * A flag to layoutGlyphVector indicating that text in the char array // * before the indicated start should not be examined. // */ // public static final int LAYOUT_NO_START_CONTEXT = 0; // // /** // * A flag to layoutGlyphVector indicating that text in the char array // * after the indicated limit should not be examined. // */ // public static final int LAYOUT_NO_LIMIT_CONTEXT = 0; /** * A map of font attributes available in this font. * Attributes include things like ligatures and glyph substitution. * * @serial * @see #getAttributes() */ private Hashtable fRequestedAttributes; /** * TheFont
Serializable Data Form. * * @serial */ private int fontSerializedDataVersion; /* * JDK 1.1 serialVersionUID */ private static final long serialVersionUID = -4206021311591459213L; /** * Creates a newFont
from the specified name, style and * point size. * @param name the font name. This can be a logical font name or a * font face name. A logical name must be either: Dialog, DialogInput, * Monospaced, Serif, or SansSerif. Ifname
is *null
, thename
of the new *Font
is set to the name "Default". * @param style the style constant for theFont
* The style argument is an integer bitmask that may * be PLAIN, or a bitwise union of BOLD and/or ITALIC * (for example, ITALIC or BOLD|ITALIC). * If the style argument does not conform to one of the expected * integer bitmasks then the style is set to PLAIN. * @param size the point size of theFont
* @see GraphicsEnvironment#getAvailableFontFamilyNames * @since JDK1.0 */ public Font(String name, int style, int size) { } /** * Creates a newFont
with the specified attributes. * ThisFont
only recognizes keys defined in * {@link TextAttribute} as attributes. Ifattributes
* isnull
, a newFont
is initialized * with default attributes. * @param attributes the attributes to assign to the new *Font
, ornull
*/ public Font(Map attributes) { } // /** // * Gets the peer of thisFont
. // * @return the peer of theFont
. // * @since JDK1.1 // * @deprecated Font rendering is now platform independent. // */ // public FontPeer getPeer() { } /** * Returns aFont
appropriate to this attribute set. * * @param attributes the attributes to assign to the new *Font
* @return a newFont
created with the specified * attributes * @since 1.2 * @see java.awt.font.TextAttribute */ public static Font getFont(Map attributes) { return null; } // /** // * Returns a newFont
with the specified font type // * and input data. The newFont
is // * created with a point size of 1 and style {@link #PLAIN PLAIN}. // * This base font can then be used with thederiveFont
// * methods in this class to derive newFont
objects with // * varying sizes, styles, transforms and font features. This // * method does not close the {@link InputStream}. // * @param fontFormat the type of theFont
, which is // * {@link #TRUETYPE_FONT TRUETYPE_FONT} if a TrueType is desired. Other // * types might be provided in the future. // * @param fontStream anInputStream
object representing the // * input data for the font. // * @return a newFont
created with the specified font type. // * @throws IllegalArgumentException iffontType
is not // *TRUETYPE_FONT
// * @throws FontFormatException if thefontStream
data does // * not contain the required Truetype font tables. // * @throws IOException if thefontStream
// * cannot be completely read. // * @since 1.3 // */ // public static Font createFont(int fontFormat, InputStream fontStream) // throws FontFormatException, IOException // { } // /** // * Returns a copy of the transform associated with this // *Font
. // * @return an {@link AffineTransform} object representing the // * transform attribute of thisFont
object. // */ // public AffineTransform getTransform() { } // PBP/PP /** * Returns the family name of thisFont
. * *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 * {@link GraphicsEnvironment#getAvailableFontFamilyNames()} method. * *
Use
getName
to get the logical name of the font. * * @return aString
that is the family name of this *Font
. * * @see #getName * @since JDK1.1 */ public String getFamily() { return null;} // /** // * Returns the family name of thisFont
, 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 // * {@link GraphicsEnvironment#getAvailableFontFamilyNames()} method. // * // *
Use
getFontName
to get the font face name of the font. // * @param l locale for which to get the family name // * @return aString
representing the family name of the // * font, localized for the specified locale. // * @see #getFontName // * @see java.util.Locale // * @since 1.2 // */ // public String getFamily(Locale l) { } // /** // * Returns the postscript name of thisFont
. // * UsegetFamily
to get the family name of the font. // * UsegetFontName
to get the font face name of the font. // * @return aString
representing the postscript name of // * thisFont
. // * @since 1.2 // */ // public String getPSName() { } // PBP/PP /** * Returns the logical name of thisFont
. * UsegetFamily
to get the family name of the font. * * @return aString
representing the logical name of * thisFont
. * @see #getFamily * @since JDK1.0 */ public String getName() { return null;} // /** // * Returns the font face name of thisFont
. For example, // * Helvetica Bold could be returned as a font face name. // * UsegetFamily
to get the family name of the font. // * UsegetName
to get the logical name of the font. // * @return aString
representing the font face name of // * thisFont
. // * @see #getFamily // * @see #getName // * @since 1.2 // */ // public String getFontName() { } // // /** // * Returns the font face name of theFont
, localized // * for the specified locale. For example, Helvetica Fett could be // * returned as the font face name. // * UsegetFamily
to get the family name of the font. // * @param l a locale for which to get the font face name // * @return aString
representing the font face name, // * localized for the specified locale. // * @see #getFamily // * @see java.util.Locale // */ // public String getFontName(Locale l) { } /** * Returns the style of thisFont
. The style can be * PLAIN, BOLD, ITALIC, or BOLD+ITALIC. * @return the style of thisFont
* @see #isPlain * @see #isBold * @see #isItalic * @since JDK1.0 */ public int getStyle() { return 0; } // PBP/PP // [6187222] /** * Returns the point size of thisFont
, 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. In this case one point * is 1/72 of an inch. * @return the point size of this
Font
in 1/72 of an * inch units. * @since JDK1.0 */ public int getSize() { return 0; } // /** // * Returns the point size of thisFont
in // *float
value. // * @return the point size of thisFont
as a // *float
value. // * @see #getSize // * @since 1.2 // */ // public float getSize2D() { } /** * Indicates whether or not thisFont
object's style is * PLAIN. * @returntrue
if thisFont
has a * PLAIN sytle; *false
otherwise. * @see java.awt.Font#getStyle * @since JDK1.0 */ public boolean isPlain() { return false;} /** * Indicates whether or not thisFont
object's style is * BOLD. * @returntrue
if thisFont
object's * style is BOLD; *false
otherwise. * @see java.awt.Font#getStyle * @since JDK1.0 */ public boolean isBold() { return false; } /** * Indicates whether or not thisFont
object's style is * ITALIC. * @returntrue
if thisFont
object's * style is ITALIC; *false
otherwise. * @see java.awt.Font#getStyle * @since JDK1.0 */ public boolean isItalic() { return false; } // /** // * Indicates whether or not thisFont
object has a // * transform that affects its size in addition to the Size // * attribute. // * @returntrue
if thisFont
object // * has a non-identity AffineTransform attribute. // *false
otherwise. // * @see java.awt.Font#getTransform // * @since 1.4 // */ // public boolean isTransformed() { } /** * Returns aFont
object from the system properties list. * @param nm the property name * @return aFont
object that the property name * describes. * @since 1.2 */ public static Font getFont(String nm) { return null;} /** * Returns theFont
that thestr
* argument describes. * To ensure that this method returns the desired Font, * format thestr
parameter in * one of two ways: ** "fontfamilyname-style-pointsize" or
* "fontfamilyname style pointsize"* in which style is one of the three * case-insensitive strings: *
"BOLD"
,"BOLDITALIC"
, or *"ITALIC"
, and pointsize is a decimal * representation of the point size. * For example, if you want a font that is Arial, bold, and * a point size of 18, you would call this method with: * "Arial-BOLD-18". ** The default size is 12 and the default style is PLAIN. * If you don't specify a valid size, the returned *
Font
has a size of 12. If you don't specify * a valid style, the returned Font has a style of PLAIN. * If you do not provide a valid font family name in * thestr
argument, this method still returns * a valid font with a family name of "dialog". * To determine what font family names are available on * your system, use the * {@link GraphicsEnvironment#getAvailableFontFamilyNames()} method. * Ifstr
isnull
, a newFont
* is returned with the family name "dialog", a size of 12 and a * PLAIN style. * Ifstr
isnull
, * a newFont
is returned with the name "dialog", a * size of 12 and a PLAIN style. * @param str the name of the font, ornull
* @return theFont
object thatstr
* describes, or a new defaultFont
if *str
isnull
. * @see #getFamily * @since JDK1.1 */ public static Font decode(String str) { return null;} /** * Gets the specifiedFont
from the system properties * list. As in thegetProperty
method of *System
, the first * argument is treated as the name of a system property to be * obtained. TheString
value of this property is then * interpreted as aFont
object. ** The property value should be one of the following forms: *
*
* where style is one of the three case-insensitive strings *- fontname-style-pointsize *
- fontname-pointsize *
- fontname-style *
- fontname *
"BOLD"
,"BOLDITALIC"
, or *"ITALIC"
, and point size is a decimal * representation of the point size. ** The default style is
PLAIN
. The default point size * is 12. ** If the specified property is not found, the
font
* argument is returned instead. * @param nm the case-insensitive property name * @param font a defaultFont
to return if property *nm
is not defined * @return theFont
value of the property. * @see #decode(String) */ public static Font getFont(String nm, Font font) { return null;} /** * Returns a hashcode for thisFont
. * @return a hashcode value for thisFont
. * @since JDK1.0 */ public int hashCode() { return 0; } /** * Compares thisFont
object to the specified *Object
. * @param obj theObject
to compare * @returntrue
if the objects are the same * or if the argument is aFont
object * describing the same font as this object; *false
otherwise. * @since JDK1.0 */ public boolean equals(Object obj) { return false; } /** * Converts thisFont
object to aString
* representation. * @return aString
representation of this *Font
object. * @since JDK1.0 */ public String toString() { return null;} // // /** // * Returns the number of glyphs in thisFont
. Glyph codes // * for thisFont
range from 0 to // *getNumGlyphs()
- 1. // * @return the number of glyphs in thisFont
. // * @since 1.2 // */ // public int getNumGlyphs() { } // // /** // * Returns the glyphCode which is used when thisFont
// * does not have a glyph for a specified unicode. // * @return the glyphCode of thisFont
. // * @since 1.2 // */ // public int getMissingGlyphCode() { } // // /** // * 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. // * // * @param c a character used to identify the writing system // * @return the baseline appropriate for the specified character. // * @see LineMetrics#getBaselineOffsets // * @see #ROMAN_BASELINE // * @see #CENTER_BASELINE // * @see #HANGING_BASELINE // * @since 1.2 // */ // public byte getBaselineFor(char c) { } /** * Returns a map of font attributes available in this *
Font
. Attributes include things like ligatures and * glyph substitution. * @return the attributes map of thisFont
. */ public Map getAttributes() { return null; } // PBP/PP // [6187222] /** * Returns the keys of all the attributes supported by this *Font
. * @return an array containing the keys of all the attributes * supported by thisFont
. * @since 1.2 */ public Attribute[] getAvailableAttributes() { return null; } // /** // * Creates a newFont
object by replicating this // *Font
object and applying a new style and size. // * @param style the style for the newFont
// * @param size the size for the newFont
// * @return a newFont
object. // * @since 1.2 // */ // public Font deriveFont(int style, float size) { } // // /** // * Creates a newFont
object by replicating this // *Font
object and applying a new style and transform. // * @param style the style for the newFont
// * @param trans theAffineTransform
associated with the // * newFont
// * @return a newFont
object. // * @throws IllegalArgumentException iftrans
is // *null
// * @since 1.2 // */ // public Font deriveFont(int style, AffineTransform trans) { } // // /** // * Creates a newFont
object by replicating the current // *Font
object and applying a new size to it. // * @param size the size for the newFont
. // * @return a newFont
object. // * @since 1.2 // */ // public Font deriveFont(float size) { } // // /** // * Creates a newFont
object by replicating the current // *Font
object and applying a new transform to it. // * @param trans theAffineTransform
associated with the // * newFont
// * @return a newFont
object. // * @throws IllegalArgumentException iftrans
is // *null
// * @since 1.2 // */ // public Font deriveFont(AffineTransform trans) { } // // /** // * Creates a newFont
object by replicating the current // *Font
object and applying a new style to it. // * @param style the style for the newFont
// * @return a newFont
object. // * @since 1.2 // */ // public Font deriveFont(int style) { } // // /** // * Creates a newFont
object by replicating the current // *Font
object and applying a new set of font attributes // * to it. // * @param attributes a map of attributes enabled for the new // *Font
// * @return a newFont
object. // * @since 1.2 // */ // public Font deriveFont(Map attributes) { } // // /** // * Checks if thisFont
has a glyph for the specified // * character. // * @param c a unicode character code // * @returntrue
if thisFont
can display the // * character;false
otherwise. // * @since 1.2 // */ // public boolean canDisplay(char c) { } // // /** // * Indicates whether or not thisFont
can display a // * specifiedString
. For strings with Unicode encoding, // * it is important to know if a particular font can display the // * string. This method returns an offset into theString
// *str
which is the first character this // *Font
cannot display without using the missing glyph // * code. If theFont
can display all characters, -1 is // * returned. // * @param str aString
object // * @return an offset intostr
that points // * to the first character instr
that this // *Font
cannot display; or-1
if // * thisFont
can display all characters in // *str
. // * @since 1.2 // */ // public int canDisplayUpTo(String str) { } // // /** // * Indicates whether or not thisFont
can display // * the characters in the specifiedtext
// * starting atstart
and ending at // *limit
. This method is a convenience overload. // * @param text the specified array of characters // * @param start the specified starting offset into the specified array // * of characters // * @param limit the specified ending offset into the specified // * array of characters // * @return an offset intotext
that points // * to the first character intext
that this // *Font
cannot display; or-1
if // * thisFont
can display all characters in // *text
. // * @since 1.2 // */ // public int canDisplayUpTo(char[] text, int start, int limit) { } // // /** // * Indicates whether or not thisFont
can display // * the specifiedString
. For strings with Unicode // * encoding, it is important to know if a particular font can display // * the string. This method returns an offset // * into theString
str
which is the first // * character thisFont
cannot display without using the // * missing glyph code . If thisFont
can display all // * characters,-1
is returned. // * @param iter a {@link CharacterIterator} object // * @param start the specified starting offset into the specified array // * of characters // * @param limit the specified ending offset into the specified // * array of characters // * @return an offset into theString
object that can be // * displayed by thisFont
. // * @since 1.2 // */ // public int canDisplayUpTo(CharacterIterator iter, int start, int limit) { } // // /** // * Returns the italic angle of thisFont
. The italic angle // * is the inverse slope of the caret which best matches the posture of this // *Font
. // * @see TextAttribute#POSTURE // * @return the angle of the ITALIC style of thisFont
. // */ // public float getItalicAngle() { } // // /** // * Checks whether or not thisFont
has uniform // * line metrics. A logicalFont
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 differentLineMetrics
. If the // * logicalFont
is a single // * font then the metrics would be uniform. // * @returntrue
if thisFont
has // * uniform line metrics;false
otherwise. // */ // public boolean hasUniformLineMetrics() { } // // /** // * Returns a {@link LineMetrics} object created with the specified // *String
and {@link FontRenderContext}. // * @param str the specifiedString
// * @param frc the specifiedFontRenderContext
// * @return aLineMetrics
object created with the // * specifiedString
and {@link FontRenderContext}. // */ // public LineMetrics getLineMetrics(String str, FontRenderContext frc) { } // // /** // * Returns aLineMetrics
object created with the // * specified arguments. // * @param str the specifiedString
// * @param beginIndex the initial offset ofstr
// * @param limit the end offset ofstr
// * @param frc the specifiedFontRenderContext
// * @return aLineMetrics
object created with the // * specified arguments. // */ // public LineMetrics getLineMetrics(String str, int beginIndex, int limit, // FontRenderContext frc) // { } // // /** // * Returns aLineMetrics
object created with the // * specified arguments. // * @param chars an array of characters // * @param beginIndex the initial offset ofchars
// * @param limit the end offset ofchars
// * @param frc the specifiedFontRenderContext
// * @return aLineMetrics
object created with the // * specified arguments. // */ // public LineMetrics getLineMetrics(char[] chars, int beginIndex, int limit, // FontRenderContext frc) // { } // // /** // * Returns aLineMetrics
object created with the // * specified arguments. // * @param ci the specifiedCharacterIterator
// * @param beginIndex the initial offset inci
// * @param limit the end offset ofci
// * @param frc the specifiedFontRenderContext
// * @return aLineMetrics
object created with the // * specified arguments. // */ // public LineMetrics getLineMetrics(CharacterIterator ci, int beginIndex, int // limit, FontRenderContext frc) // { } // // /** // * Returns the logical bounds of the specifiedString
in // * the specifiedFontRenderContext
. 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 {@link TextLayout#getBounds() getBounds} method of // *TextLayout
. // * @param str the specifiedString
// * @param frc the specifiedFontRenderContext
// * @return a {@link Rectangle2D} that is the bounding box of the // * specifiedString
in the specified // *FontRenderContext
. // * @see FontRenderContext // * @see Font#createGlyphVector // * @since 1.2 // */ // public Rectangle2D getStringBounds(String str, FontRenderContext frc) { } // // /** // * Returns the logical bounds of the specifiedString
in // * the specifiedFontRenderContext
. 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 {@link TextLayout#getBounds() getBounds} method of // *TextLayout
. // * @param str the specifiedString
// * @param beginIndex the initial offset ofstr
// * @param limit the end offset ofstr
// * @param frc the specifiedFontRenderContext
// * @return aRectangle2D
that is the bounding box of the // * specifiedString
in the specified // *FontRenderContext
. // * @throws IndexOutOfBoundsException ifbeginIndex
is // * less than zero, orlimit
is greater than the // * length ofstr
, orbeginIndex
// * is greater thanlimit
. // * @see FontRenderContext // * @see Font#createGlyphVector // * @since 1.2 // */ // public Rectangle2D getStringBounds(String str, int beginIndex, int limit, // FontRenderContext frc) // { } // // /** // * Returns the logical bounds of the specified array of characters // * in the specifiedFontRenderContext
. 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 {@link TextLayout#getBounds() getBounds} method of // *TextLayout
. // * @param chars an array of characters // * @param beginIndex the initial offset in the array of // * characters // * @param limit the end offset in the array of characters // * @param frc the specifiedFontRenderContext
// * @return aRectangle2D
that is the bounding box of the // * specified array of characters in the specified // *FontRenderContext
. // * @throws IndexOutOfBoundsException ifbeginIndex
is // * less than zero, orlimit
is greater than the // * length ofchars
, orbeginIndex
// * is greater thanlimit
. // * @see FontRenderContext // * @see Font#createGlyphVector // * @since 1.2 // */ // public Rectangle2D getStringBounds(char[] chars, int beginIndex, int limit, // FontRenderContext frc) // { } // // /** // * Returns the logical bounds of the characters indexed in the // * specified {@link CharacterIterator} in the // * specifiedFontRenderContext
. 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 {@link TextLayout#getBounds() getBounds} method of // *TextLayout
. // * @param ci the specifiedCharacterIterator
// * @param beginIndex the initial offset inci
// * @param limit the end offset inci
// * @param frc the specifiedFontRenderContext
// * @return aRectangle2D
that is the bounding box of the // * characters indexed in the specifiedCharacterIterator
// * in the specifiedFontRenderContext
. // * @see FontRenderContext // * @see Font#createGlyphVector // * @since 1.2 // * @throws IndexOutOfBoundsException ifbeginIndex
is // * less than the start index ofci
, or // *limit
is greater than the end index of // *ci
, orbeginIndex
is greater // * thanlimit
// */ // public Rectangle2D getStringBounds(CharacterIterator ci, int beginIndex, int // limit, FontRenderContext frc) // { } // // /** // * Returns the bounds for the character with the maximum // * bounds as defined in the specifiedFontRenderContext
. // * @param frc the specifiedFontRenderContext
// * @return aRectangle2D
that is the bounding box // * for the character with the maximum bounds. // */ // public Rectangle2D getMaxCharBounds(FontRenderContext frc) { } // // /** // * Creates a {@link java.awt.font.GlyphVector GlyphVector} by // * mapping characters to glyphs one-to-one based on the // * Unicode cmap in thisFont
. 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. // * @param frc the specifiedFontRenderContext
// * @param str the specifiedString
// * @return a newGlyphVector
created with the // * specifiedString
and the specified // *FontRenderContext
. // */ // public GlyphVector createGlyphVector(FontRenderContext frc, String str) { } // // /** // * Creates a {@link java.awt.font.GlyphVector GlyphVector} by // * mapping characters to glyphs one-to-one based on the // * Unicode cmap in thisFont
. 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. // * @param frc the specifiedFontRenderContext
// * @param chars the specified array of characters // * @return a newGlyphVector
created with the // * specified array of characters and the specified // *FontRenderContext
. // */ // public GlyphVector createGlyphVector(FontRenderContext frc, char[] chars) // { } // // /** // * Creates a {@link java.awt.font.GlyphVector GlyphVector} by // * mapping the specified characters to glyphs one-to-one based on the // * Unicode cmap in thisFont
. 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. // * @param frc the specifiedFontRenderContext
// * @param ci the specifiedCharacterIterator
// * @return a newGlyphVector
created with the // * specifiedCharacterIterator
and the specified // *FontRenderContext
. // */ // public GlyphVector createGlyphVector(FontRenderContext frc, // CharacterIterator ci) // { } // // /** // * Creates a {@link java.awt.font.GlyphVector GlyphVector} by // * mapping characters to glyphs one-to-one based on the // * Unicode cmap in thisFont
. 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. // * @param frc the specifiedFontRenderContext
// * @param glyphCodes the specified integer array // * @return a newGlyphVector
created with the // * specified integer array and the specified // *FontRenderContext
. // */ // public GlyphVector createGlyphVector(FontRenderContext frc, int[] // glyphCodes) // { } // // /** // * Returns a newGlyphVector
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. // *Bidi
// * 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. // * // * @param frc the specified
FontRenderContext
// * @param text the text to layout // * @param start the start of the text to use for theGlyphVector
// * @param limit the limit of the text to use for theGlyphVector
// * @param flags control flags as described above // * @return a newGlyphVector
representing the text between // * start and limit, with glyphs chosen and positioned so as to best represent // * the text // * @throws ArrayIndexOutOfBoundsException if start or limit is // * out of bounds // * @see java.text.Bidi // * @see #LAYOUT_LEFT_TO_RIGHT // * @see #LAYOUT_RIGHT_TO_LEFT // * @see #LAYOUT_NO_START_CONTEXT // * @see #LAYOUT_NO_LIMIT_CONTEXT // */ // public GlyphVector layoutGlyphVector(FontRenderContext frc, char[] text, int // start, int limit, int flags) // { } // // /** // * Disposes the nativeFont
object. // */ // protected void finalize() throws Throwable { } /** * Reads theObjectInputStream
. * Unrecognized keys or values will be ignored. * * @param s theObjectInputStream
to read * @serial * @see #writeObject(java.io.ObjectOutputStream) */ private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException { } /** * Writes default serializable fields to a stream. * * @param s theObjectOutputStream
to write * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener) * @see #readObject(java.io.ObjectInputStream) */ private void writeObject(ObjectOutputStream s) throws ClassNotFoundException, IOException { } }