在Netbeans8.0上开发php,设置字体为Consola后,发现中文显示是乱码的,经过修改jre的配置文件成功解决了这个问题。
1. 进入jdk安装目录下/jre/lib文件夹,找到fontconfig.properties.src,拷贝为fontconfig.properties,修改此文件。
找到:
sequence.monospaced.GBK=chinese-ms936,alphabetic,dingbats,symbol,chinese-ms936-extb
monospaced.plain.alphabetic=Courier New
monospaced.bold.alphabetic=Courier New Bold
monospaced.bolditalic.alphabetic=Courier New Italic
monospaced.bolditalic.alphabetic=Courier New Bold Italic修改为:
sequence.monospaced.GBK=alphabetic,chinese-ms936,dingbats,symbol,chinese-ms936-extbmonospaced.plain.alphabetic=Consolas
monospaced.bold.alphabetic=Consolas Bold
monospaced.bolditalic.alphabetic=Consolas Italic
monospaced.bolditalic.alphabetic=Consolas Bold Italic在文件末尾添加Consola字体定义:
filename.Consolas=CONSOLA.TTF
filename.Consolas_Bold=CONSOLAB.TTF
filename.Consolas_Italic=CONSOLAI.TTF
filename.Consolas_Bold_Italic=CONSOLAZ.TTF2. 在Netbeans中进行配置
Netbeans->工具->选项->字体和颜色 字体设置为Monospaced。
设置成功。其他字体的设置将Consola设为其他字体即可。
参考文章: http://solid210.iteye.com/blog/1621685
本文介绍如何在Netbeans 8.0环境下使用Consolas字体进行PHP开发时解决中文显示乱码的问题。通过修改JDK jre/lib/fontconfig.properties文件及在Netbeans中设置Monospaced字体来实现。
2171

被折叠的 条评论
为什么被折叠?



