| Modifier and Type | Field and Description |
|---|---|
| private String | |
| private int | |
| private final Map |
| Access | Constructor and Description |
|---|---|
| public | FontDetails(String
The font name. fontName, int The height of the font. height)Construct the font details with the given name and height. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| protected static String | |
| protected static String | |
| protected static String | |
| public static FontDetails | Returns: a new FontDetails instance.the font name fontName, Properties the property object holding the details of this
particular font. fontMetricsProps)Create an instance of |
| public int | |
| public String | |
| public int | |
| public int | Returns: The width of the string for a 10 point font.The string to measure. str)Gets the width of all characters in a string. |
| private static String[] |
| _fontName | back to summary |
|---|---|
| private String _fontName | |
| _height | back to summary |
|---|---|
| private int _height | |
| charWidths | back to summary |
|---|---|
| private final Map<Character, Integer> charWidths | |
| FontDetails | back to summary |
|---|---|
| public FontDetails(String fontName, int height) Construct the font details with the given name and height.
| |
| addChar | back to summary |
|---|---|
| public void addChar(char c, int width) | |
| addChars | back to summary |
|---|---|
| public void addChars(char[] characters, int[] widths) | |
| buildFontCharactersProperty | back to summary |
|---|---|
| protected static String buildFontCharactersProperty(String fontName) | |
| buildFontHeightProperty | back to summary |
|---|---|
| protected static String buildFontHeightProperty(String fontName) | |
| buildFontWidthsProperty | back to summary |
|---|---|
| protected static String buildFontWidthsProperty(String fontName) | |
| create | back to summary |
|---|---|
| public static FontDetails create(String fontName, Properties fontMetricsProps) Create an instance of
| |
| getCharWidth | back to summary |
|---|---|
| public int getCharWidth(char c) Retrieves the width of the specified character. If the metrics for a particular character are not available it defaults to returning the width for the 'W' character. | |
| getFontName | back to summary |
|---|---|
| public String getFontName() | |
| getHeight | back to summary |
|---|---|
| public int getHeight() | |
| getStringWidth | back to summary |
|---|---|
| public int getStringWidth(String str) Gets the width of all characters in a string.
| |
| split | back to summary |
|---|---|
| private static String[] split(String text, String separator, int max) Split the given string into an array of strings using the given delimiter. | |