Re: [NTG-context] Thank you for the Chinese support, but still one question.
Yue Wang wrote:
Hi, Hans:
Today I am trying to compile my new book chapter on aerosol science using MKIV. It works great! Thank you. Most commands are successful (rm, ss, mono) after I define a typescript for the Chinese font. commands like \bfa also works. However, basic TeX commands like \bf, \it, don't work. I attach a minimal example in the mail. Is there anything wrong in the document? Thank you.
there was a bug as well as the fact that your definition is wrong % engine=luatex \ctxlua{fonts.collections.trace = true} \definefontfeature[zh][mode=node,script=hang,lang=zhs] \starttypescript [serif] [zhfont] \definefontsynonym [zhserif] [AdobeSongStd-Light] [features=zh] \definefontsynonym [zhserifbold] [AdobeHeitiStd-Regular] [features=zh] \definefontfallback[serifwhatever] [lmroman10-regular] [0x0000-0x0400] [force=yes] \definefontfallback[serifboldwhatever][lmroman10-bold] [0x0000-0x0400] [force=yes] \stoptypescript \starttypescript [serif] [zhfont] [name] \definefontsynonym[Serif] [zhserif] [fallbacks=serifwhatever] \definefontsynonym[SerifBold][zhserifbold][fallbacks=serifboldwhatever] \stoptypescript \starttypescript[myfont] \definetypeface[myfont][rm][serif][zhfont] \stoptypescript \usetypescript[myfont] \setupbodyfont[myfont, rm, 12pt] \starttext A 字体测试。 {\bf A 字体测试。{\tfx A 字体测试。 \bfx A 字体测试。} } \stoptext works with the beta (i uploaded a new version) 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 -----------------------------------------------------------------
On Fri, Aug 08, 2008 at 11:55:21AM +0200, Hans Hagen wrote:
there was a bug as well as the fact that your definition is wrong
% engine=luatex
\ctxlua{fonts.collections.trace = true}
\definefontfeature[zh][mode=node,script=hang,lang=zhs]
\starttypescript [serif] [zhfont] \definefontsynonym [zhserif] [AdobeSongStd-Light] [features=zh] \definefontsynonym [zhserifbold] [AdobeHeitiStd-Regular] [features=zh] \definefontfallback[serifwhatever] [lmroman10-regular] [0x0000-0x0400] [force=yes] \definefontfallback[serifboldwhatever][lmroman10-bold] [0x0000-0x0400] [force=yes] \stoptypescript
\starttypescript [serif] [zhfont] [name] \definefontsynonym[Serif] [zhserif] [fallbacks=serifwhatever] \definefontsynonym[SerifBold][zhserifbold][fallbacks=serifboldwhatever] \stoptypescript
\starttypescript[myfont] \definetypeface[myfont][rm][serif][zhfont] \stoptypescript
\usetypescript[myfont] \setupbodyfont[myfont, rm, 12pt]
\starttext A 字体测试。 {\bf A 字体测试。{\tfx A 字体测试。 \bfx A 字体测试。} } \stoptext
works with the beta (i uploaded a new version)
Hans
Hi, Hans, Thank you for the great works. But there is still a problem when
I test a more complicated file which is attached below. In this file,
both \bf and \bi give the same font lmroman10-bold.
I guess the reason is that I use the same Chinese font
AdobeHeitiStd-Regular for both SerifBold and SerifBoldItalic. But this
cannot be avoided since Chinese fonts have much fewer typefaces than
English fonts.
Would you give some suggestions to solve this problem? Thanks a lot.
Longmin Wang
The test file:
--------------------------------------
% engine=luatex
\ctxlua{fonts.collections.trace = true}
\definefontfeature[zh][mode=node,script=hang,lang=zhs]
\starttypescript [serif] [zhfont]
\definefontsynonym [zhserif][AdobeSongStd-Light][features=zh]
\definefontsynonym [zhserifbold][AdobeHeitiStd-Regular][features=zh]
\definefontsynonym [zhserifitalic][AdobeKaitiStd-Regular][features=zh]
\definefontsynonym [zhserifbolditalic][AdobeHeitiStd-Regular][features=zh]
\definefontfallback[serifwhatever][lmroman10-regular][0x0000-0x0400][force=yes]
\definefontfallback[serifboldwhatever][lmroman10-bold][0x0000-0x0400][force=yes]
\definefontfallback[serifitalicwhatever][lmroman10-italic][0x0000-0x0400][force=yes]
\definefontfallback[serifbolditalicwhatever][lmroman10-bolditalic][0x0000-0x0400][force=yes]
\stoptypescript
\starttypescript [serif][zhfont][name]
\definefontsynonym[Serif][zhserif][fallbacks=serifwhatever]
\definefontsynonym[SerifBold][zhserifbold][fallbacks=serifboldwhatever]
\definefontsynonym[SerifItalic][zhserifitalic][fallbacks=serifitalicwhatever]
\definefontsynonym[SerifBoldItalic][zhserifbolditalic][fallbacks=serifbolditalicwhatever]
\stoptypescript
\starttypescript[myfont]
\definetypeface[myfont][rm][serif][zhfont]
\stoptypescript
\usetypescript[myfont]
\setupbodyfont[myfont, rm, 12pt]
\starttext
fonts {\bf fonts} {\bi fonts} {\it fonts}
\stoptext
--
Longmin Wang
Longmin Wang wrote:
Hi, Hans, Thank you for the great works. But there is still a problem when I test a more complicated file which is attached below. In this file, both \bf and \bi give the same font lmroman10-bold.
I guess the reason is that I use the same Chinese font AdobeHeitiStd-Regular for both SerifBold and SerifBoldItalic. But this
indeed, the name+featureset+size is unique, but fallbacks are not part of that hash
cannot be avoided since Chinese fonts have much fewer typefaces than English fonts.
Would you give some suggestions to solve this problem? Thanks a lot.
i'll have a look at it, but it involves some changes in the lua code dealing with font definitions (unique hashes and such) 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 -----------------------------------------------------------------
Longmin Wang wrote:
Hi, Hans, Thank you for the great works. But there is still a problem when I test a more complicated file which is attached below. In this file, both \bf and \bi give the same font lmroman10-bold.
experimental patch in beta ----------------------------------------------------------------- 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 -----------------------------------------------------------------
On Mon, Aug 11, 2008 at 12:17:15PM +0200, Hans Hagen wrote:
Longmin Wang wrote:
Hi, Hans, Thank you for the great works. But there is still a problem when I test a more complicated file which is attached below. In this file, both \bf and \bi give the same font lmroman10-bold.
experimental patch in beta
Now it works fine. Thank you.
--
Longmin Wang
participants (2)
-
Hans Hagen
-
Longmin Wang