[NTG-context] MKIV Chinese and English typesetting

2008-03-25 Thread Yanrui Li
Dear Hans and other friends:

I am a Chinese user of ConTeXt. Recently, I tried ConTeXt MkIV and
test its Chinese  typesetting. I am very glad to see MkIV can access
my linux OS TTFOTF fonts and give a good face of my article about
lines breaking. But on the bilingual typesetting, such as Chinese
sentences and English words appearance in a article at the same time ,
I found there are no good methods to solve the  problem of  setting
fonts for them respectively. Now I had to handle it in this way:


\definefontfeature[chinese]
 [mode=node,script=hang,lang=zhs]
 \definefontsynonym[songti]
 [name:simsun]
 [features=chinese]

 \definefontsynonym[Serif][songti]
 \definetypeface[song][rm][serif][songti]
 \setupbodyfont[song,12pt,rm]

 \font\enfont=name:msyh
 \def\en#1{%
 \,\bgroup\enfont #1\egroup\,%
 }

 \starttext
 我用英文进行\en{Hello World}测试。
 \stoptext


I am eager to see full support for chinese and other Asian languages
in ConTeXt MkIV.

I am grateful to  the developers. Thank you for your time and effort
for continuous contributions!
___
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
___


Re: [NTG-context] MKIV Chinese and English typesetting

2008-03-25 Thread Yue Wang
 Dear Hans and other friends:

  I am a Chinese user of ConTeXt. Recently, I tried ConTeXt MkIV and
  test its Chinese  typesetting. I am very glad to see MkIV can access
  my linux OS TTFOTF fonts and give a good face of my article about
  lines breaking. But on the bilingual typesetting, such as Chinese
  sentences and English words appearance in a article at the same time ,
  I found there are no good methods to solve the  problem of  setting
  fonts for them respectively. Now I had to handle it in this way:



Well, I am aware of that problem (I think Hans is aware of that
too). See the relative thread in mailing list archive (Jan 2008, I
think). I mentioned the problem again in another mail to Hans this
morning because more messages like this appeared on Chinese TeX
related web forums these days (It's a good thing, more Chinese TeX
Gurus love to play ConTeXt and LuaTeX ^_^).

There are many ways to deal with that problem. in fact, add your \en
macro into the method.hani() function of  font-otf.lua is a quick and
dirty hack. But I think there should be other more elegant ways to
deal with it. perhaps:
- assign an english font feature to \definefontfeature or
\definefontsynonym. When define a CJK typefaces, the corresponding
English typeface can be defined by the user. switch to another font
when needed (using the similar method as in font-otf.lua).
- map the CJK part of a Chinese typeface and Latin part of a English
typeface to one single virtual font, Use this virtual font for
typesetting.

Both of them are not hard to do technically compared what had been
done before.  So maybe we should wake Hans up to continue the CJK
support? Zhichu Chen and I are eager to help whenever a localization
problem is occurred.

Yue Wang
___
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
___


Re: [NTG-context] MKIV Chinese and English typesetting

2008-03-25 Thread Hans Hagen
Yue Wang wrote:

 Both of them are not hard to do technically compared what had been
 done before.  So maybe we should wake Hans up to continue the CJK
 support? Zhichu Chen and I are eager to help whenever a localization
 problem is occurred.

well, examples of input as well as wanted output are needed then

Hans

-
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
  | 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://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] MKIV Chinese and English typesetting

2008-03-25 Thread Henning Hraban Ramm
Just an idea (I know nothing about Asian scripts and don't need those  
features myself):

Would it perhaps possible to hook that font switch into the language  
mechanism?

Like if I change the language between latin-script languages with  
{\de Deutsch} and get different typography, e.g. other quotation marks.

Perhaps it would be a good solution to use something like:

\setuplanguage[en]{fontfamily=MySerif}
\setuplanguage[cn]{fontfamily=Songti}
\mainlanguage[cn]
  \starttext
我用英文进行{\en Hello World}测试。
  \stoptext


At least that looks logical to me...


Greetlings from Lake Constance!
Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

___
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
___


Re: [NTG-context] MKIV Chinese and English typesetting

2008-03-25 Thread Dohyun Kim
2008/3/25, Yue Wang [EMAIL PROTECTED]:
  Dear Hans and other friends:
  
I am a Chinese user of ConTeXt. Recently, I tried ConTeXt MkIV and
test its Chinese  typesetting. I am very glad to see MkIV can access
my linux OS TTFOTF fonts and give a good face of my article about
lines breaking. But on the bilingual typesetting, such as Chinese
sentences and English words appearance in a article at the same time ,
I found there are no good methods to solve the  problem of  setting
fonts for them respectively. Now I had to handle it in this way:
  



 Well, I am aware of that problem (I think Hans is aware of that
  too). See the relative thread in mailing list archive (Jan 2008, I
  think). I mentioned the problem again in another mail to Hans this
  morning because more messages like this appeared on Chinese TeX
  related web forums these days (It's a good thing, more Chinese TeX
  Gurus love to play ConTeXt and LuaTeX ^_^).

  There are many ways to deal with that problem. in fact, add your \en
  macro into the method.hani() function of  font-otf.lua is a quick and
  dirty hack. But I think there should be other more elegant ways to
  deal with it. perhaps:
  - assign an english font feature to \definefontfeature or
  \definefontsynonym. When define a CJK typefaces, the corresponding
  English typeface can be defined by the user. switch to another font
  when needed (using the similar method as in font-otf.lua).
  - map the CJK part of a Chinese typeface and Latin part of a English
  typeface to one single virtual font, Use this virtual font for
  typesetting.

  Both of them are not hard to do technically compared what had been
  done before.  So maybe we should wake Hans up to continue the CJK
  support? Zhichu Chen and I are eager to help whenever a localization
  problem is occurred.


FYI.  I have recently tried to implement Korean typesetting with LuaTeX,
using the second method you have mentioned, that is virtual font mechanism.
It is, however, not for ConTeXt but for plain TeX, because I am
ignorant about ConTeXt.

http://people.ktug.or.kr/~nomos/mine/luatexko.tex
http://people.ktug.or.kr/~nomos/mine/luatexko.lua
http://people.ktug.or.kr/~nomos/mine/luatextt.lua

On current stage, one of important features missing is supporting
opentype GSUB, which now I am trying to understand how to implement.

For testing, you have to install UnBatang.ttf, the most popular truetype font
for Korean language. You can download this font from
http://kldp.net/frs/download.php/1425/un-fonts-core-1.0.tar.gz
or you may already have it if you use debian or ubuntu linux system.

Then just make a document as follows and compile it with `luatex' command
%
\input luatexko
... some Korean document including english characters ...
\bye
%

I hope my effort could contribute to developing CJK typesetting with LuaTeX.

Dohyun Kim
___
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
___


Re: [NTG-context] MKIV Chinese and English typesetting

2008-03-25 Thread Yue Wang
   \starttext
  我用英文进行{\en Hello World}测试。
   \stoptext


  At least that looks logical to me...


Yes, It is not only logic, but also useless and troublesome.
especially typesetting a document with large amount of foreign words.
Zhichu Chen and I are making a sample. Wait for a few days and we will
post it to Hans.
___
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
___