package org.kodejava.awt;
import java.awt.GraphicsEnvironment;
public class FontFamilyNameList {
public static void main(String[] args) {
// Get all available font family names from GraphicsEnvironment
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
String[] familyNames = ge.getAvailableFontFamilyNames();
// Iterates familyNames array to display the available font's family names
for (String familyName : familyNames) {
System.out.println("Family name: " + familyName);
}
}
}
Some font family names are shown below:
Family name: Agency FB
Family name: Algerian
Family name: Arial
Family name: Arial Black
Family name: Arial Narrow
Family name: Arial Rounded MT Bold
Family name: Bahnschrift
Family name: Baskerville Old Face
Family name: Bauhaus 93
Family name: Bell MT
...
Latest posts by Wayan (see all)
- How do I split large excel file into multiple smaller files? - April 15, 2023
- How do I get the number of processors available to the JVM? - March 29, 2023
- How do I show Spring transaction in log / console? - March 29, 2023