| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private transient float[] | |
| private float | |
| private int[] | |
| private static final int | |
| private static FontRenderContext | |
| private float | |
| private transient double[] | |
| private Font | |
| private transient FontStrike | |
| private transient FontRenderContext | |
| private AffineTransform | |
| private transient int | |
| private boolean | |
| private float | |
| private double[] | |
| private float | |
| private static final int | |
| private static final ConcurrentHashMap | |
| private static int | |
| private static final FontDesignMetrics[] | |
| private static float | |
| private static final long | serialVersionUID
Use serialVersionUID from JDK 1.3 for interoperability.
|
| private int | |
| private static final float | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| private | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| public int | charsWidth(char[] data, int off, int len)
Overrides java. Returns the total advance width for showing the specified array
of characters in this |
| public int | charWidth(char ch)
Overrides java. Returns the advance width of the specified character in this
|
| public int | charWidth(int ch)
Overrides java. Returns the advance width of the specified character in this
|
| public int | getAscent()
Overrides java. Determines the font ascent of the |
| private static FontRenderContext | |
| public int | getDescent()
Overrides java. Determines the font descent of the |
| public FontRenderContext | getFontRenderContext()
Overrides java. Gets the |
| public int | getHeight()
Overrides java. Gets the standard height of a line of text in this font. |
| private float | |
| public int | getLeading()
Overrides java. Determines the standard leading of the
|
| public int | getMaxAdvance()
Overrides java. Returns an estimate of the maximum advance width of any character
in the |
| public static FontDesignMetrics | |
| public static FontDesignMetrics | |
| public Rectangle2D | getSimpleBounds(char[] data, int off, int len)
This method is called from java.awt.Font only after verifying the arguments and that the text is simple and there are no layout attributes, font transform etc. |
| public int[] | Returns: an array storing the advance widths of the characters in theFont
described by this FontMetrics object.Overrides java. Gets the advance widths of the first 256 characters in the
|
| private float | |
| private void | |
| private void | |
| private void | |
| public int | stringWidth(String str)
Overrides java. Returns the total advance width for showing the specified
|
| private void |
| advCache | back to summary |
|---|---|
| private transient float[] advCache | |
| ascent | back to summary |
|---|---|
| private float ascent | |
| cache | back to summary |
|---|---|
| private int[] cache | |
| CURRENT_VERSION | back to summary |
|---|---|
| private static final int CURRENT_VERSION | |
| DEFAULT_FRC | back to summary |
|---|---|
| private static FontRenderContext DEFAULT_FRC | |
| descent | back to summary |
|---|---|
| private float descent | |
| devmatrix | back to summary |
|---|---|
| private transient double[] devmatrix | |
| font | back to summary |
|---|---|
| private Font font Hides java. | |
| fontStrike | back to summary |
|---|---|
| private transient FontStrike fontStrike | |
| frc | back to summary |
|---|---|
| private transient FontRenderContext frc | |
| frcTx | back to summary |
|---|---|
| private AffineTransform frcTx | |
| height | back to summary |
|---|---|
| private transient int height | |
| isAntiAliased | back to summary |
|---|---|
| private boolean isAntiAliased | |
| leading | back to summary |
|---|---|
| private float leading | |
| matrix | back to summary |
|---|---|
| private double[] matrix | |
| maxAdvance | back to summary |
|---|---|
| private float maxAdvance | |
| MAXRECENT | back to summary |
|---|---|
| private static final int MAXRECENT | |
| metricsCache | back to summary |
|---|---|
| private static final ConcurrentHashMap<Object, FontDesignMetrics. | |
| recentIndex | back to summary |
|---|---|
| private static int recentIndex | |
| recentMetrics | back to summary |
|---|---|
| private static final FontDesignMetrics[] recentMetrics | |
| roundingUpValue | back to summary |
|---|---|
| private static float roundingUpValue | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. Use serialVersionUID from JDK 1.3 for interoperability. | |
| serVersion | back to summary |
|---|---|
| private int serVersion | |
| UNKNOWN_WIDTH | back to summary |
|---|---|
| private static final float UNKNOWN_WIDTH | |
| usesFractionalMetrics | back to summary |
|---|---|
| private boolean usesFractionalMetrics | |
| FontDesignMetrics | back to summary |
|---|---|
| private FontDesignMetrics(Font font) | |
| FontDesignMetrics | back to summary |
|---|---|
| private FontDesignMetrics(Font font, FontRenderContext frc) | |
| charsWidth | back to summary |
|---|---|
| public int charsWidth(char[] data, int off, int len) Overrides java. Doc from java. Returns the total advance width for showing the specified array
of characters in this | |
| charWidth | back to summary |
|---|---|
| public int charWidth(char ch) Overrides java. Doc from java. Returns the advance width of the specified character in this
Note This method cannot handle
supplementary characters.
To support all Unicode characters, including
supplementary characters, use the | |
| charWidth | back to summary |
|---|---|
| public int charWidth(int ch) Overrides java. Doc from java. Returns the advance width of the specified character in this
This method doesn't validate the specified character to be a
valid Unicode code point. The caller must validate the
character value using | |
| getAscent | back to summary |
|---|---|
| public int getAscent() Overrides java. Doc from java. Determines the font ascent of the | |
| getDefaultFrc | back to summary |
|---|---|
| private static FontRenderContext getDefaultFrc() | |
| getDescent | back to summary |
|---|---|
| public int getDescent() Overrides java. Doc from java. Determines the font descent of the | |
| getFontRenderContext | back to summary |
|---|---|
| public FontRenderContext getFontRenderContext() Overrides java. Doc from java. Gets the
Note that methods in this class which take a | |
| getHeight | back to summary |
|---|---|
| public int getHeight() Overrides java. Doc from java. Gets the standard height of a line of text in this font. This is the distance between the baseline of adjacent lines of text. It is the sum of the leading + ascent + descent. Due to rounding this may not be the same as getAscent() + getDescent() + getLeading(). There is no guarantee that lines of text spaced at this distance are disjoint; such lines may overlap if some characters overshoot either the standard ascent or the standard descent metric. | |
| getLatinCharWidth | back to summary |
|---|---|
| private float getLatinCharWidth(char ch) | |
| getLeading | back to summary |
|---|---|
| public int getLeading() Overrides java. Doc from java. Determines the standard leading of the
| |
| getMaxAdvance | back to summary |
|---|---|
| public int getMaxAdvance() Overrides java. Doc from java. Returns an estimate of the maximum advance width of any character
in the The advance is the distance from the leftmost point used to position the character to the rightmost point along the baseline. This is not the same thing as the visible width of the glyph image representing the character.
The advance of a Some of the caveats of the reported value include
String
is not necessarily the sum of the advances the value still needs
to be used with caution.
In summary, this method makes no absolute guarantee, nor can it even make a guarantee to be correct within some margin of error. So it should be used at most only for estimating the total space sufficient to display some number of as yet unknown characters from the font. And that might be either an overestimate, or an underestimate depending on the specific text and rendering context. | |
| getMetrics | back to summary |
|---|---|
| public static FontDesignMetrics getMetrics(Font font) | |
| getMetrics | back to summary |
|---|---|
| public static FontDesignMetrics getMetrics(Font font, FontRenderContext frc) | |
| getSimpleBounds | back to summary |
|---|---|
| public Rectangle2D getSimpleBounds(char[] data, int off, int len) This method is called from java.awt.Font only after verifying the arguments and that the text is simple and there are no layout attributes, font transform etc. | |
| getWidths | back to summary |
|---|---|
| public int[] getWidths() Overrides java. Gets the advance widths of the first 256 characters in the
| |
| handleCharWidth | back to summary |
|---|---|
| private float handleCharWidth(int ch) | |
| initAdvCache | back to summary |
|---|---|
| private void initAdvCache() | |
| initMatrixAndMetrics | back to summary |
|---|---|
| private void initMatrixAndMetrics() | |
| readObject | back to summary |
|---|---|
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
| |
| stringWidth | back to summary |
|---|---|
| public int stringWidth(String str) Overrides java. Doc from java. Returns the total advance width for showing the specified
Note that the advance of a | |
| writeObject | back to summary |
|---|---|
private void writeObject(ObjectOutputStream out) throws IOException
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv Object | |
| pack-priv static ReferenceQueue |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| key | back to summary |
|---|---|
| pack-priv Object key | |
| queue | back to summary |
|---|---|
| pack-priv static ReferenceQueue<Object> queue | |
| KeyReference | back to summary |
|---|---|
| pack-priv KeyReference(Object key, Object value) | |
| dispose | back to summary |
|---|---|
| public void dispose() Implements sun. | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv Font | |
| pack-priv FontRenderContext | |
| pack-priv int | |
| pack-priv static final FontDesignMetrics. |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object key)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public int | |
| pack-priv void |
| font | back to summary |
|---|---|
| pack-priv Font font | |
| frc | back to summary |
|---|---|
| pack-priv FontRenderContext frc | |
| hash | back to summary |
|---|---|
| pack-priv int hash | |
| key | back to summary |
|---|---|
| pack-priv static final FontDesignMetrics. | |
| MetricsKey | back to summary |
|---|---|
| pack-priv MetricsKey() | |
| MetricsKey | back to summary |
|---|---|
| pack-priv MetricsKey(Font font, FontRenderContext frc) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object key) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| init | back to summary |
|---|---|
| pack-priv void init(Font font, FontRenderContext frc) | |