ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: Chinese in utf-8
Date: Mon, 10 Oct 2005 22:35:00 +0200	[thread overview]
Message-ID: <434AD074.9030409@wxs.nl> (raw)
In-Reply-To: <434A9C8B.9020709@mail.ru>

Radhelorn wrote:

> Duncan Hothersall wrote:
>
>> Hi all.
>>
>> I have ConTeXt set up to output Chinese using usemodule[chinese], all
>> fonts, encodings and maps are installed and the sample file works well.
>>
>> Now I have a whole load of Chinese text in utf-8 encoding. Can ConTeXt
>> process this, or do I have to convert it to another encoding? I tried
>> \enableregime[utf] and \useencoding[uc] but it just produced black blobs
>> instead of Chinese characters.
>>
>> I hope ConTeXt can do it? :-)
>>
>> Thanks,
>>
>> Duncan
>
>
> Please post output of texexec command. Maybe ConTeXt fails to find 
> some files?

that's tricky. the utf handler assumes named glyphs and noone named the 5000 chinese ones so far 

(some day pdftex will be unicode award so then problems will disappear) 

in the current utf handling mechanism i can envision something: 

- the utf code results in an expansion of the vector 
- instead of using a named glyph, we use a trick

some variant on: 

\startunicodevector chinese_unicode_page_number_1    
  getglyph{ChineseFont1}{#1}%
\stopunicodevector

or probably due to some used trickery (untested) something like the following (not sure, best make a new command): 

\startunicodevector chinese_unicode_page_number_1    
  getglyph\endcsname{ChineseFont1}{#1}\gobbleoneargument 
\stopunicodevector

so, then you only need to define the right fonts i.e. 

\definefont[ChineseFont1][whateverchinesefont_1]

which has the right glyphs in the right slots 

so ... it's actually simple, once you have the fonts split up 

probably the getgyph needs to be replaced by a more clever one that handles special chinese thingies, 

another option is to write another mapper analogue to the ones already there for chinese, i.e. is there some mapping from utf to big5 or so and  hook that into the utf handler. 

(beware, the font-chi modules talk about unicode while actually it's about dedicated mapings resembling a unicode approach; this \defineucharmapping stuff) 

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

  reply	other threads:[~2005-10-10 20:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-10 15:40 Duncan Hothersall
2005-10-10 16:53 ` Radhelorn
2005-10-10 20:35   ` Hans Hagen [this message]
2005-10-17  4:48 ` Lutz Haseloff
     [not found] <20051010203439.5D7AA127B3@ronja.ntg.nl>
2005-10-12 14:04 ` Duncan Hothersall
     [not found] <20051013100003.016F312797@ronja.ntg.nl>
2005-10-14 10:52 ` Duncan Hothersall
     [not found] <20051017082445.BB967127C6@ronja.ntg.nl>
2005-10-17 14:21 ` Duncan Hothersall

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=434AD074.9030409@wxs.nl \
    --to=pragma@wxs.nl \
    --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).