Pycharm 中的字体 Consolas 以一种奇怪的方式呈现 [英] Font Consolas in Pycharm is being rendered in a weird way
问题描述
在字体管理器和 Pycharm 2.7.2 中 Consolas 10pt 下面的 图片在 Pycharm 中,它变得又小又粗有没有办法把它渲染成类似于 Windows 风格?
On the picture below Consolas 10pt in Font Manager and in Pycharm 2.7.2 In Pycharm it became small and bold-ish Is there a way to render it similar to Windows style?
推荐答案
OpenJDK 的字体渲染有问题.所以你只需要把 OpenJDK 换成 Sun JDK,字体就会正常了.
It's a problem with OpenJDK's font rendering. So all you need is to swap OpenJDK to Sun JDK and fonts will look normal.
这是你的做法:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
安装完成后,如果您想查看是否成功,可以运行以下命令:
After the installation finishes, if you wish to see if it was successful, you can run the following command:
java -version
它应该返回如下内容:
java version "1.7.0_10"
Java(TM) SE Runtime Environment (build 1.7.0_10-b18)
Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)
要自动设置 Java 7 环境变量,您可以安装以下软件包:
To automatically set up the Java 7 environment variables, you can install the following package:
sudo apt-get install oracle-java7-set-default
UPD
我忘记了主要的事情.在您的 .profile 中,输入:
I forgot the main thing. In your .profile, enter this:
export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=lcd_hrgb -Dswing.aatext=true -Dsun.java2d.xrender=true'
或者,如果您想为特定应用程序设置字体设置,在这种情况下,pycharm - 而不是修改 .profile,您可以编辑 pycharm/bin/pycharm64.vmoptions 文件并添加以下内容:
Alternatively, if you want to set font settings to specific applications, in this case, pycharm - instead of modifying .profile, you can edit pycharm/bin/pycharm64.vmoptions file and add this:
-Dawt.useSystemAAFontSettings=lcd_hrgb
-Dswing.aatext=true
-Dsun.java2d.xrender=true
这篇关于Pycharm 中的字体 Consolas 以一种奇怪的方式呈现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!