如何在任意Java应用程序中启用抗锯齿? [英] How do you enable anti aliasing in arbitrary Java apps?

查看:100
本文介绍了如何在任意Java应用程序中启用抗锯齿?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

许多Java应用程序默认情况下不使用消除锯齿字体,尽管Swing能够提供它们。你怎么能强制任意java应用程序使用AA字体? (对于我正在运行的应用程序和我正在开发的应用程序)

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? (both for applications I'm running, and applications I'm developing)

推荐答案

如果您有权访问源代码,那么可以在main方法中执行此操作:

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

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

或,(如果您无权访问来源,或者这更容易)可以通过将以下选项添加到命令行来简单地将上面的系统属性传递到jvm中:

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

这篇关于如何在任意Java应用程序中启用抗锯齿?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆