ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
	Martin Bruchanov <bruxy@regnet.cz>
Subject: Re: MS Office Chinese fonts in ConTeXt
Date: Sun, 27 Aug 2017 19:57:23 +0200	[thread overview]
Message-ID: <43145cfe-ffc5-47a3-9936-90d71a295490@wxs.nl> (raw)
In-Reply-To: <fd27f2e3-3b6b-ea57-b75e-7674948664be@regnet.cz>

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
___________________________________________________________________________________

  reply	other threads:[~2017-08-27 17:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-27  2:17 Martin Bruchanov
2017-08-27 17:57 ` Hans Hagen [this message]
2017-08-27 18:12 ` Hans Hagen
2017-09-05  1:18   ` Martin Bruchanov
2017-09-05  7:02     ` Henning Hraban Ramm
2017-09-05  7:30     ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43145cfe-ffc5-47a3-9936-90d71a295490@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=bruxy@regnet.cz \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).