Changes

Jump to navigation Jump to search
add Korean font setup (we should rename this page to CJK)
* manual by Pragma: [http://www.pragma-ade.com/general/manuals/mchinese.pdf Chinese in ConTeXt]
=Chinese in ConTeXt=
Get inspirated with importing Chinese fonts with this [[User:Xiaojf|Xiao Jianfeng]] wrote in a [httphttps://archivegithub.contextgarden.netcom/messageBruXy/20050606.080842.5e1c2057.en.html mail to the mailing list on 2005-06ConTeXt-06Chinese script]:.
Here is my way of # You need some Chinese setup in ConTeXt(TrueType) fonts; you may want to get for example Microsoft Truetype fonts:## [http://archive1. I hope this can be village.virginia.edu/spw4s/fonts/STSONG.TTF STSong],## [http://archive1.village.virginia.edu/spw4s/fonts/STZHONGS.TTF STZhongsong],## [http://archive1.village.virginia.edu/spw4s/fonts/STXIHEI.TTF STXihei],## [http://archive1.village.virginia.edu/spw4s/fonts/STKAITI.TTF STKaiti],## [http://archive1.village.virginia.edu/spw4s/fonts/STFANGSO.TTF STFangsong].# Example of any help to some newbies like me who have problems in processing basic document with enabled Chinese.:
# Get the truetype fonts <tttexcode>\mainlanguage[cn]\language[cn]\enableregime[ftp://ftp.ctex.org/pub/tex/utf]\setscript[hanzi] % hyphenation % Enable fonts/truetype/ttf/htfs.ttf htfs.ttf\usetypescriptfile[mscore]\setupbodyfont [mschinese,12pt]\usebodyfont [mschinese-light, 12pt]\definebodyfontenvironment[24pt]\definebodyfontenvironment[18pt] \setuppagenumber [numberconversion=cn]\definestructureconversionset[ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/hthei.ttf hthei.ttfchinese][numbers], [ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/htkai.ttf htkai.ttfcn]</tt> and <tt>\setupheads [ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/htsong.ttf htsong.ttfsectionconversionset=chinese]</tt> from ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/ \define[2]\ChineseChapter{第# Get corresponding tfm files <tt>1章 #2}\setuphead[ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/gbfs.zip gbfs.zipchapter][command=\ChineseChapter, style={\bf\switchtobodyfont[ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/gbhei.zip gbhei.zip24pt]}]\setuphead[section][style={\bf\switchtobodyfont[18pt]}]  \setuppagenumbering[state=start, alternative=singlesided, location={footer, center}, style={\bf\switchtobodyfont[ftp11pt]}] \starttext\chapter{华文字体系列} 在微软提供的 Office 套装中附带了一定数量的中文字体,这些字体是常州华文印刷新技术有限公司制造的。 \startitemize\item \type{\it}: {\it 华文仿宋}\item \type{\rm}: {\rm 华文仿宋}\item \type{\bf}: {\bf 华文中宋}\item \type{\ss}: {\ss 华文细黑}\item \type{\tfxx}: {\tfxx 华文仿宋}\item \type{\tfx}: {\tfx 华文仿宋}\item \type{\tf}: {\tf 华文仿宋}\item \type{\tfa}: {\tfa 华文仿宋}\item \type{\tfb}://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/gbkai.zip gbkai.zip]{\tfb 华文仿宋}\item \type{\tfc}: {\tfc 华文仿宋}\item \type{\tfd}: {\tfd 华文仿宋}\stopitemize\stoptext</tttexcode> and <tt>[ftp://ftp == Chinese numbers == Added by Xiao Jianfeng As far as I know, it is wrong to use "零" with "一,二,.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 Following is the enc file <tt>[ftp://ftpcorresponding relationships between lower case and upper case Chinese numbers and arabic numbers.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map/Gbk.zip Gbk.zip]</tt> from ftp Chinese lower://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map/〇,一,二,三,四,五,六,七,八,九,十,百,千 # Get the map file <tt>[ftpChinese upper://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map/map.zip map.zip]</tt> from ftp零,壹,贰,叁,肆,伍,陆,柒,捌,玖,拾,佰,仟 Arabic ://ftp0, 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.ctexAlthough in China, it is sometimes wrongly used.org/pub/tex/fonts/truetype/for_pdftex/enc_map/# Put the ttf font files you got The reason why numbers in Chinese has lower case and upper case in step 1 Chinese is for accounting safety. Lower case numbers are simple to <tt>texmf-fonts/fonts/truetype/chinese</tt># Unzip the files you got write and far more often used in step 2 and you get four corresponding directories (which contain tfm files)daily life, then put them while upper case numbers are almost exclusively used in <tt>texmf-fonts/fonts/tfm/chinese</tt>accouting.  # Unzip <tt>Gbk.zip</tt>We can see that every upper case Chinese number are very different from the others, you will get a directory named <tt>Gbk</tt> which contains many enc fileshence cannot be easily modified to the other . Put But the directory lower case Chinese number or Arabic numbers are sometime easily to <tt>texmf-fonts/fonts/enc/chinese</tt># Unzip <tt>mapbe modified.zip</tt>For example, you will get many map files"一", you need just the <tt>gbk"二" and "三" are similar so one can easily modify a "一" to "二" or "三".map</tt>. You need And one can also modify "1" to "7" or "11", or one can modify "6" to edit <tt>gbk"8".map</tt> In China, delete entries of gbli* at the end of the file numbers must be written in both Chinese upper case and Arabic form together in accounting. =Font setup for Korean= Example by Wolfgang (lines 5052017-62912-06). 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 You need fonts which contain hangul characters (don’t forget to compile Traditional Chinese documents. Maybe just get corresponding files set a math font because it is used for Traditional Chinese the symbols in enumerations) and put there you have to enable linebreaking for korean with the right location will work. I'm not sure{{cmd|setscript}} command.
Sample Code (save in cp936 encoding):
<texcode>
\loadmapfiledefinefallbackfamily [gbkmainface] [rm] [Nanum Myeongjo] [preset=range:korean]\usemoduledefinefontfamily [mainface] [rm] [DejaVu Serif] \definefallbackfamily [mainface] [ss] [Nanum Gothic] [preset=range:korean]\definefontfamily [mainface] [ss] [DejaVu Sans] \definefallbackfamily [mainface] [tt] [Nanum Gothic Coding] [chinesefeatures=none,preset=range:korean]\setuppagenumberingdefinefontfamily [mainface] [statett] [DejaVu Sans Mono] [features=stopnone] \definefontfamily [mainface] [mm] [DejaVu Math] \setupbodyfont[mainface] \setscript[hangul] \starttext 이 FAQ 은 자주 반복되는 질문과 그에 대한 대답을 간단명료한 양식으로모아 엮어졌습니다. {\ss 이 FAQ 은 자주 반복되는 질문과 그에 대한 대답을 간단명료한 양식으로모아 엮어졌습니다.} \starttyping이 FAQ 은 자주 반복되는 질문과 그에 대한 대답을 간단명료한 양식으로모아 엮어졌습니다.\tfdstoptyping这里什么饮料也没有真不像话! \stoptext
</texcode>
If you want to use UTF-8, the == See also ==* [http://www.ntg.nl/pipermail/ntg-context/2005/013542.html script by Lutz Haseloff[CJK fonts]] might of interest to you.
[[Category:Fonts]]
[[Category:International]]

Navigation menu