Java Utililty Methods Font from System

List of utility methods to do Font from System

Description

The list of methods to do Font from System are organized into topic(s).

Method

FontRenderContextgetDefaultFrc()
get Default Frc
if (DEFAULT_FRC == null) {
    AffineTransform tx;
    if (GraphicsEnvironment.isHeadless()) {
        tx = new AffineTransform();
    } else {
        tx = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice()
                .getDefaultConfiguration().getDefaultTransform();
    DEFAULT_FRC = new FontRenderContext(tx, false, false);
return DEFAULT_FRC;
StringgetDefaultMapXMLCreatorFontName()
Tries to find preferredMapXMLCreatorFontName font or takes the first in the list of available fonts.
final String[] availableFontFamilyNames = GraphicsEnvironment.getLocalGraphicsEnvironment()
        .getAvailableFontFamilyNames();
for (final String fontName : availableFontFamilyNames) {
    if (fontName.equals(preferredMapXMLCreatorFontName)) {
        return fontName;
return availableFontFamilyNames[0];
...
intgetDefaultMonoFontSize()
Get size of default monspaced font.
return MONOSPACED_FONT.getSize();
FontgetDefaultSansSerifFont()
Returns the default sans serif font.
if (_defaultSansSerifFont == null) {
    _defaultSansSerifFont = new Font("SansSerif", Font.PLAIN, 12);
return _defaultSansSerifFont;
String[]getSystemFontNames()
get System Font Names
return GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
VectorgetSystemFonts()
Returns the system font names within a collection.
GraphicsEnvironment gEnv = GraphicsEnvironment.getLocalGraphicsEnvironment();
Font[] tempFonts = gEnv.getAllFonts();
char dot = '.';
int dotIndex = 0;
char[] fontNameChars = null;
String fontName = null;
Vector<String> fontNames = new Vector<String>();
for (int i = 0; i < tempFonts.length; i++) {
...
MapgetSystemTextHints()
get System Text Hints
if (!systemTextHintsInitialized) {
    systemTextHints = (Map) Toolkit.getDefaultToolkit().getDesktopProperty("awt.font.desktophints");
    systemTextHintsInitialized = true;
return systemTextHints;