Jun 27, 2009

Use Consolas font in Japanese VIM

Consolas is a font which is specialized to display source codes.
To use the font in Japanese VIM, add the following line in .vimrc

set guifont=Consolas:h11:cSHIFTJIS


Then import the following into your registry and reboot.


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink]
"Consolas"=hex(7):4d,00,49,00,4e,00,47,00,4c,00,49,00,55,00,2e,00,54,00,54,00,\
43,00,2c,00,4d,00,69,00,6e,00,67,00,4c,00,69,00,55,00,00,00,53,00,49,00,4d,\
00,53,00,55,00,4e,00,2e,00,54,00,54,00,43,00,2c,00,53,00,69,00,6d,00,53,00,\
75,00,6e,00,00,00,42,00,41,00,54,00,41,00,4e,00,47,00,2e,00,54,00,54,00,43,\
00,2c,00,42,00,61,00,74,00,61,00,6e,00,67,00,00,00,00,00


Since Consolas supports English only. It's necessary to tell system how to display the words in other Languages or all Japanese words cannot be display normally.
The above registry setting assign
"MINGLIU.TTC,MingLiU
SIMSUN.TTC,SimSun
BATANG.TTC,Batang" to Consolas font to display both Japanese and Chinese words.

The result is here:



To get into the nutshell, see how font linking works

0 comments:

 
TEMPLATE HACKS AND TWEAKS BY [ METAMUSE ] BLACKCAT 1.1
/scripts/shBrushJScript.js'/>