How to list the avaiable fonts in Java

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++ ){

CSS Web Safe Font Combinations

CSS Web Safe Font Combinations

Serif Fonts

  • Georgia, serif
  • “Palatino Linotype”, “Book Antiqua”, Palatino, serif
  • “Times New Roman”, Times, serif
  • Sans-Serif Fonts

  • Arial, Helvetica, sans-serif
  • “Arial Black”, Gadget, sans-serif
  • “Comic Sans MS”, cursive, sans-serif
  • Impact, Charcoal, sans-serif
  • “Lucida Sans Unicode”, “Lucida Grande”, sans-serif
  • Tahoma, Geneva, sans-serif
  • “Trebuchet MS”, Helvetica, sans-serif
  • Verdana, Geneva, sans-serif
  • Monospace Fonts

  • “Courier New”, Courier, monospace
  • “Lucida Console”, Monaco, monospace
  • source: W3Schools