To list the avaiable fonts in Java you can use the following snippet.

Sample Java

GraphicsEnvironment g = GraphicsEnvironment.getLocalGraphicsEnvironment();
String fonts[] = g.getAvailableFontFamilyNames();
for (int Counter = 0; Counter < fonts.length;Counter++ ){
	System.out.println(fonts[Counter]);
}

One thought on “How to list the avaiable fonts in Java”

Leave a Reply