List of utility methods to do Font from System
Font[] | availableFonts() available Fonts GraphicsEnvironment environment = GraphicsEnvironment.getLocalGraphicsEnvironment();
return environment.getAllFonts();
|
Set | getAllAvaiableSystemMonoSpacedFonts() 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; ... |
List | getAllAvailableFonts() get All Available Fonts return Arrays.asList(GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames());
|
Set | getAllFontNames() 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; |
Insets | getDefaultBorderInsets(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); |
Font | getDefaultFont() Get the default font if (dfltFont != null) { return dfltFont; return null; |
Font | getDefaultFont() get Default Font return defaultFont;
|
Font | getDefaultFont() Get the Default Font for the Module return new Font("SansSerif", Font.PLAIN, 10); |
Font | getDefaultFont() Returns a new instance of a default font. return new Font("Helvetica", Font.BOLD, 12); |
FontRenderContext | getDefaultFontRenderContext() Gets the FontRenderContext for the default screen-device. if (frc == null) createFontRenderContext(); return frc; |