Skip to content

Instantly share code, notes, and snippets.

@alea12
Last active December 17, 2015 14:29
Show Gist options
  • Save alea12/5624919 to your computer and use it in GitHub Desktop.
Save alea12/5624919 to your computer and use it in GitHub Desktop.
List available fonts of the environment using Java
import java.awt.*;
public class AvailableFonts {
public static void main(String[] args) {
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
Font[] avfonts = ge.getAllFonts();
for (Font f : avfonts) {
System.out.println(f.getFontName());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment