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

Font[]availableFonts()
available Fonts
GraphicsEnvironment environment = GraphicsEnvironment.getLocalGraphicsEnvironment();
return environment.getAllFonts();
SetgetAllAvaiableSystemMonoSpacedFonts()
get All Avaiable System Mono Spaced Fonts
Set<Font> monospacedFonts = new HashSet<Font>();
GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
String[] fontFamilyNames = graphicsEnvironment.getAvailableFontFamilyNames();
BufferedImage bufferedImage = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB);
Graphics graphics = bufferedImage.createGraphics();
for (String fontFamilyName : fontFamilyNames) {
    boolean isMonospaced = true;
    int fontStyle = Font.PLAIN;
...
ListgetAllAvailableFonts()
get All Available Fonts
return Arrays.asList(GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames());
SetgetAllFontNames()

Returns all the font names that are available in the system.

Set<String> set = new TreeSet<String>();
String[] fontNames = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
for (String fontName : fontNames) {
    set.add(fontName);
return set;
InsetsgetDefaultBorderInsets(int fontSize)
Returns the default border insets under the specified font size.
int inset = getAdjustedSize(fontSize, 2, 3, 1, false);
return new Insets(inset, inset, inset, inset);
FontgetDefaultFont()
Get the default font
if (dfltFont != null) {
    return dfltFont;
return null;
FontgetDefaultFont()
get Default Font
return defaultFont;
FontgetDefaultFont()
Get the Default Font for the Module
return new Font("SansSerif", Font.PLAIN, 10);
FontgetDefaultFont()
Returns a new instance of a default font.
return new Font("Helvetica", Font.BOLD, 12);
FontRenderContextgetDefaultFontRenderContext()
Gets the FontRenderContext for the default screen-device.
if (frc == null)
    createFontRenderContext();
return frc;