I started to use ConTeXt several weeks ago, and I like it very much :-) I met some problems when I tried to use Chinese in ConTeXt. I have tried to setup Chinese fonts according to the manual "Chinese in ConTeXt" (mchinese.pdf) which seems a little out-of-date. In the manual, programs gbpfb/chpfb, and gbenc are used to perpare the Chinese fonts. But, I chpfb is not shipped with trubolinux anymore . I have googled and couldn't find these programs on the internet. Do someone have some experience of how to setup Chinese in ConTeXt? Thanks in advance! Best wishes. Xiaojf
Yes. Your proposal or question??? Cheers, mh
-----Message d'origine----- De : ntg-context-bounces@ntg.nl [mailto:ntg-context-bounces@ntg.nl] De la part de Xiao Jianfeng Envoyé : dimanche 29 mai 2005 10:50 À : ntg-context@ntg.nl Objet : [NTG-context] Chinese in ConTeXt
Xiao Jianfeng wrote:
I started to use ConTeXt several weeks ago, and I like it very much :-)
I met some problems when I tried to use Chinese in ConTeXt. I have tried to setup Chinese fonts according to the manual "Chinese in ConTeXt" (mchinese.pdf) which seems a little out-of-date. In the manual, programs gbpfb/chpfb, and gbenc are used to perpare the Chinese fonts. But, I chpfb is not shipped with trubolinux anymore . I have googled and couldn't find these programs on the internet.
Do someone have some experience of how to setup Chinese in ConTeXt?
there are users on this list, also,
Hong Feng
Thanks a lot and I will try to contact Hong Feng :-) Hans Hagen wrote:
Xiao Jianfeng wrote:
I started to use ConTeXt several weeks ago, and I like it very much :-)
I met some problems when I tried to use Chinese in ConTeXt. I have tried to setup Chinese fonts according to the manual "Chinese in ConTeXt" (mchinese.pdf) which seems a little out-of-date. In the manual, programs gbpfb/chpfb, and gbenc are used to perpare the Chinese fonts. But, I chpfb is not shipped with trubolinux anymore . I have googled and couldn't find these programs on the internet.
Do someone have some experience of how to setup Chinese in ConTeXt?
there are users on this list, also,
Hong Feng
does the chinese user group have an archive with those tools and fonts?
of the chinese user group is an able context user so he may be of help.
We need to fix the manual! Suggestions are welcome.
btw, there will be tutorials at the tex ocnference in china
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 -----------------------------------------------------------------
_______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Hi Jianfeng, Hi Hans, because i had the same Problem some time ago i prepared two PerlScripts for converting Unicode TrueType fonts to suitable bunches of Type 1 fonts for use in ConTeXt in big5 and gbk encoding. I sent the scripts to Hans. He perhaps wanted to include them into texexec.pl if possible. If you use Windows or can use Windows i can send you the scripts. (they work with a particular version of ttf2pfb.exe only) B.t.w. for the use of the fonts described in font-chi.tex you will need only some files you can download from ftp.ctex.org. (If you like i can send you these files too) Xiao Jianfeng schrieb:
Thanks a lot and I will try to contact Hong Feng :-)
Hans Hagen wrote:
Xiao Jianfeng wrote:
I started to use ConTeXt several weeks ago, and I like it very much :-)
I met some problems when I tried to use Chinese in ConTeXt. I have tried to setup Chinese fonts according to the manual "Chinese in ConTeXt" (mchinese.pdf) which seems a little out-of-date. In the manual, programs gbpfb/chpfb, and gbenc are used to perpare the Chinese fonts. But, I chpfb is not shipped with trubolinux anymore . I have googled and couldn't find these programs on the internet.
Do someone have some experience of how to setup Chinese in ConTeXt?
there are users on this list, also,
Hong Feng
does the chinese user group have an archive with those tools and fonts?
of the chinese user group is an able context user so he may be of help.
We need to fix the manual! Suggestions are welcome.
btw, there will be tutorials at the tex ocnference in china
Hans
Hi, Lutz, Thanks for your reply. I am use the minimal CONTEXT distribution on windows (http://www.pragma-ade.com/context/install/mswintex.zip), will you please send me a copy of your scripts ? Thanks again! Xiao Jianfeng Lutz Haseloff wrote:
Hi Jianfeng, Hi Hans,
because i had the same Problem some time ago i prepared two PerlScripts for converting Unicode TrueType fonts to suitable bunches of Type 1 fonts for use in ConTeXt in big5 and gbk encoding.
I sent the scripts to Hans. He perhaps wanted to include them into texexec.pl if possible. If you use Windows or can use Windows i can send you the scripts. (they work with a particular version of ttf2pfb.exe only)
B.t.w. for the use of the fonts described in font-chi.tex you will need only some files you can download from ftp.ctex.org. (If you like i can send you these files too)
Lutz Haseloff wrote:
Hi Jianfeng, Hi Hans,
because i had the same Problem some time ago i prepared two PerlScripts for converting Unicode TrueType fonts to suitable bunches of Type 1 fonts for use in ConTeXt in big5 and gbk encoding.
I sent the scripts to Hans. He perhaps wanted to include them into texexec.pl if possible. If you use Windows or can use Windows i can send you the scripts. (they work with a particular version of ttf2pfb.exe only)
B.t.w. for the use of the fonts described in font-chi.tex you will need only some files you can download from ftp.ctex.org. (If you like i can send you these files too)
A few weeks back, there was a short exchange on this list regarding utilities for preparing chinese fonts for ConTeXt. One of the postings provided a link to some new utilities. I've since downloaded the file there (gbkfonts-linux-0.2.tar.gz) but am unsure as to how to
After a search via google, i found the following article posted on 2002 (http://www.ntg.nl/pipermail/ntg-context/2002/000636.html). I don't know if it works or not, but i will have a try. I think it may be helpful to people who have similar problems, so i just post the article here again: *********************************************************************** [NTG-context] chinese font setup Michael Na Li ntg-context@ntg.nl Sun, 15 Dec 2002 10:03:52 -0800 * Previous message: [NTG-context] chinese font setup * Next message: [NTG-context] chinese font setup * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] On Sun, 15 Dec 2002, Matthew Huggett told this: proceed. If
anyone with experience in this area could provide some advice, I'd appreciate it.
Have you got any Chinese fonts that work for ConTeXt? If not, you can try, ftp.ctex.org to get some fonts. There is no need to use gbkfonts. For simplified chinese, you can, 1. Get the truetype fonts, htfs.ttf, hthei.ttf, htkai.ttf and htsong.ttf from ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/. 2. Get corresponding tfm file, gbfs.zip, gbhei.zip, gbkai.zip and gbsong.zip from ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm. 3. Get the enc file, Gbk.zip from ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map. 4. Get the map file, map.zip, from above location. Then read the mchinese.pdf, put those files in the right location and you can then process Chinese in context (to produce pdf file). The above procedure works because those fonts have already been defined in font-chi.tex. However, I have trouble installing new Chinese fonts. I got fzhcjw.ttf, ran 'gbkfonts -name fzhc -prefix gbk fzhcjw.ttf fzhc' which resulted in the tfm, enc and map files, as well as pfb for use with dvips. It also generated a fd file for use with LaTeX. I can then use the font with CJK-LaTeX. But I can't use it in ConTeXt. I tried, \definefontsynonym [SimplifiedChineseHangCaoRegular] [gbkfzhc] [encoding=gbk] \definefontsynonym [SimplifiedChineseHangCaoSlanted] [gbkfzhcsl] [encoding=gbk] \definefontsynonym [SimplifiedChineseHangCaoItalic] [gbkfzhcsl] [encoding=gbk] \definefontsynonym [SimplifiedChineseHangCaoBold] [gbkfzhc] [encoding=gbk] \definefontsynonym [SimplifiedChineseHangCaoBoldSlanted][gbkfzhcsl][encoding=gbk ] \definefontsynonym [SimplifiedChineseHangCaoBoldItalic] [gbkfzhcsl][encoding=gbk ] \defineunicodefont [SimHangCao] [SimplifiedChineseHangCao] [chinese] Then when I tried to use \SimHangCao I was told that it is undefined command. The other fonts in the font-chi file, such as \SimFangSong etc, do work. Any suggestions? Michael -- ---------------------------------------------------------------------------- Michael Na Li Email: lina@u.washington.edu Department of Biostatistics, Box 357232 University of Washington, Seattle, WA 98195 --------------------------------------------------------------------------- ****************************************************************************
Hi Hans, Hi all, Xiao Jianfeng schrieb:
Lutz Haseloff wrote:
Hi Jianfeng, Hi Hans,
because i had the same Problem some time ago i prepared two PerlScripts for converting Unicode TrueType fonts to suitable bunches of Type 1 fonts for use in ConTeXt in big5 and gbk encoding.
I sent the scripts to Hans. He perhaps wanted to include them into texexec.pl if possible.
My mistake, must read texfont.pl. b.t.w. I think, \dohandleunicodeflowglyph doesn't handle some glyphs right. Particularly the glyphs with parenthesis {} and Backslash. ConTeXt complains about my qianziwen-Big5.tex: ------------------------------------------- ! Use of \dohandleunicodeflowglyph doesn't match its definition. <recently read> ¦ \handleunicodeflowglyph ...ttoken \@EA `\string #2 \relax l.18 »\¦ ¹¨µo¡A¥|¤j¤±`¡C®¥±©Áù¾i¡A°Z´±·´¶Ë¡C ? ------------------------------------------- Attached GBK-file works fine. Is it possible to make \dohandleunicodeflowglyph more robust to handle those big5 glyphs right? Or is it my mistake again? Greetings Lutz
Lutz Haseloff wrote:
b.t.w. I think, \dohandleunicodeflowglyph doesn't handle some glyphs right. Particularly the glyphs with parenthesis {} and Backslash.
ConTeXt complains about my qianziwen-Big5.tex:
------------------------------------------- ! Use of \dohandleunicodeflowglyph doesn't match its definition. <recently read> ¦
\handleunicodeflowglyph ...ttoken \@EA `\string #2 \relax l.18 »\¦ ¹¨µo¡A¥|¤j¤±`¡C®¥±©Áù¾i¡A°Z´±·´¶Ë¡C ? -------------------------------------------
Attached GBK-file works fine.
Is it possible to make \dohandleunicodeflowglyph more robust to handle those big5 glyphs right? Or is it my mistake again?
i may be wrong (long ago that i made that-) but those file needs some treatment (esp when one uses arguments) tex2uc yourfile texexec yourfile uc2tex yourfile actually, since i have a indirect option in texexec (for xml) i can make this automatic, e.g. when the first line has something % preprocess=tex2uc I must think of it; remind me 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 ----------------------------------------------------------------- # ConTeXt uc converter / beta version / 2-12-1999 / don't redistribute $filename = $ARGV[0] ; $recoded = 0 ; sub unirecoded { print chr($_[1]) ; ++$recoded ; return chr($_[0]).chr($_[1]) } if ((open(INP,"$filename.tex"))&&(open(OUT,">$filename.tmp"))) { print "processing file $filename.tex " ; while (<INP>) { s/\\uc\{(\d*)\}\{(\d*)\}/unirecoded($1,$2)/goe ; print OUT $_ } close(INP) ; close(OUT) ; unlink "$filename.tec" ; rename "$filename.tex", "$filename.tec" ; rename "$filename.tmp", "$filename.tex" ; if ($recoded) { print " - $recoded glyphs recoded - original saved as $filename.tec\n" } else { print "- no glyphs recoded\n" } } else { print "invalid filename\n" } # ConTeXt uc converter / beta version / 2-12-1999 / don't redistribute if ($ARGV[0] ne '') { @filenames = @ARGV } else { @filenames = glob "*.tex" } foreach (@filenames) { s/\.tex$//io } sub unirecode { my ($a,$b) = @_ ; if ((ord($b)<0x80)&&($b !~ /[a-zA-Z0-9]/)) { print "$b" ; ++$recoded ; return "\\uc\{" . ord($a) . "\}\{". ord($b) . "\}" } else { return "$a$b" } } foreach $filename (@filenames) { if (open(INP,"$filename.tex")) { $recoded = 0 ; print "processing file $filename.tex " ; $/ = "\0777" ; $_ = <INP> ; close(INP) ; s/([\x80-\xFF])(.)/unirecode($1,$2)/mgoe ; if (($recoded)&&(open(OUT,">$filename.tmp"))) { print OUT $_ ; close(OUT) ; unlink "$filename.tec" ; rename "$filename.tex", "$filename.tec" ; rename "$filename.tmp", "$filename.tex" } if ($recoded) { print " - $recoded glyphs recoded - original saved as $filename.tec\n" } else { print "- no glyphs recoded\n" } } else { print "invalid filename\n" } }
Xiao Jianfeng wrote:
I started to use ConTeXt several weeks ago, and I like it very much :-)
I met some problems when I tried to use Chinese in ConTeXt. I have tried to setup Chinese fonts according to the manual "Chinese in ConTeXt" (mchinese.pdf) which seems a little out-of-date. In the manual, programs gbpfb/chpfb, and gbenc are used to perpare the Chinese fonts. But, I chpfb is not shipped with trubolinux anymore . I have googled and couldn't find these programs on the internet.
Do someone have some experience of how to setup Chinese in ConTeXt?
Thanks in advance!
Best wishes.
Xiaojf _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Hi, all,
I have solved the problem with help of Lutz and the other people. I must
thanks Lutz, and thanks everyone here :-)
Here is my way of Chinese setup in ConTeXt. I hope this can be of any
help to some newbies like me who have problems in processing Chinese.
1. Get the truetype fonts, htfs.ttf, hthei.ttf, htkai.ttf and htsong.ttf
from
ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/
2. Get corresponding tfm file, gbfs.zip, gbhei.zip, gbkai.zip and
gbsong.zip from
ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm
3. Get the enc file, Gbk.zip from
ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map
4. Get the map file, map.zip, from
ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map
5. Put the ttf font files you got in step 1 to
texmf-fonts/fonts/truetype/chinese
6. Unzip the files you got in step 2 and you get four corresponding
directories(which contain tfm files), then put them in
texmf-fonts/fonts/tfm/chinese
7. Unzip Gbk.zip, you will get a directory named "Gbk" which contains
many enc files. Put the directory to texmf-fonts/fonts/enc/chinese
8.Unzip map.zip, you will get many map files, you need just the gbk.map.
You need to edit gbk.map, delete entried of gbli at the end of the file
(lines 505-629):
gbli81
Am 06.06.2005 um 10:08 schrieb Xiao Jianfeng:
Here is my way of Chinese setup in ConTeXt. I hope this can be of any help to some newbies like me who have problems in processing Chinese.
I just copied that to the wiki. Grüßlis vom Hraban! --- http://www.fiee.net/texnique/ http://contextgarden.net
I discover (~8 years later) http://www.pragma-ade.com/dir/general/sources/modules.pdf I think it is a useful pdf: Is there any tool to generate it ? luigi
Update to latest distro;see http://contextgarden.net/User:Luigi.scarso/modules.pdf luigi
Fix partial contents; see http://contextgarden.net/User:Luigi.scarso/modules.pdf luigi
participants (6)
-
Hans Hagen
-
Henning Hraban Ramm
-
luigi.scarso
-
Lutz Haseloff
-
Michael Hallgren
-
Xiao Jianfeng