Difference between revisions of "Chinese Japanese and Korean"

From Wiki
Jump to navigation Jump to search
(Add link to utf82gbk.pl script)
(Add link to CPAN for Lutz' script)
Line 31: Line 31:
 
</texcode>
 
</texcode>
  
If you want to use UTF-8, the [http://www.ntg.nl/pipermail/ntg-context/2005/013542.html script by Lutz Haseloff] might of interest to you.
+
If you want to use UTF-8, the [http://www.ntg.nl/pipermail/ntg-context/2005/013542.html script by Lutz Haseloff] might of interest to you; the needed perl module Encode::HanConvert is [http://search.cpan.org/dist/Encode-HanConvert/ available at CPAN]
 
 
 
[[Category:Fonts]]
 
[[Category:Fonts]]
 
[[Category:International]]
 
[[Category:International]]

Revision as of 10:26, 9 December 2005

< Fonts | Encodings and Regimes >


Xiao Jianfeng wrote in a mail to the mailing list on 2005-06-06:

Here is my way of Chinese setup in ConTeXt. I hope this can be of any help to some newbies like me who have problems in processing Chinese.

  1. Get the truetype fonts htfs.ttf, hthei.ttf, htkai.ttf and htsong.ttf from ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/
  2. Get corresponding tfm files gbfs.zip, gbhei.zip, gbkai.zip and gbsong.zip from ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/
  3. Get the enc file Gbk.zip from ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map/
  4. Get the map file map.zip from ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map/
  5. Put the ttf font files you got in step 1 to texmf-fonts/fonts/truetype/chinese
  6. Unzip the files you got in step 2 and you get four corresponding directories (which contain tfm files), then put them in texmf-fonts/fonts/tfm/chinese
  7. Unzip Gbk.zip, you will get a directory named Gbk which contains many enc files. Put the directory to texmf-fonts/fonts/enc/chinese
  8. Unzip map.zip, you will get many map files, you need just the gbk.map. You need to edit gbk.map, delete entries of gbli* at the end of the file (lines 505-629). Then, put the modified gbk.map to texmf-fonts/fonts/map/chinese. Note that newer pdfetex don't read pdftex.cfg so better use \loadmapfile[gbk] in your document.
  9. Your document should be compilable now. See sample below.
  10. I haven't tried to compile Traditional Chinese documents. Maybe just get corresponding files for Traditional Chinese and put there to the right location will work. I'm not sure.

Sample Code (save in cp936 encoding):

\loadmapfile[gbk]
\usemodule[chinese]
\setuppagenumbering[state=stop]
 \starttext
 \tfd
这里什么饮料也没有真不像话!
 \stoptext

If you want to use UTF-8, the script by Lutz Haseloff might of interest to you; the needed perl module Encode::HanConvert is available at CPAN