ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Wolfgang Schuster" <schuster.wolfgang@googlemail.com>
To: "Mailing list for ConTeXt users" <ntg-context@ntg.nl>
Subject: Re: MKIV Chinese typesetting
Date: Mon, 28 Jan 2008 17:26:51 +0100	[thread overview]
Message-ID: <115224fb0801280826r7f7f5277s49c90c0f780d1987@mail.gmail.com> (raw)
In-Reply-To: <20080128021711.GA13410@phare.normalesup.org>

On Jan 28, 2008 3:17 AM, Arthur Reutenauer
<arthur.reutenauer@normalesup.org> wrote:
>         Hello,
>
>   Thanks for this comprehensive review.  If I'm not mistaken, there is
> no specific code for CJKV typesetting in Mark IV; the examples in mk.pdf
> seem to use the generic font loading mechanism.

This is wrong, fon-otf contains a few lua macros about linebreaking
and char-def has information about the character width (full width,
half width ...)
and other information like opening punctuation, parenthesis but none
of them is finished.

>   I would like to answer more completely, but don't have much time for
> the moment.  About some of your remarks:
>
> > so I think a new feature should be added to map all the Chinese puncts
> > into english while at the same time, a space should be added after the
> > English punct marks.
>
>   Would it not be better to automatically add shrinkable glue after
> Chinese punctuation, rather than replacing the character by force?  This
> would be very much in line with the general TeX philosophy of setting
> text (and would probably suppress the need for half-width forms in the
> font altogether).
>
> > - pp118, penultimate example, box 2, line1, the ' punct mark should
> > not appear at the end of the line
>
>   This should be taken care of by adding an appropriate penalty before
> the character.
>
> > - pp118, ultimate example, box 2, line2, in fact, if you want do
> > perfect Chinese typesetting, all the puncts which begin a line or end
> > a line should be closed to the margin line
>
>   Do you mean simply closer to the margin, or in the margin itself
> (protruding)? Protruding is already possible in pdfTeX; I believe it is
> available in LuaTeX as well, although it might be broken for the moment
> (Taco?).  Setting the character closer to the margin should be possible
> as well, as a modified form of protruding, I trust.
>
> > A small skip should be left between Chinese and English which makes
> > the result much better. usually the space is a quarter of a chinese
> > character width. A TeX expression should like:
> > \hspace{0.25em plus 0.125em minus 0.08em}
>
>   Again, this can be taken care of by automatically adding this glue
> between pairs of character of the appropriate category.
>
> > The last important thing for English and Chinese bi-lingual
> > typesetting is that: do not use English glyphs in Chinese fonts
>
>   Sure, there should be a possibility of specifying a Western font to be
> used inside Chinese text.

Could be done with cirtual fonts but we need a interface.

> > - the following script produce an error: Invalid field id penalty for
> > node type glyph (1).
>
>   I don't have that error here.  This is very big font; are you sure it
> has been read entirely and correctly written to the cache?  Lua crashed
> on my machine when I first compiled your example, and only a partial
> font hash was written to the cache (ConTeXt didn't crash, so the first
> compilation apparently ended well, but the cache was already filled with
> a partial font).  I can imagine that problems will arise in the presence
> of a partially hashed font in the cache.
>
>   Anyway, the code looks quite weird to me:
>
> > \definefontfeature[chinese][mode=node,script=hang,lang=zht,script=hani,lang=dlft]
>
>   This means that you activate two different scripts at the same time
> (hang == Hangul and hani == Han ideographs), and also two languages at
> the same time (zht == Chinese Traditional and dlft is probably a typo
> for dflt == default).  I can't imagine what that is supposed to mean,
> and activating Traditional Chinese is probably wrong with Adobe Song Std
> which is a Simplified Chinese font.  A saner definition of that feature
> would be in my opinion:
>
>         \definefontfeature[chinese-traditional][mode=node,script=hani,lang=zhs]

You need the hang script, it takes care about the linebreak.

>   I know this code comes from mk.pdf, but I think it is a mistake.
>
>   Finally, there is an interesting article by Jin-Hwan Cho (the dvipdfmx
> author) and Haruhiko Okumura about CJKV typesetting with Omega a couple
> of years ago.  They have implemented all of the rules you mention above
> and a bit more; and although they used OTPs at the time, it should be
> quite straighforward to transpose it in Lua code (actually, I've done it
> a couple of months ago, but I have used plain LuaTeX, and in ConTeXt it
> should probably done using node processors or something).
>
>         http://project.ktug.or.kr/omega-cjk/tug2004-preprint.pdf

This this currently done in font-otf.lua.

Greetings,

Wolfgang
___________________________________________________________________________________
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://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


  parent reply	other threads:[~2008-01-28 16:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-27  9:51 Yue Wang
2008-01-28  2:17 ` Arthur Reutenauer
2008-01-28 16:15   ` Hans Hagen
2008-01-28 17:07     ` Arthur Reutenauer
2008-01-28 16:26   ` Wolfgang Schuster [this message]
2008-01-28 23:19     ` Arthur Reutenauer
2008-01-28 23:22       ` Hans Hagen
2008-01-28 23:25       ` Hans Hagen
2008-01-29 11:25       ` Wolfgang Schuster
2008-01-28 16:43   ` Taco Hoekwater
2008-01-28 20:17     ` Hans Hagen
2008-01-28 20:24       ` Arthur Reutenauer
2008-01-28 17:05   ` Yue Wang

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=115224fb0801280826r7f7f5277s49c90c0f780d1987@mail.gmail.com \
    --to=schuster.wolfgang@googlemail.com \
    --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).