How do you enable anti aliasing in arbitrary Java apps?

后端 未结 4 1175
暗喜
暗喜 2020-11-27 11:32

Many Java Apps don\'t use anti-aliased fonts by default, despite the capability of Swing to provide them. How can you coerce an arbitrary java application to use AA fonts?

4条回答
  •  执笔经年
    2020-11-27 11:46

    If you have access to the source, you can do this in the main method:

      // enable anti-aliased text:
      System.setProperty("awt.useSystemAAFontSettings","on");
    

    or, (and if you do not have access to the source, or if this is easier) you can simply pass the system properties above into the jvm by adding these options to the command line:

    -Dawt.useSystemAAFontSettings=on
    

提交回复
热议问题