GraphicsEnvironment: getAllFonts() : GraphicsEnvironment « java.awt « Java by API






GraphicsEnvironment: getAllFonts()

import java.awt.Font;
import java.awt.GraphicsEnvironment;

public class MainClass {

  public static void main(String[] args) throws Exception {
    Font[] fonts  = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
    for (int i = 0; i < fonts.length; i++) {
      System.out.print(fonts[i].getFontName() + " : ");
      System.out.print(fonts[i].getFamily() + " : ");
      System.out.print(fonts[i].getName());
      System.out.println();
    }
  }
}
           
       








Related examples in the same category

1.GraphicsEnvironment: getAvailableFontFamilyNames()
2.GraphicsEnvironment: getCenterPoint()
3.GraphicsEnvironment: getDefaultScreenDevice()
4.GraphicsEnvironment: getLocalGraphicsEnvironment()
5.GraphicsEnvironment: getScreenDevices()