Difference between revisions of "Chinese Japanese and Korean"

From Wiki
Jump to navigation Jump to search
Line 44: Line 44:
In China, numbers must be written in both Chinese upper case and Arabic form together in accounting.
In China, numbers must be written in both Chinese upper case and Arabic form together in accounting.
=Chinese in ConTeXt (before 2005.12.19)=
[[User:Xiaojf|Xiao Jianfeng]] wrote in a [http://archive.contextgarden.net/message/20050606.080842.5e1c2057.en.html 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.
# Get the truetype fonts <tt>[ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/htfs.ttf htfs.ttf], [ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/hthei.ttf hthei.ttf], [ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/htkai.ttf htkai.ttf]</tt> and <tt>[ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/htsong.ttf htsong.ttf]</tt> from ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/
# Get corresponding tfm files <tt>[ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/gbfs.zip gbfs.zip], [ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/gbhei.zip gbhei.zip], [ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/gbkai.zip gbkai.zip]</tt> and <tt>[ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/gbsong.zip gbsong.zip]</tt> from ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/
# Get the enc file <tt>[ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map/Gbk.zip Gbk.zip]</tt> from ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map/
# Get the map file <tt>[ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map/map.zip map.zip]</tt> from ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map/
# Put the ttf font files you got in step 1 to <tt>texmf-fonts/fonts/truetype/chinese</tt>
# Unzip the files you got in step 2 and you get four corresponding directories (which contain tfm files), then put them  in <tt>texmf-fonts/fonts/tfm/chinese</tt>
# Unzip <tt>Gbk.zip</tt>, you will get a directory named <tt>Gbk</tt> which contains many enc files. Put the directory to <tt>texmf-fonts/fonts/enc/chinese</tt>
# Unzip <tt>map.zip</tt>, you will get many map files, you need just the <tt>gbk.map</tt>. You need to edit <tt>gbk.map</tt>, delete entries of gbli* at the end of the file (lines 505-629). Then, put the modified <tt>gbk.map</tt> to <tt>texmf-fonts/fonts/map/chinese</tt>. Note that newer pdfetex don't read [[pdftex.cfg]] so better use <cmd>loadmapfile[gbk]</cmd> in your document.
# Your document should be compilable now. See sample below.
# 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):
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]. Note, however, that you may only use characters representable in gbk, German umlauts for instance are converted into ??.

Revision as of 13:54, 14 December 2010

< Fonts | Encodings and Regimes >

Chinese in ConTeXt (ConTeXt 2005.12.19 and newer)

If you have Context 2005.12.19, you only have to get the fonts.

  1. You need some Chinese (TrueType) fonts; you may want to get FangSong, HeiTi, KaiTi and SongTi. Put those e.g. into $TEXMF/fonts/truetype/chinese/.
  2. Use Hans Hagen's experimental ttf2uni.rb script to create .map, .tfm and .enc files. You can then put the files e.g. to $TEXMF/fonts/tfm/chinese/ (*.tfm files), $TEXMF/fonts/enc/chinese/ (*.enc files, they are basically the same for all fonts) and to $TEXMF/fonts/map/chinese/.
  3. You may now need to update the hash TeX uses to find the files; using teTeX this is done by running texhash.
  4. How you can run your Hello World program:

If you only want to access a few Chinese characters, you should use \input font-chi.tex instead of \usemodule[chinese] as the latter changes also the default language and some of the numberation/section settings (see s-chi-00.tex).

If you want to typset vertical text, use \startvertical ... \stopvertical, if you want to use Chinese numbers, you can use e.g. \startitemize[c]; possible options are c or cn for normal Chinese numbers (一, 二, 三, 四, 五, 六 etc.), cc for the capitalized (or financial) Chinese numbers (壹, 贰, 叁 etc.), ec for an extended version which uses 廿 and 卅 (instead of 二十 and 三十), and ac for using the Chinese numbers zero (零, 〇) to nine (九) in the same way one does with the Arabic digits 0 to 9.

//added by Xiao Jianfeng

As far as I know, it is wrong to use "零" with "一,二,....,十". Following is the corresponding relationships between lower case and upper case Chinese numbers and arabic numbers.

Chinese lower:〇,一,二,三,四,五,六,七,八,九,十,百,千

Chinese upper:零,壹,贰,叁,肆,伍,陆,柒,捌,玖,拾,佰,仟

Arabic :0, 1, 2,3, 4,5, 6, 7,8, 9,10,100,1000

"零" is a upper case Chinese number, so it should not be mixed with other lower case Chinese numbers. Although in China, it is sometimes wrongly used.

The reason why numbers in Chinese has lower case and upper case in Chinese is for accounting safety. Lower case numbers are simple to write and far more often used in daily life, while upper case numbers are almost exclusively used in accouting.

We can see that every upper case Chinese number are very different from the others, hence cannot be easily modified to the other . But the lower case Chinese number or Arabic numbers are sometime easily to be modified. For example, "一", "二" and "三" are similar so one can easily modify a "一" to "二" or "三".And one can also modify "1" to "7" or "11", or one can modify "6" to "8".

In China, numbers must be written in both Chinese upper case and Arabic form together in accounting.