82855 AI Apple Watch CentOS Eclipse H700 iCal iOS iPad iPhone iphone4 iTunes Java Javascript linux Mac MBP ML MySQL Oracle OS X Parallels Desktop RAID redmine Rocky Linux Snow Leopard SQL SVN Thinkpad VMware VR Windows Windows 7 Windows 11 Word X40 东航 压缩算法 字体 导航 数据库 朗逸 签证 达美 闹钟

列出 Java 环境可用的所有字体名称


import java.awt.GraphicsEnvironment;

public class ListJavaFonts
{

  public static void main(String[] args)
  {
    String fonts[] = 
      GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();

    for ( int i = 0; i < fonts.length; i++ )
    {
      System.out.println(fonts[i]);
    }
  }

}
,