On 8/27/2017 4:17 AM, Martin Bruchanov wrote:
Hi all,
I was trying to create a Chinese document. However, it was quite
difficult to find actual information and find fonts...
Here is the result:
https://github.com/BruXy/ConTeXt-Chinese
There is still wrong numbering of Tables and I am not sure how to
convert mschinese.ctex into module, but maybe somebody will help.
These are old fonts yes? Anyway, here is a better typescript:
\starttypescriptcollection[microsoft-chinese-old]
\starttypescript [serif] [mschinese,mschinese-light]
\definefontsynonym [STSong] [name:STSong]
[features=chinese]
\definefontsynonym [STKaiti] [name:STKaiti]
[features=chinese]
\definefontsynonym [STZHongsong] [name:STZHongsong]
[features=chinese]
\definefontsynonym [STFangsong] [name:STFangsong]
[features=chinese]
\stoptypescript
\starttypescript [sans] [mschinese]
\definefontsynonym [STXIHei] [name:STXIHei] [features=chinese]
\stoptypescript
\starttypescript [serif] [mschinese]
\usetypescript[serif][fallback]
\definefontsynonym [Serif] [STSong] [features=chinese]
\definefontsynonym [SerifItalic] [STKaiti] [features=chinese]
\definefontsynonym [SerifBold] [STZHongsong] [features=chinese]
\stoptypescript
\starttypescript [serif] [mschinese-light]
\usetypescript[serif][fallback]
\definefontsynonym [Serif] [STFangsong] [features=chinese]
\definefontsynonym [Serif] [STSong] [features=chinese]
\definefontsynonym [SerifItalic] [STKaiti] [features=chinese]
\definefontsynonym [SerifBold] [STZHongsong] [features=chinese]
\stoptypescript
\starttypescript [sans] [mschinese]
\setups[font:fallback:sans]
\definefontsynonym [Sans] [STXIHei] [features=chinese]
\stoptypescript
\starttypescript[mschinese]
\definetypeface [mschinese] [rm] [serif] [mschinese] [default]
\definetypeface [mschinese] [ss] [sans] [mschinese] [default]
\definetypeface [mschinese] [mm] [math] [pagella]
\definetypeface [mschinese] [tt] [mono] [modern]
\stoptypescript
\starttypescript[mschinese-light]
\definetypeface [mschinese] [rm] [serif] [mschinese-light]
[default]
\definetypeface [mschinese] [ss] [sans] [mschinese]
[default]
\definetypeface [mschinese] [mm] [math] [modern]
\definetypeface [mschinese] [tt] [mono] [modern]
\stoptypescript
\stoptypescriptcollection
if needed I can add type-imp-windows-chinese.mkiv but we need to be sure
about the name(s).
In your test you need:
\setupbodyfont [mschinese,12pt]
\usebodyfont [mschinese-light,12pt] % preloads
\definebodyfontenvironment[24pt] % prevents messages
\definebodyfontenvironment[18pt] % prevents messages
There is no need to enable utf. Your table now becomes:
\bTABLEbody
\bTR\bTD 华文宋体 \eTD\bTD \tt STSONG.TTF \eTD\bTD STSong \eTD\bTD
\tf 我能吞下玻璃而不伤身体 \eTD \eTR
\bTR\bTD 华文中宋 \eTD\bTD \tt STZHONGS.TTF \eTD\bTD STZhongsong \eTD\bTD
\bf 我能吞下玻璃而不伤身体 \eTD \eTR
\bTR\bTD 华文细黑 \eTD\bTD \tt STXIHEI.TTF \eTD\bTD STXihei \eTD\bTD
\it 我能吞下玻璃而不伤身体 \eTD \eTR
\bTR\bTD 华文楷体 \eTD\bTD \tt STKAITI.TTF \eTD\bTD STKaiti \eTD\bTD
\ss 我能吞下玻璃而不伤身体 \eTD \eTR
\bTR\bTD 华文仿宋 \eTD\bTD \tt STFANGSO.TTF \eTD\bTD STFangsong \eTD\bTD
\switchtobodyfont[mschinese-light]我能吞下玻璃而不伤身体 \eTD \eTR
\eTABLEbody
There is no need for grouping. You switch to sans with \ss as it's part
of the typeface specification.
For other issues you need to be more specific
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________