netbeans是php非常好用的ide,並且還是免費的!但是好多字體不支持中文,會顯示如下亂碼:
解決方法如下:
通過修改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-extb
monospaced.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.TTF
2. 在Netbeans中進行配置
Netbeans->工具->選項->字體和顏色 字體設置為 Monospaced 。
設置成功。其他字體的設置將Consola設為其他字體即可。效果如下: