textbender.o.awt
Class FontX
java.lang.Object
FontX
public class FontX
- extends Object
Font utilities and constants.
Field Summary |
static int |
EM
Rough size of the typographic em space, in pixels. |
static int |
EN
Rough size of the typographic en space, in pixels. |
Method Summary |
static float |
largest2PowerFractionalPointSize(Font baseFont,
String referenceString,
Dimension2D maxDimension,
FontRenderContext fontRenderContext)
|
static float |
largest2PowerMultiplePointSize(Font baseFont,
String referenceString,
Dimension2D maxDimension,
FontRenderContext fontRenderContext)
|
static float |
largest2PowerPointSize(Font baseFont,
String referenceString,
Dimension2D maxDimension,
FontRenderContext fontRenderContext)
|
static float |
largestPointSize(Font baseFont,
String referenceString,
Dimension2D maxDimension,
FontRenderContext fontRenderContext)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EN
public static final int EN
- Rough size of the typographic en space, in pixels.
Calculated as EM/2.
An en space is one-half the width of an em space...
[http://atlas.gc.ca/english/carto/type.html]
EM
public static final int EM
- Rough size of the typographic em space, in pixels.
Calculated from the platform default font,
making it suitable for gross-scale layout.
An em space is the square of the body of the printed type being used.
In twelve-point type an em would be 12 x 12 points,
in ten-point type an em would be 10 x 10 points, and so on.
The expression is derived from the letter 'm'
which is the widest letter in the lower-case alphabet.
[http://atlas.gc.ca/english/carto/type.html]
"Em's are typically used for font-relative horizontal sizes."
[http://www.w3.org/TR/MathML2/appendixh.html]
largest2PowerFractionalPointSize
public static float largest2PowerFractionalPointSize(Font baseFont,
String referenceString,
Dimension2D maxDimension,
FontRenderContext fontRenderContext)
- Returns:
- same as
largest2PowerPointSize
but search is further restricted to sizes that are less than or
equal to baseFont's size [never tested]
largest2PowerMultiplePointSize
public static float largest2PowerMultiplePointSize(Font baseFont,
String referenceString,
Dimension2D maxDimension,
FontRenderContext fontRenderContext)
- Returns:
- same as
largest2PowerPointSize
but search is further restricted to sizes that are greater than or
equal to baseFont's size
largest2PowerPointSize
public static float largest2PowerPointSize(Font baseFont,
String referenceString,
Dimension2D maxDimension,
FontRenderContext fontRenderContext)
- Returns:
- same as
largestPointSize
but search is
further restricted to sizes that are an integral power of 2 (half,
double, etc.) of baseFont's size [never tested]
largestPointSize
public static float largestPointSize(Font baseFont,
String referenceString,
Dimension2D maxDimension,
FontRenderContext fontRenderContext)
- Returns:
- largest point size of baseFont that, when used to render
referenceString, will allow it to fit within maxDimension [incomplete]