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>\usetypescriptfile[mscore]\setupbodyfont [ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/htfs.ttf htfs.ttfmschinese,12pt]\usebodyfont [mschinese-light, 12pt]\definebodyfontenvironment[ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/hthei.ttf hthei.ttf24pt]\definebodyfontenvironment[18pt] \setuppagenumber [numberconversion=cn]\definestructureconversionset[chinese][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/htfs.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[24pt]}]\setuphead[ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/gbhei.zip gbhei.zipsection][style={\bf\switchtobodyfont[18pt]}]  \setuppagenumbering[state=start, alternative=singlesided, location={footer, center}, style={\bf\switchtobodyfont[ftp11pt]}] \starttext\chapter{华文字体系列} 在微软提供的 Office 套装中附带了一定数量的中文字体,这些字体是常州华文印刷新技术有限公司制造的。 \startitemize\item \type{\it}://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/gbkai.zip gbkai.zip]</tt> and <tt>[ftp{\it 华文仿宋}\item \type{\rm}: {\rm 华文仿宋}\item \type{\bf}: {\bf 华文中宋}\item \type{\ss}: {\ss 华文细黑}\item \type{\tfxx}: {\tfxx 华文仿宋}\item \type{\tfx}://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/gbsong.zip gbsong.zip]</tt> from ftp{\tfx 华文仿宋}\item \type{\tf}://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/{\tf 华文仿宋}# Get the enc file <tt>[ftp\item \type{\tfa}://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map/Gbk.zip Gbk.zip]</tt> from ftp{\tfa 华文仿宋}\item \type{\tfb}://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map/{\tfb 华文仿宋}# Get the map file <tt>[ftp\item \type{\tfc}://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map/ map.zip]</tt> from ftp{\tfc 华文仿宋}\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 (which contain tfm files2017-12-06), 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 fonts which contain hangul characters (don’t forget to edit <tt>gbk.map</tt>, delete entries of gbli* at set a math font because it is used for the end of the file (lines 505-629symbols in enumerations). ((sample deleted)). Then, put and you have to enable linebreaking for Korean with the modified <tt>gbk{{cmd|setscript}} command.map </tttexcode> to <\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>texmf-fonts/fonts/map/chinese</] [Nanum Gothic Coding] [features=none,preset=range:korean]\definefontfamily [mainface] [tt>. Note that newer pdfetex don't read ] [DejaVu Sans Mono] [features=none] \definefontfamily [mainface] [mm] [pdftex.cfgDejaVu Math\setupbodyfont[mainface] so better use <cmd>loadmapfile \setscript[gbkhangul\starttext 이 FAQ 은 자주 반복되는 질문과 그에 대한 대답을 간단명료한 양식으로모아 엮어졌습니다. {\ss 이 FAQ 은 자주 반복되는 질문과 그에 대한 대답을 간단명료한 양식으로모아 엮어졌습니다.} \starttyping이 FAQ 은 자주 반복되는 질문과 그에 대한 대답을 간단명료한 양식으로모아 엮어졌습니다.\stoptyping \stoptext</cmdtexcode> 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.== See also ==* [[CJK fonts]]
[[Category:Fonts]]
[[Category:InternationalLanguages]]

Navigation menu