多语言展示
当前在线:1296今日阅读:19今日分享:20

netbeans设置Consolas字体乱码的解决办法

netbeans设置Consolas字体乱码的解决办法
工具/原料

安装好了netbeans8.1

方法/步骤
1

打开netbeans,点击工具 - 选项 - 字体和颜色,字体里选择Consolas字体,确定后会乱码。如图

2

在netbeans安装目录D:\NetBeans 8.1\bin\jre\lib下找到fontconfig.properties.src并复制为fontconfig.properties,用notepad++打开,192行找到sequence.monospaced.GBK=chinese-ms936, alphabetic,dingbats,symbol修改为sequence.monospaced.GBK=alphabetic,chinese-ms936,dingbats,symbol。如图

3

102行monospaced.plain.alphabetic=Courier New修改为monospaced.plain.alphabetic=Consolas。如图

4

109行monospaced.bold.alphabetic=Courier New Bold修改为monospaced.bold.alphabetic=Consolas Bold。如图

5

123行monospaced.bolditalic.alphabetic=Courier New Italic修改为monospaced.bolditalic.alphabetic=Consolas Italic。如图

6

179行monospaced.bolditalic.alphabetic=Courier New Bold Italic修改为monospaced.bolditalic.alphabetic=Consolas Bold Italic。如图

7

然后再在文件最后加入filename.Consolas=CONSOLA.TTFfilename.Consolas_Bold=CONSOLAB.TTFfilename.Consolas_Italic=CONSOLAI.TTFfilename.Consolas_Bold_Italic=CONSOLAZ.TTF

8

最后配置Netbeans打开Netbeans,选择工具-选项 字体颜色 - 字体这里注意选择字体时请一定要选择Monospaced,选择其他的字体是没有效果。选择完毕后再看代码页面,一切显示正常了。

注意事项

注意这里用的是Consolas字体,如果想用其他的字体请自行修改

推荐信息