public class Java2DFontMetrics extends Object
Since FontState and FontInfo multiply all factors by size, we assume a "standard" font of FONT_SIZE.
Modifier and Type | Field and Description |
---|---|
static int |
FONT_FACTOR
This factor multiplies the calculated values to scale
to FOP internal measurements
|
static int |
FONT_SIZE
Font size standard used for metric measurements
|
Constructor and Description |
---|
Java2DFontMetrics()
Constructs a new Font-metrics.
|
Modifier and Type | Method and Description |
---|---|
int |
getAscender(String family,
int style,
int size)
Determines the font ascent of the Font described by this
FontMetrics object
|
int |
getCapHeight(String family,
int style,
int size)
The size of a capital letter measured from the font's baseline
|
int |
getDescender(String family,
int style,
int size)
Determines the font descent of the Font described by this
FontMetrics object
|
Font |
getFont(String family,
int style,
int size)
Returns a java.awt.Font instance for the desired
family, style and size type.
|
int |
getMaxAscent(String family,
int style,
int size)
Determines the font's maximum ascent of the Font described by the current
FontMetrics object
|
int |
getStrikeoutPosition(String family,
int style,
int size) |
int |
getStrikeoutThickness(String family,
int style,
int size) |
int |
getUnderlinePosition(String family,
int style,
int size) |
int |
getUnderlineThickness(String family,
int style,
int size) |
int[] |
getWidths(String family,
int style,
int size)
Return widths (in 1/1000ths of point size) of all
characters
|
int |
getXHeight(String family,
int style,
int size)
Determines the typical font height of a small cap letter
FontMetrics object
|
boolean |
hasChar(String family,
int style,
int size,
char c)
Indicates whether the font contains a particular character/glyph.
|
int |
width(int i,
String family,
int style,
int size)
Returns width (in 1/1000ths of point size) of character at
code point i
|
public static final int FONT_SIZE
public static final int FONT_FACTOR
public int getMaxAscent(String family, int style, int size)
family
- font family (java name) to usestyle
- font style (java def.) to usesize
- font sizepublic int getAscender(String family, int style, int size)
family
- font family (java name) to usestyle
- font style (java def.) to usesize
- font sizepublic int getCapHeight(String family, int style, int size)
family
- font familystyle
- font stylesize
- font sizepublic int getDescender(String family, int style, int size)
family
- font family (jave name) to usestyle
- font style (jave def.) to usesize
- font sizepublic int getXHeight(String family, int style, int size)
family
- font family (jave name) to usestyle
- font style (jave def.) to usesize
- font sizepublic int getUnderlinePosition(String family, int style, int size)
public int getUnderlineThickness(String family, int style, int size)
public int getStrikeoutPosition(String family, int style, int size)
public int getStrikeoutThickness(String family, int style, int size)
public int width(int i, String family, int style, int size)
i
- the character for which to get the widthfamily
- font family (jave name) to usestyle
- font style (jave def.) to usesize
- font sizepublic int[] getWidths(String family, int style, int size)
family
- font family (jave name) to usestyle
- font style (jave def.) to usesize
- font sizepublic Font getFont(String family, int style, int size)
family
- font family (jave name) to usestyle
- font style (jave def.) to usesize
- font sizepublic boolean hasChar(String family, int style, int size, char c)
family
- font family (jave name) to usestyle
- font style (jave def.) to usesize
- font sizec
- the glyph to checkCopyright © 2025 Apache Software Foundation. All rights reserved.