Changes

Jump to navigation Jump to search
m
fix pragma links & typos
< * old introduction [[FontsUptodate]] | by Pragma: [http://www.pragma-ade.nl/general/uptodate/up-007-s.pdf screen] and [http://www.pragma-ade.nl/general/uptodate/up-007-p.pdf paper] version* manual by Pragma: [[Encodings and Regimesmanual:mchinese.pdf|Chinese in ConTeXt]] >(Old 2001)
* old introduction [[Uptodate]] by Pragma: [http://www.pragma-ade.com/general/uptodate/up-007-s.pdf screen] and [http://www.pragma-ade.com/general/uptodate/up-007-p.pdf paper] version* manual by Pragma: [http://www.pragma-ade.com/general/manuals/mchinese.pdf =Chinese in ConTeXt]=
Get inspirated with importing Chinese fonts with this [https://github.com/BruXy/ConTeXt-Chinese script].
Xiao Jianfeng wrote in a mail # You need some Chinese (TrueType) fonts; you may want to the mailing list on 2005-06-06get for example Microsoft Truetype fonts:## [http://archive1.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 some basic document with enabled Chinese:
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.<texcode>\mainlanguage[cn]\language[cn]\enableregime[utf]\setscript[hanzi] % hyphenation
# Get the truetype % Enable fonts <tt>htfs.ttf\usetypescriptfile[mscore]\setupbodyfont [mschinese, hthei.ttf12pt]\usebodyfont [mschinese-light, htkai.ttf</tt> and <tt>htsong.ttf</tt> from ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/12pt]\definebodyfontenvironment[24pt]\definebodyfontenvironment[18pt] \setuppagenumber [numberconversion=cn]\definestructureconversionset[chinese][numbers][cn]\setupheads [sectionconversionset=chinese] \define[2]\ChineseChapter{第#1章 # Get corresponding tfm files <tt>gbfs.zip2}\setuphead[chapter][command=\ChineseChapter,style={\bf\switchtobodyfont[24pt]}]\setuphead[section][style={\bf\switchtobodyfont[18pt]}]  \setuppagenumbering[state=start, alternative=singlesided, location={footer, center}, gbhei.zip style={\bf\switchtobodyfont[11pt]}] \starttext\chapter{华文字体系列} 在微软提供的 Office 套装中附带了一定数量的中文字体, gbkai.zip</tt> and <tt>gbsong.zip</tt> from ftp这些字体是常州华文印刷新技术有限公司制造的。 \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/{\tfb 华文仿宋}# Get the enc file <tt>Gbk.zip</tt> from ftp\item \type{\tfc}://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map/{\tfc 华文仿宋}# Get the map file <tt>map.zip</tt> from ftp\item \type{\tfd}://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map/{\tfd 华文仿宋}\stopitemize\stoptext# Put the ttf font files you got in step 1 to <tt>texmf-fonts/fonts/truetype/chinese</tttexcode># Unzip the files you got in step 2 and you get four corresponding directories =Font setup for Korean= Example by Wolfgang (2017-12-06): You need fonts which contain tfm fileshangul characters (don’t forget to set a math font because it is used for the symbols in enumerations), then put them in <tt>texmf-fonts/fonts/tfm/chinese</tt># Unzip <tt>Gbk.zip</tt>, and you will get a directory named <tt>Gbk</tt> which contains many enc fileshave to enable linebreaking for Korean with the {{cmd|setscript}} command. Put the directory to  <tt>texmf-fonts/fonts/enc/chinese</tttexcode># Unzip <\definefallbackfamily [mainface] [rm] [Nanum Myeongjo] [preset=range:korean]\definefontfamily [mainface] [rm] [DejaVu Serif] \definefallbackfamily [mainface] [ss] [Nanum Gothic] [preset=range:korean]\definefontfamily [mainface] [ss] [DejaVu Sans] \definefallbackfamily [mainface] [tt>map.zip</tt>] [Nanum Gothic Coding] [features=none, you will get many map files, you need just the <preset=range:korean]\definefontfamily [mainface] [tt>gbk] [DejaVu Sans Mono] [features=none] \definefontfamily [mainface] [mm] [DejaVu Math] \setupbodyfont[mainface] \setscript[hangul] \starttext 이 FAQ 은 자주 반복되는 질문과 그에 대한 대답을 간단명료한 양식으로모아 엮어졌습니다.map</tt> {\ss 이 FAQ 은 자주 반복되는 질문과 그에 대한 대답을 간단명료한 양식으로모아 엮어졌습니다. You need to edit <tt>gbk} \starttyping이 FAQ 은 자주 반복되는 질문과 그에 대한 대답을 간단명료한 양식으로모아 엮어졌습니다.map\stoptyping \stoptext</tttexcode>, delete entries of gbli == See also ==* at the end of the file (lines 505-629). ((sample deleted)). Then, put the modified <tt>gbk.map</tt> to <tt>texmf-[[CJK fonts/fonts/map/chinese</tt>. Note that newer pdfetex don't read ]] [[pdftex.cfgCategory:Fonts]] so better use <cmd>loadmapfile[[gbkCategory:Languages]]</cmd> in your document.# Your document should be compilable now. ((Attached is a test file from Lutz, so you can test your ConTeXt.))# 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.

Navigation menu