FontRenderContext
class is a container for the information needed to correctly measure text. The measurement of text can vary because of rules that map outlines to pixels, and rendering hints provided by an application. One such piece of information is a transform that scales typographical points to pixels. (A point is defined to be exactly 1/72 of an inch, which is slightly different than the traditional mechanical measurement of a point.) A character that is rendered at 12pt on a 600dpi device might have a different size than the same character rendered at 12pt on a 72dpi device because of such factors as rounding to pixel boundaries and hints that the font designer may have specified.
Anti-aliasing and Fractional-metrics specified by an application can also affect the size of a character because of rounding to pixel boundaries.
Typically, instances of FontRenderContext
are obtained from a {@link java.awt.Graphics2D Graphics2D} object. AFontRenderContext
which is directly constructed will most likely not represent any actual graphics device, and may lead to unexpected or incorrect results.
@see java.awt.RenderingHints#KEY_TEXT_ANTIALIASING @see java.awt.RenderingHints#KEY_FRACTIONALMETRICS @see java.awt.Graphics2D#getFontRenderContext() @see java.awt.font.LineMetrics
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|