NetBean6字體配置

              安裝netbean6.1m多國語言版、squirrel-sql-2.4.1等開發工具、默認字體都是Monospace 12;但是編碼時英文字體以宋體顯示、顯示極為難看,google上蕩了N多方法,建議多是修改netbean、squirrel-sql-2.4.1字體為Courier New;
              默認情況下,Java應用程序中的中文字體和英文字體是分開使用的,這樣導致不能同時使用某個英文字體和某個中文字體來顯示同個程序中包含中文和英文的文字。例如,在Netbeans中不能使用Courser 10 Pitch字體(Windows下為Courser New)和某個中文字體(比如宋體或微軟雅黑)來顯示一個java源代碼,如果選擇Courser字體,那么源代碼中的中文就無法顯示,如果選擇宋體或雅黑,那么英文字體則是采用默認映射的某個字體。
              忍耐了倆個多月,周末有系統研究了一邊 ,發現網上說好多java目錄中jre1.5.0_07\lib\fontconfig.properties.src解決,本人嘗試N次,但一直無效,最后在閱讀netbean啟動加載配置時發現了這個一直導致無效的問題:
          NetBeans 6.1\etc\netbeans.conf

          # Default location of JDK, can be overridden by using --jdkhome <dir>:
          netbeans_jdkhome
          ="C:\Program Files\Java\jdk1.5.0_07"

          netbean使用的并不是C:\Program Files\Java\jre1.5.0_07\lib,而是C:\Program Files\Java\jdk1.5.0_07\jre,我們找到了地方,然后修改加載順序,對于英文,monospaced默認就是映射為Courier New字體,但為什么在Java程序里(比如Netbeans)確不能顯示呢?將\fontconfig.properties.src內容復制到fontconfig.properties,然后找到sequence.monospaced.GBK=sequence.monospaced.GBK=chinese-ms936,alphabetic,dingbats,symbol,可以看出對于中文字體的搜索順序是先搜chinese-ms936,而chinese-ms936是用allfonts的雅黑來顯示英文,所以不好看,因此你只要簡單將 chinese-ms936和alphabetic這兩個交換一下變成:sequence.monospaced.GBK=alphabetic,chinese-ms936,dingbats,symbol保存后重新啟動netbean,squirrel-sql-2.4.1等java桌面應用,ok,一切都搞定了;如果原來修改了netbean的字體設置,麻煩你恢復為默認配置,這樣再次打開java開發的軟件,ok,是不是漂亮了^_^

          下面是我修改后的文件:
          # @(#)fontconfig.properties    1.5 04/01/28
          #
          # Copyright 
          2003 Sun Microsystems, Inc. All rights reserved.
          #

          # Version

          version
          =1

          # Component Font Mappings

          allfonts.chinese-ms936
          =SimSun
          allfonts.chinese-gb18030
          =SimSun-18030
          allfonts.chinese-hkscs
          =MingLiU_HKSCS
          allfonts.devanagari
          =Mangal
          allfonts.dingbats
          =Wingdings
          allfonts.lucida
          =Lucida Sans Regular
          allfonts.symbol
          =Symbol
          allfonts.thai
          =Lucida Sans Regular

          serif.plain.alphabetic
          =Times New Roman
          serif.plain.chinese-ms950
          =MingLiU
          serif.plain.hebrew
          =David
          serif.plain.japanese
          =MS Mincho
          serif.plain.korean
          =Batang

          serif.bold.alphabetic
          =Times New Roman Bold
          serif.bold.chinese-ms950
          =PMingLiU
          serif.bold.hebrew
          =David Bold
          serif.bold.japanese
          =MS Mincho
          serif.bold.korean
          =Batang

          serif.italic.alphabetic
          =Times New Roman Italic
          serif.italic.chinese-ms950
          =PMingLiU
          serif.italic.hebrew
          =David
          serif.italic.japanese
          =MS Mincho
          serif.italic.korean
          =Batang

          serif.bolditalic.alphabetic
          =Times New Roman Bold Italic
          serif.bolditalic.chinese-ms950
          =PMingLiU
          serif.bolditalic.hebrew
          =David Bold
          serif.bolditalic.japanese
          =MS Mincho
          serif.bolditalic.korean
          =Batang

          sansserif.plain.alphabetic
          =Arial
          sansserif.plain.chinese-ms950
          =MingLiU
          sansserif.plain.hebrew
          =David
          sansserif.plain.japanese
          =MS Gothic
          sansserif.plain.korean
          =Gulim

          sansserif.bold.alphabetic
          =Arial Bold
          sansserif.bold.chinese-ms950
          =PMingLiU
          sansserif.bold.hebrew
          =David Bold
          sansserif.bold.japanese
          =MS Gothic
          sansserif.bold.korean
          =Gulim

          sansserif.italic.alphabetic
          =Arial Italic
          sansserif.italic.chinese-ms950
          =PMingLiU
          sansserif.italic.hebrew
          =David
          sansserif.italic.japanese
          =MS Gothic
          sansserif.italic.korean
          =Gulim

          sansserif.bolditalic.alphabetic
          =Arial Bold Italic
          sansserif.bolditalic.chinese-ms950
          =PMingLiU
          sansserif.bolditalic.hebrew
          =David Bold
          sansserif.bolditalic.japanese
          =MS Gothic
          sansserif.bolditalic.korean
          =Gulim

          monospaced.plain.alphabetic
          =Courier New
          monospaced.plain.chinese-ms950
          =MingLiU
          monospaced.plain.hebrew
          =David
          monospaced.plain.japanese
          =MS Gothic
          monospaced.plain.korean
          =GulimChe

          monospaced.bold.alphabetic
          =Courier New Bold
          monospaced.bold.chinese-ms950
          =PMingLiU
          monospaced.bold.hebrew
          =David Bold
          monospaced.bold.japanese
          =MS Gothic
          monospaced.bold.korean
          =GulimChe

          monospaced.italic.alphabetic
          =Courier New Italic
          monospaced.italic.chinese-ms950
          =PMingLiU
          monospaced.italic.hebrew
          =David
          monospaced.italic.japanese
          =MS Gothic
          monospaced.italic.korean
          =GulimChe

          monospaced.bolditalic.alphabetic
          =Courier New Bold Italic
          monospaced.bolditalic.chinese-ms950
          =PMingLiU
          monospaced.bolditalic.hebrew
          =David Bold
          monospaced.bolditalic.japanese
          =MS Gothic
          monospaced.bolditalic.korean
          =GulimChe

          dialog.plain.alphabetic
          =Arial
          dialog.plain.chinese-ms950
          =MingLiU
          dialog.plain.hebrew
          =David
          dialog.plain.japanese
          =MS Gothic
          dialog.plain.korean
          =Gulim

          dialog.bold.alphabetic
          =Arial Bold
          dialog.bold.chinese-ms950
          =PMingLiU
          dialog.bold.hebrew
          =David Bold
          dialog.bold.japanese
          =MS Gothic
          dialog.bold.korean
          =Gulim

          dialog.italic.alphabetic
          =Arial Italic
          dialog.italic.chinese-ms950
          =PMingLiU
          dialog.italic.hebrew
          =David
          dialog.italic.japanese
          =MS Gothic
          dialog.italic.korean
          =Gulim

          dialog.bolditalic.alphabetic
          =Arial Bold Italic
          dialog.bolditalic.chinese-ms950
          =PMingLiU
          dialog.bolditalic.hebrew
          =David Bold
          dialog.bolditalic.japanese
          =MS Gothic
          dialog.bolditalic.korean
          =Gulim

          dialoginput.plain.alphabetic
          =Courier New
          dialoginput.plain.chinese-ms950
          =MingLiU
          dialoginput.plain.hebrew
          =David
          dialoginput.plain.japanese
          =MS Gothic
          dialoginput.plain.korean
          =Gulim

          dialoginput.bold.alphabetic
          =Courier New Bold
          dialoginput.bold.chinese-ms950
          =PMingLiU
          dialoginput.bold.hebrew
          =David Bold
          dialoginput.bold.japanese
          =MS Gothic
          dialoginput.bold.korean
          =Gulim

          dialoginput.italic.alphabetic
          =Courier New Italic
          dialoginput.italic.chinese-ms950
          =PMingLiU
          dialoginput.italic.hebrew
          =David
          dialoginput.italic.japanese
          =MS Gothic
          dialoginput.italic.korean
          =Gulim

          dialoginput.bolditalic.alphabetic
          =Courier New Bold Italic
          dialoginput.bolditalic.chinese-ms950
          =PMingLiU
          dialoginput.bolditalic.hebrew
          =David Bold
          dialoginput.bolditalic.japanese
          =MS Gothic
          dialoginput.bolditalic.korean
          =Gulim

          # Search Sequences

          sequence.allfonts
          =alphabetic/default,dingbats,symbol

          sequence.serif.GBK
          =alphabetic,chinese-ms936,dingbats,symbol
          sequence.sansserif.GBK
          =alphabetic,chinese-ms936,dingbats,symbol
          sequence.monospaced.GBK
          =alphabetic,chinese-ms936,dingbats,symbol
          sequence.dialog.GBK
          =alphabetic,chinese-ms936,dingbats,symbol
          sequence.dialoginput.GBK
          =alphabetic,chinese-ms936,dingbats,symbol

          sequence.serif.GB18030
          =alphabetic,chinese-gb18030,dingbats,symbol
          sequence.sansserif.GB18030
          =alphabetic,chinese-gb18030,dingbats,symbol
          sequence.monospaced.GB18030
          =alphabetic,chinese-gb18030,dingbats,symbol
          sequence.dialog.GB18030
          =alphabetic,chinese-gb18030,dingbats,symbol
          sequence.dialoginput.GB18030
          =alphabetic,chinese-gb18030,dingbats,symbol

          sequence.serif.x-windows-
          950=alphabetic,chinese-ms950,dingbats,symbol
          sequence.sansserif.x-windows-
          950=alphabetic,chinese-ms950,dingbats,symbol
          sequence.monospaced.x-windows-
          950=chinese-ms950,alphabetic,dingbats,symbol
          sequence.dialog.x-windows-
          950=alphabetic,chinese-ms950,dingbats,symbol
          sequence.dialoginput.x-windows-
          950=alphabetic,chinese-ms950,dingbats,symbol

          sequence.serif.x-MS950-HKSCS
          =alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol
          sequence.sansserif.x-MS950-HKSCS
          =alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol
          sequence.monospaced.x-MS950-HKSCS
          =chinese-ms950,alphabetic,chinese-hkscs,dingbats,symbol
          sequence.dialog.x-MS950-HKSCS
          =alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol
          sequence.dialoginput.x-MS950-HKSCS
          =alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol

          sequence.allfonts.UTF-
          8.hi=alphabetic/1252,devanagari,dingbats,symbol

          sequence.allfonts.windows-
          1255=hebrew,alphabetic/1252,dingbats,symbol

          sequence.serif.windows-31j
          =alphabetic,japanese,dingbats,symbol
          sequence.sansserif.windows-31j
          =alphabetic,japanese,dingbats,symbol
          sequence.monospaced.windows-31j
          =japanese,alphabetic,dingbats,symbol
          sequence.dialog.windows-31j
          =alphabetic,japanese,dingbats,symbol
          sequence.dialoginput.windows-31j
          =alphabetic,japanese,dingbats,symbol

          sequence.serif.x-windows-
          949=alphabetic,korean,dingbats,symbol
          sequence.sansserif.x-windows-
          949=alphabetic,korean,dingbats,symbol
          sequence.monospaced.x-windows-
          949=korean,alphabetic,dingbats,symbol
          sequence.dialog.x-windows-
          949=alphabetic,korean,dingbats,symbol
          sequence.dialoginput.x-windows-
          949=alphabetic,korean,dingbats,symbol

          sequence.allfonts.x-windows-
          874=alphabetic,thai,dingbats,symbol

          sequence.fallback
          =lucida,\
                            chinese-ms950
          ,chinese-hkscs,chinese-ms936,chinese-gb18030,\
                            japanese
          ,korean

          # Exclusion Ranges

          exclusion.alphabetic
          =0700-1e9f,1f00-20ab,20ad-f8ff
          exclusion.chinese-gb18030
          =0390-03d6,2200-22ef,2701-27be
          exclusion.hebrew
          =0041-005a,0060-007a,007f-00ff,20ac-20ac

          # Monospaced to Proportional width variant mapping
          # (Experimental private syntax)
          proportional.MS_Gothic
          =MS PGothic
          proportional.MS_Mincho
          =MS PMincho
          proportional.MingLiU
          =PMingLiU

          # Font File Names

          filename.Arial
          =ARIAL.TTF
          filename.Arial_Bold
          =ARIALBD.TTF
          filename.Arial_Italic
          =ARIALI.TTF
          filename.Arial_Bold_Italic
          =ARIALBI.TTF

          filename.Courier_New
          =COUR.TTF
          filename.Courier_New_Bold
          =COURBD.TTF
          filename.Courier_New_Italic
          =COURI.TTF
          filename.Courier_New_Bold_Italic
          =COURBI.TTF

          filename.Times_New_Roman
          =TIMES.TTF
          filename.Times_New_Roman_Bold
          =TIMESBD.TTF
          filename.Times_New_Roman_Italic
          =TIMESI.TTF
          filename.Times_New_Roman_Bold_Italic
          =TIMESBI.TTF

          filename.SimSun
          =SIMSUN.TTC
          filename.SimSun-
          18030=SIMSUN18030.TTC

          filename.MingLiU
          =MINGLIU.TTC
          filename.PMingLiU
          =MINGLIU.TTC
          filename.MingLiU_HKSCS
          =hkscsm3u.ttf

          filename.David
          =DAVID.TTF
          filename.David_Bold
          =DAVIDBD.TTF

          filename.MS_Mincho
          =MSMINCHO.TTC
          filename.MS_PMincho
          =MSMINCHO.TTC
          filename.MS_Gothic
          =MSGOTHIC.TTC
          filename.MS_PGothic
          =MSGOTHIC.TTC

          filename.Gulim
          =gulim.TTC
          filename.Batang
          =batang.TTC
          filename.GulimChe
          =gulim.TTC

          filename.Lucida_Sans_Regular
          =LucidaSansRegular.ttf
          filename.Mangal
          =MANGAL.TTF
          filename.Symbol
          =SYMBOL.TTF
          filename.Wingdings
          =WINGDING.TTF


          posted on 2008-09-07 13:46 空白 閱讀(2058) 評論(2)  編輯  收藏 所屬分類: Java

          評論

          # re: NetBean6字體配置[未登錄] 2008-11-01 02:32 AlleNny

          哈哈,按照你的方法,我也把問題解決啦,非常感謝!  回復  更多評論   

          # re: NetBean6字體配置 2009-02-03 22:35 satyrie

          我是用繁體中文,但是我將 sequence.monospaced.x-windows-950=chinese-ms950,alphabetic,dingbats,symbol
          修改成 sequence.monospaced.x-windows-950=alphabetic,chinese-ms950,dingbats,symbol
          並沒有生效,why?  回復  更多評論   

          <2008年9月>
          31123456
          78910111213
          14151617181920
          21222324252627
          2829301234
          567891011

          導航

          統計

          常用鏈接

          留言簿(1)

          隨筆分類(15)

          積分與排名

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 景东| 济宁市| 遂平县| 新郑市| 越西县| 如东县| 阿荣旗| 壶关县| 且末县| 电白县| 舞钢市| 大安市| 丰台区| 自治县| 平和县| 台东市| 个旧市| 平阳县| 五华县| 尚义县| 杭州市| 花垣县| 江口县| 呼玛县| 江北区| 吴堡县| 普陀区| 长宁区| 威海市| 北流市| 龙州县| 屏山县| 资源县| 会理县| 常宁市| 云和县| 准格尔旗| 侯马市| 务川| 新田县| 安达市|