Re: [NTG-context] What is equivalent of latex math aligned in ConTeXt?

2009-05-12 Thread Alan BRASLAU
On Monday 11 May 2009 20:16:11 Aditya Mahajan wrote:
 I would also use \implies instead of \Rightarrow (slightly different
 spacing).

! Undefined control sequence.
recently read \implies

$\to$
\usemodule[math-ams]

___
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] Metapost question

2009-05-12 Thread Taco Hoekwater


Jean Magnan de Bornier wrote:
 Le 11 mai à 20:02:36 Mojca Miklavec mojca.miklavec.li...@gmail.com écrit 
 notamment:
 
 |  | Which command does that evil? They both seem to work here ...
 | 
 |  mpost, texexec --mpgraphic, mpost -mem=metafun.mem, all three of them!
 | I don't understand. Can you please post the whole log. You cannot get
 | metafun warnings when running just mpost unless something is set up
 | in some really weird way. I could imagine that there could be some
 | infinite loop in some metafun macro, but I cannot imagine why mpost
 | would fall into infinite loop.
 
 I have stopped compilation after no more than 30 seconds, the log is 14MB
 large with many lines:

It looks like you should also post ecindf.mp so we can try for
ourselves (or did I miss that?).

Best wishes,
Taco

___
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] New module - mkiv font loading

2009-05-12 Thread Wolfgang Schuster


Am 11.05.2009 um 14:41 schrieb Yue Wang:


Hi Wolfgang:

nice script.

Can the module meet my needs discussed in
http://www.ntg.nl/pipermail/ntg-context/2009/040831.html ?
or is it possible to extend the support to xetex?



When you take care about font switching in your module it's easy,
large part of the code can be left out because XeTeX can find the
regular/italic/... styles itself.

\unprotect

\def\setmainfont[#1]{\definetypeface[simplefonts][rm][Xserif][#1] 
[default]}
\def\setsansfont[#1]{\definetypeface[simplefonts][ss][Xsans] [#1] 
[default]}
\def\setmonofont[#1]{\definetypeface[simplefonts][tt][Xmono] [#1] 
[default]}


\appendtoks\setupbodyfont[simplefonts]\to\everystarttext

\protect

\setmainfont[Times New Roman]
\setsansfont[Arial]
\setmonofont[Courier New]

\starttext

\rm\tf roman \it italic \bf bold \bi bolditalic

\ss\tf roman \it italic \bf bold \bi bolditalic

\tt\tf roman \it italic \bf bold \bi bolditalic

\stoptext

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
___


[NTG-context] enco-xtx.tex is still wrong

2009-05-12 Thread Yue Wang
Hi, Hans,


The enco-xtx.tex defination is still wrong...
it behaves very differently compared to unicode-letters.tex


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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Yue Wang
Hi:

update: change the second example, remove the .otf suffix , and
texexec --xtx gives:
TeXExec | runtime: 5.766
Obviously, this is a parsing bug in ConTeXt.

I doubt the reason to the third one is the same.

Yue Wang



2009/5/12 Yue Wang yuleo...@gmail.com:
 Hi, Hans and Jonathan:

 I made some testing samples in ConTeXt to test XeTeX. but the result
 is quite strange. All benchmark are get from the second run:

 Sample 1:

 \definefont[a][file:SimSun]
 \starttext
 \dorecurse{1}{ hello {\a 你好}}
 \stoptext

 And here is the result:

 XeTeX: TeXExec | runtime: 7.25
 LuaTeX: MTXrun | total runtime: 6.719

 This is considerablly ok. So we can say that the font switching is pretty 
 fast.

 Sample 2:

 \definefont[a][file:AdobeSongStd-Light.otf]
 \starttext
 \dorecurse{1}{ hello {\a 你好}}
 \stoptext

 XeTeX: TeXExec | runtime: 63.65
 LuaTeX: MTXrun | total runtime: 8.156

 Here I only change the font from SimSun to Adobe Song (the two fonts
 are almost at the same sice [~10M]).
 But the xetex result is very differt from the previous run. it
 consumes one minute to compile the file.


 Sample 3:


 \starttypescript[serif] [myzhfont]
  \definefontsynonym [Serif]   [file:SimSun]
  \definefontsynonym [SerifBold]   [file:SimSun]
  \definefontsynonym [SerifItalic] [file:SimSun]
  \definefontsynonym [SerifBoldItalic] [file:SimSun]
 \stoptypescript

 \starttypescript[sans] [myzhfont]
  \definefontsynonym [Sans]   [file:SimSun]
  \definefontsynonym [SansBold]   [file:SimSun]
  \definefontsynonym [SansItalic] [file:SimSun]
  \definefontsynonym [SansBoldItalic] [file:SimSun]
 \stoptypescript

 \starttypescript[mono] [myzhfont]
  \definefontsynonym [Mono]   [file:SimSun]
  \definefontsynonym [MonoBold]   [file:SimSun]
  \definefontsynonym [MonoItalic] [file:SimSun]
  \definefontsynonym [MonoBoldItalic] [file:SimSun]
 \stoptypescript

 \definetypeface [myzhfont] [rm] [serif][myzhfont]   [default]
 \definetypeface [myzhfont] [ss] [sans] [myzhfont]   [default]
 \definetypeface [myzhfont] [tt] [mono] [myzhfont]   [default]

 \def\a{\myzhfont}
 \starttext
 \dorecurse{1}{ hello {\a 你好}}
 \stoptext

 XeTeX: TeXExec | runtime: 64.797
 LuaTeX: MTXrun | total runtime: 10.797

 Here we use SimSun since in the first sample xetex can load simsun quite fast.
 However, in this time we define a typescript, and make all the styles
 fall into SimSun.
 Now xetex behaves quite strangely: it uses one minutes to compile this
 single document...


 So my question is
 - why loading otf is so slow?
 - is this a bug in context or in xetex? can it be fixed?
 - how can we make sample 3  (using typescript) run faster?


 Thanks.

 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] in luatex/mkiv formats are generated on the fly

2009-05-12 Thread Hans Hagen

Vyatcheslav Yatskovsky wrote:

Hello, Hans

in luatex/mkiv formats are generated on the fly

What do you mean? That one does NOT need context --make at all?


indeed (only luatools --generate if needed)

-
  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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Yue Wang
Hi,

Sum up:
define a font usng typescripts takes 64.797 seconds.
define a font like \definefont[a][file:SimSun.ttf] takes 55.548 seconds
define a font like \definefont[a][file:SimSun] takes 4.329 seconds
define a font like \font\a=[simsun] takes 1.812 seconds

Jonathan and Jin-Hwan, sorry for the noise. I am now sure that it is a
context bug, not xetex's.

Yue Wang

2009/5/12 Yue Wang yuleo...@gmail.com:
 Hi, Hans and Jonathan:

 I made some testing samples in ConTeXt to test XeTeX. but the result
 is quite strange. All benchmark are get from the second run:

 Sample 1:

 \definefont[a][file:SimSun]
 \starttext
 \dorecurse{1}{ hello {\a 你好}}
 \stoptext

 And here is the result:

 XeTeX: TeXExec | runtime: 7.25
 LuaTeX: MTXrun | total runtime: 6.719

 This is considerablly ok. So we can say that the font switching is pretty 
 fast.

 Sample 2:

 \definefont[a][file:AdobeSongStd-Light.otf]
 \starttext
 \dorecurse{1}{ hello {\a 你好}}
 \stoptext

 XeTeX: TeXExec | runtime: 63.65
 LuaTeX: MTXrun | total runtime: 8.156

 Here I only change the font from SimSun to Adobe Song (the two fonts
 are almost at the same sice [~10M]).
 But the xetex result is very differt from the previous run. it
 consumes one minute to compile the file.


 Sample 3:


 \starttypescript[serif] [myzhfont]
  \definefontsynonym [Serif]   [file:SimSun]
  \definefontsynonym [SerifBold]   [file:SimSun]
  \definefontsynonym [SerifItalic] [file:SimSun]
  \definefontsynonym [SerifBoldItalic] [file:SimSun]
 \stoptypescript

 \starttypescript[sans] [myzhfont]
  \definefontsynonym [Sans]   [file:SimSun]
  \definefontsynonym [SansBold]   [file:SimSun]
  \definefontsynonym [SansItalic] [file:SimSun]
  \definefontsynonym [SansBoldItalic] [file:SimSun]
 \stoptypescript

 \starttypescript[mono] [myzhfont]
  \definefontsynonym [Mono]   [file:SimSun]
  \definefontsynonym [MonoBold]   [file:SimSun]
  \definefontsynonym [MonoItalic] [file:SimSun]
  \definefontsynonym [MonoBoldItalic] [file:SimSun]
 \stoptypescript

 \definetypeface [myzhfont] [rm] [serif][myzhfont]   [default]
 \definetypeface [myzhfont] [ss] [sans] [myzhfont]   [default]
 \definetypeface [myzhfont] [tt] [mono] [myzhfont]   [default]

 \def\a{\myzhfont}
 \starttext
 \dorecurse{1}{ hello {\a 你好}}
 \stoptext

 XeTeX: TeXExec | runtime: 64.797
 LuaTeX: MTXrun | total runtime: 10.797

 Here we use SimSun since in the first sample xetex can load simsun quite fast.
 However, in this time we define a typescript, and make all the styles
 fall into SimSun.
 Now xetex behaves quite strangely: it uses one minutes to compile this
 single document...


 So my question is
 - why loading otf is so slow?
 - is this a bug in context or in xetex? can it be fixed?
 - how can we make sample 3  (using typescript) run faster?


 Thanks.

 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
___


[NTG-context] The ultimate (?) float problem

2009-05-12 Thread Piotr Kopszak
Dear all,

I am close to give up, but maybe there is a solution... I have a book
to typeset literally peppered with hundreds of little drawings which
are supposed to appear irregularly surrounded by text flowing around
them on all sides.

|xx |
|x-xx|
|x| |xx |
|x|__|xx| ||
|xx |__||
|xx|


I naively imagine that should not be that hard to implement ;) Since
we already have overlays it's no problem to place images in arbitrary
places. It only remains to drill white holes in the text to make room
for them.  What about such procedure:

1. While building the line TeX checks if there is any overlay ahead.
2 if so, it puts empty hbox of the overlay width when it reaches
necessary distance from the edge.
3. and does so for the number of lines which equal overlay height.

Of course that  leaves aside the problem of justification and without
justification such page would probably look very ugly (I dare not to
think if hz optimization, which I really got used to, would still
work).
Is there still hope I could stay with ConTeXt this time as well?

Many thanks for any ideas in advance

Piotr
--
http://okle.pl
___
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] enco-xtx.tex is still wrong

2009-05-12 Thread Hans Hagen

Yue Wang wrote:

Hi, Hans,


The enco-xtx.tex defination is still wrong...
it behaves very differently compared to unicode-letters.tex


well, it's not supposed to do the same (and we're not going to be latex 
compatible anyway)


as we now need mpore 'tables' i've reorganized the xetex code (will also 
 do that with fonts) a bit


- there is now xetx-ini which implements a few helpers as well as a 
subsystem for dealing with these classes (example at the end of that file)


- a couple of classes are defined in xetx-cls and they have symbolic 
names (and can be grouped into namespaces analogue to other context 
mechanisms)


- lc etc codes are set in xetx-utf and symbolic names for characters are
set in xetx-chr

- as specific usage of those char classes is very dependent on 
interfacing as well, it is up to modules to implement associated 
behaviour and there will be no hard coded defaults in the core (at least 
not in the short term)


- as xetex is too slow on my machine (persistens caching of fonts 
problem) i cannot test too much


So, if more is needed we can provide more but we do it the context way -)

i uploaded a beta to the website so that mojca can test it in the minimals

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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Yue Wang
here is the xelatex result given by a chinese user:

\documentclass{minimal}
\usepackage{xeCJK}
\setCJKfamilyfont{song}{SimSun}
\begin{document}
{hello {\CJKfamily{song}你好}}\par % 1 lines
\end{document}

got 209 pages, three seconds to run.
note he is switching  families 2 times. (\family{foo} in latex ==
\switchbodyfont[foo] in context)

On Tue, May 12, 2009 at 5:30 PM, Hans Hagen pra...@wxs.nl wrote:
 Yue Wang wrote:
 Hi,

 Sum up:
 define a font usng typescripts takes 64.797 seconds.
 define a font like \definefont[a][file:SimSun.ttf] takes 55.548 seconds
 define a font like \definefont[a][file:SimSun] takes 4.329 seconds
 define a font like \font\a=[simsun] takes 1.812 seconds

 Jonathan and Jin-Hwan, sorry for the noise. I am now sure that it is a
 context bug, not xetex's.

 and

 update: change the second example, remove the .otf suffix , and
 texexec --xtx gives:
 TeXExec | runtime: 5.766
 Obviously, this is a parsing bug in ConTeXt.

 context is not parsing for .otf or .ttf and has no reason for it either

 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
 ___

___
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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Yue Wang
sorry the the context sample and latex sample are not equivalent
(note the \par).

So I test again:
\starttypescript[serif] [myzhfont]
 \definefontsynonym [Serif]   [file:SimSun]
 \definefontsynonym [SerifBold]   [file:SimSun]
 \definefontsynonym [SerifItalic] [file:SimSun]
 \definefontsynonym [SerifBoldItalic] [file:SimSun]
\stoptypescript

\starttypescript[sans] [myzhfont]
 \definefontsynonym [Sans]   [file:SimSun]
 \definefontsynonym [SansBold]   [file:SimSun]
 \definefontsynonym [SansItalic] [file:SimSun]
 \definefontsynonym [SansBoldItalic] [file:SimSun]
\stoptypescript

\starttypescript[mono] [myzhfont]
 \definefontsynonym [Mono]   [file:SimSun]
 \definefontsynonym [MonoBold]   [file:SimSun]
 \definefontsynonym [MonoItalic] [file:SimSun]
 \definefontsynonym [MonoBoldItalic] [file:SimSun]
\stoptypescript

\definetypeface [myzhfont] [rm] [serif][myzhfont]   [default]
\definetypeface [myzhfont] [ss] [sans] [myzhfont]   [default]
\definetypeface [myzhfont] [tt] [mono] [myzhfont]   [default]

\def\a{\myzhfont}

\dorecurse{1}{{hello {\a 你好}}\par}

\bye


XeConTeXt uses 45.502 seconds, while XeLaTeX uses 3 seconds.

2009/5/12 Yue Wang yuleo...@gmail.com:
 here is the xelatex result given by a chinese user:

 \documentclass{minimal}
 \usepackage{xeCJK}
 \setCJKfamilyfont{song}{SimSun}
 \begin{document}
 {hello {\CJKfamily{song}你好}}\par % 1 lines
 \end{document}

 got 209 pages, three seconds to run.
 note he is switching  families 2 times. (\family{foo} in latex ==
 \switchbodyfont[foo] in context)

 On Tue, May 12, 2009 at 5:30 PM, Hans Hagen pra...@wxs.nl wrote:
 Yue Wang wrote:
 Hi,

 Sum up:
 define a font usng typescripts takes 64.797 seconds.
 define a font like \definefont[a][file:SimSun.ttf] takes 55.548 seconds
 define a font like \definefont[a][file:SimSun] takes 4.329 seconds
 define a font like \font\a=[simsun] takes 1.812 seconds

 Jonathan and Jin-Hwan, sorry for the noise. I am now sure that it is a
 context bug, not xetex's.

 and

 update: change the second example, remove the .otf suffix , and
 texexec --xtx gives:
 TeXExec | runtime: 5.766
 Obviously, this is a parsing bug in ConTeXt.

 context is not parsing for .otf or .ttf and has no reason for it either

 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
 ___


___
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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Hans Hagen
Yue Wang wrote:
 here is the xelatex result given by a chinese user:
 
 \documentclass{minimal}
 \usepackage{xeCJK}
 \setCJKfamilyfont{song}{SimSun}
 \begin{document}
 {hello {\CJKfamily{song}你好}}\par % 1 lines
 \end{document}
 
 got 209 pages, three seconds to run.
 note he is switching  families 2 times. (\family{foo} in latex ==
 \switchbodyfont[foo] in context)

hard to say ... it all depends on how a bodyfont (or typeface) is
defined, how many real fontsa re involved etc; normally, when using a
typeface definition a bodyfont switch is rather efficient as it only
involves one namespace switch + one font switch but when extensive math
definitions are also involved it might take a few more cycles

anyway .. i cannot comment on runtimes as xetex on my windows box runs
too slow (caching issue) and all examples are slow, no matter how i
specify fonts so i will not look into the code till that gets fixed first

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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Taco Hoekwater


Hans Hagen wrote:
 anyway .. i cannot comment on runtimes as xetex on my windows box runs
 too slow (caching issue) and all examples are slow, no matter how i
 specify fonts so i will not look into the code till that gets fixed first

The example with the typescript seems logical to me: a typescript does
much work beforehand, so I assume SimSum is loaded multiple times.

I am trying the AdobeSong example as we speak, there surely seems
something wrong there.

Best wishes,
Taco
___
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] The ultimate (?) float problem

2009-05-12 Thread Piotr Kopszak
Any chance lua might change something here in the future?

P.

2009/5/12 Hans Hagen pra...@wxs.nl:
 Piotr Kopszak wrote:

 Dear all,

 I am close to give up, but maybe there is a solution... I have a book
 to typeset literally peppered with hundreds of little drawings which
 are supposed to appear irregularly surrounded by text flowing around
 them on all sides.
 
 |xx |
 |x-xx|
 |x|     |xx |
 |x|__|xx|     ||
 |xx |__||
 |xx|
 

 I naively imagine that should not be that hard to implement ;) Since
 we already have overlays it's no problem to place images in arbitrary
 places. It only remains to drill white holes in the text to make room
 for them.  What about such procedure:

 1. While building the line TeX checks if there is any overlay ahead.
 2 if so, it puts empty hbox of the overlay width when it reaches
 necessary distance from the edge.
 3. and does so for the number of lines which equal overlay height.

 Of course that  leaves aside the problem of justification and without
 justification such page would probably look very ugly (I dare not to
 think if hz optimization, which I really got used to, would still
 work).
 Is there still hope I could stay with ConTeXt this time as well?

 one can have parshapes in tex but not that complex as you want

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




-- 
http://okle.pl
___
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] The ultimate (?) float problem

2009-05-12 Thread luigi scarso
On Tue, May 12, 2009 at 11:22 AM, Piotr Kopszak kops...@gmail.com wrote:

 Dear all,

 I am close to give up, but maybe there is a solution... I have a book
 to typeset literally peppered with hundreds of little drawings which
 are supposed to appear irregularly surrounded by text flowing around
 them on all sides.
 
 |xx |
 |x-xx|
 |x| |xx |
 |x|__|xx| ||
 |xx |__||
 |xx|
 

 I naively imagine that should not be that hard to implement ;) Since
 we already have overlays it's no problem to place images in arbitrary
 places. It only remains to drill white holes in the text to make room
 for them.  What about such procedure:

 1. While building the line TeX checks if there is any overlay ahead.
 2 if so, it puts empty hbox of the overlay width when it reaches
 necessary distance from the edge.
 3. and does so for the number of lines which equal overlay height.

 Of course that  leaves aside the problem of justification and without
 justification such page would probably look very ugly (I dare not to
 think if hz optimization, which I really got used to, would still
 work).
 Is there still hope I could stay with ConTeXt this time as well?

 Many thanks for any ideas in advance

can you post a little example ?
-- 
luigi
___
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] The ultimate (?) float problem

2009-05-12 Thread Hans Hagen

Piotr Kopszak wrote:

Any chance lua might change something here in the future?


maybe, but not in the near future

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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Wolfgang Schuster


Am 12.05.2009 um 11:09 schrieb Yue Wang:


Hi,

Sum up:
define a font usng typescripts takes 64.797 seconds.



You can speed it up when you replace \definetypeface (...) with  
\definefont:


\unprotect

\definefontsynonym [ZhSerif]   [name:AdobeSongStd-Light]
\definefont [ZhSerifRegular][ZhSerif]
\definefontsynonym [ZhSerifBold]   [name:AdobeHeitiStd-Regular] 
\definefont [ZhSerifBold]   [ZhSerifBold]
\definefontsynonym [ZhSerifItalic] [name:AdobeKaitiStd-Regular] 
\definefont [ZhSerifItalic] [ZhSerifItalic]
\definefontsynonym [ZhSerifBoldItalic] [name:AdobeHeitiStd-Regular] 
\definefont [ZhSerifBoldItalic] [ZhSerifBoldItalic]


\definefontsynonym [ZhSans][name:AdobeKaitiStd-Regular] 
\definefont [ZhSansRegular] [ZhSans]
\definefontsynonym [ZhSansBold][name:AdobeHeitiStd-Regular] 
\definefont [ZhSansBold][ZhSansBold]
\definefontsynonym [ZhSansItalic]  [name:AdobeKaitiStd-Regular] 
\definefont [ZhSansItalic]  [ZhSansItalic]
\definefontsynonym [ZhSansBoldItalic]  [name:AdobeHeitiStd-Regular] 
\definefont [ZhSansBoldItalic]  [ZhSansBoldItalic]


\definefontsynonym [ZhMono][name:AdobeFangsongStd-Regular]  
\definefont [ZhMonoRegular] [ZhMono]
\definefontsynonym [ZhMonoBold][name:AdobeHeitiStd-Regular] 
\definefont [ZhMonoBold][ZhMonoBold]
\definefontsynonym [ZhMonoItalic]  [name:AdobeFangsongStd-Regular]  
\definefont [ZhMonoItalic]  [ZhMonoItalic]
\definefontsynonym [ZhMonoBoldItalic]  [name:AdobeHeitiStd-Regular] 
\definefont [ZhMonoBoldItalic]  [ZhMonoBoldItalic]


\def\domyzhfont{\getvalue{Zh\fontstringA\fontstylesuffix}}

%\def\myzhfont{\groupedcommand{\pushcurrentfont\domyzhfont} 
{\popcurrentfont}}

\def\myzhfont{\domyzhfont}

\protect

\starttext

\rm\tf hello {\myzhfont 你好} world\par
\rm\it hello {\myzhfont 你好} world\par
\rm\bf hello {\myzhfont 你好} world\par
\rm\bi hello {\myzhfont 你好} world\par

\blank

\ss\tf hello {\myzhfont 你好} world\par
\ss\it hello {\myzhfont 你好} world\par
\ss\bf hello {\myzhfont 你好} world\par
\ss\bi hello {\myzhfont 你好} world\par

\blank

\tt\tf hello {\myzhfont 你好} world\par
\tt\it hello {\myzhfont 你好} world\par
\tt\bf hello {\myzhfont 你好} world\par
\tt\bi hello {\myzhfont 你好} world\par

\page

\dorecurse{1000}{\dorecurse{10}{ hello {\myzhfont 你好}}\par}

\stoptext

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
___


Re: [NTG-context] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Hans Hagen

 Taco Hoekwater wrote:


Hans Hagen wrote:

anyway .. i cannot comment on runtimes as xetex on my windows box runs
too slow (caching issue) and all examples are slow, no matter how i
specify fonts so i will not look into the code till that gets fixed first


The example with the typescript seems logical to me: a typescript does
much work beforehand, so I assume SimSum is loaded multiple times.

I am trying the AdobeSong example as we speak, there surely seems
something wrong there.


let's start with saying that I have no intention to optimize mkii for 
xetex as we decided some time ago (at the context meeting) that we would 
freeze mkii; so, if things run acceptable that's ok for me; we're also 
not going to optimize any further for pdftex any more unless i need it 
in a high performance project -)


when i delete my font.conf file (i.e. forget about names but only allow 
files) i can run xetex with reasonable performance


some timing:

% 64 sec xetex, 11 sec luatex (56 sec xetex when \nobigmath)

\setupbodyfont[myzhfont]

\dorecurse{1}{{hello {\switchtobodyfont[myzhfont] 你好}}\par}

% 67 sec xetex, 11.5 sec luatex

\dorecurse{1}{{hello {\switchtobodyfont[myzhfont] 你好}}\par}

% 5 sec xetex, 7 sec luatex

\setupbodyfont[myzhfont]  \dorecurse{1}{{hello {你好}}\par}

now, in practice one will not switch complete bodyfonts so often, so 
something like


\setupbodyfont[myzhfont]  \dorecurse{1}{{\bf hello {你好}}\par}

is more realistic (taks .5 sec more in xetex)

as taco mentioned, switchtobidyfont does way more than just switching a 
font like checking current state which involves checking fontclass, 
size, style etc and setting up font parameters for each case, as well as 
setting up math; fonts, when not yet set, will be loaded but that 
happens only once so that can be kind of neglected


the differences between mkii and mkiv have several reasons:

= mkiv has a more efficient font system as no encodings, mappings, one 
math family etc are involved and as such is much faster (less comma list 
processing, less checking, less mapping and encoding switches)


= in mkii there is a relationship between fonts, languages etc an dall 
need to be (re)synced since anything can have changed; i'm pretty sure 
that context does much more here than latex because we cater for mixed 
typefaces, mixed languages, encodings, etc and all combinations that can 
occur


= mkiv code has been optimized in the process so that might also count a 
bit (but not that much in real situations)


= mkiv can use traditional traditional fonts but does that in a special 
way by turning then into wide fonts which is also more efficient


now, since xetex runs on top of mkii it caries some overhead from 
traditional fonts


if we accept some limitations (i.e. stupify context mkii a bit) we can 
gain some speed (we can probably also load some less code then), for example


\def\updatefontparameters
  {\edef\@@fontfeatures{\truefontdata\fontfile\s!features}%
   \edef\@@fontskewchar{\truefontdata\fontfile\s!skewchar}}

\def\setfontcharacteristics
  {\updatefontparameters
   \the\everyfont}

\let\synchronizepatternswithfont\relax

saves 20 sec on the 10K (irrealistic anyway) run  but then we definitely 
need to make typescripts xetex specific and make sure that no encoded 
font files are used any longer


The question is ... does it pay off for me (as i have to do it in order 
to make sure we don't mess up things for pdftex) to spend time on this?


Probably not.

(Concerning timing: forget about comparing to latex as in practice much 
more is involved like page building etc. There are subsystems in context 
where i could squeeze out yet another .1 second just to see it become 
noise on real runs.)


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] XeConTeXt bug report II: MetaPost Graphics

2009-05-12 Thread Hans Hagen

Yue Wang wrote:

736 on current version


but that line already looks that way ... so what needs to be patched


-
  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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Yue Wang
Thank you, Taco.

currently I found one way to speed up font loading:

\synchronizemathfontsfalse
\let\synchronizetext\relax
\starttypescript[serif] [myzhfont]
 \definefontsynonym [Serif]   [file:SimSun]
\stoptypescript
\definetypeface [myzhfont] [rm] [serif][myzhfont]   [default]
\def\a{\myzhfont}
\dorecurse{1}{{hello {\a 你好}}\par}
\bye

TeXExec | runtime: 10.172
much faster, but still far slower than \definefont.

this reminds me another possible bug in ConTeXt:



Test1:

\definetypeface[iwona][ss][sans] [iwona] [default]
\definetypeface[iwona][mm][math] [iwona] [default][text=ss]
\setupbodyfont[iwona]
\starttext
foobar
\stoptext

runtime= 6.625. There is a 5 seconds pause after loading
(c:/context/tex/texmf-context/tex/context/base/spec-xet.tex)

But I don't know what xetex is loading.




Test 2:

\definetypeface[iwona][ss][sans] [iwona] [default]
%\definetypeface[iwona][mm][math] [iwona] [default][text=ss]
\setupbodyfont[iwona]
\starttext
foobar
\stoptext

I only comment the math defination line. now
runetime = 0.969




Test 3:

move the three lines to context.rme,
\definetypeface[iwona][ss][sans] [iwona] [default]
\definetypeface[iwona][mm][math] [iwona] [default][text=ss]
\setupbodyfont[iwona]
then rebuild the format.
note we also load the math font. but one thing is clear: Hans said
unlike plain TeX and LaTeX, font tfm is not dumped into ConTeXt
format.
However, at this time we compile
\starttext
foobar
\stoptext

runtime =0.875

I don't know the reason for this problem too
I think XeTeX load math tfms quite fast. (it should be even faster
than otf loading, but in xecontext, this is not true).


Yue Wang

On Tue, May 12, 2009 at 6:16 PM, Taco Hoekwater t...@elvenkind.com wrote:


 Hans Hagen wrote:
 anyway .. i cannot comment on runtimes as xetex on my windows box runs
 too slow (caching issue) and all examples are slow, no matter how i
 specify fonts so i will not look into the code till that gets fixed first

 The example with the typescript seems logical to me: a typescript does
 much work beforehand, so I assume SimSum is loaded multiple times.

 I am trying the AdobeSong example as we speak, there surely seems
 something wrong there.

 Best wishes,
 Taco
 ___
 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
 ___

___
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] XeConTeXt bug report II: MetaPost Graphics

2009-05-12 Thread Yue Wang
Hi, Hans

Prof. Cho asked you to comment the line after the {
i.e.:

- {\scratchdimen\wd#2\scratchdimen.5\scratchdimen\hskip-\the\scratchdimen
+{%

Yue Wang

On Tue, May 12, 2009 at 7:05 PM, Hans Hagen pra...@wxs.nl wrote:
 Yue Wang wrote:

 736 on current version

 but that line already looks that way ... so what needs to be patched


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

___
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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Taco Hoekwater

Hans Hagen wrote:

  Taco Hoekwater wrote:


Hans Hagen wrote:

anyway .. i cannot comment on runtimes as xetex on my windows box runs
too slow (caching issue) and all examples are slow, no matter how i
specify fonts so i will not look into the code till that gets fixed 
first


The example with the typescript seems logical to me: a typescript does
much work beforehand, so I assume SimSum is loaded multiple times.

I am trying the AdobeSong example as we speak, there surely seems
something wrong there.


let's start with saying that I have no intention to optimize mkii for 
xetex as we decided some time ago (at the context meeting) that we would 


For educational purposes: whether you have

  \definefont[a][file:AdobeSongLight-Std]
or
  \definefont[a][file:AdobeSongLight-Std.otf]

makes no difference to context at all.

The first makes \a expand into (simplified)

 \font\internala=[AdobeSongLight-Std] at 12pt\internala

the second into

 \font\internala=[AdobeSongLight-Std.otf] at 12pt\internala

but there are no other macro expansion changes at all. You can test
this yourself by making two alternative files an adding \loggingall
to them, then compare the two logs using diff.

As to the reason why one of the two is much slower than the other:
I do not know for sure, but I suspect that XeTeX does not cache
the (some of) the internals results of font file assignments with
explicit extensions. The speed difference is most certainly *not*
caused by anything the context macros do.

Best wishes,
Taco

PS As to why \definefont is itself slower than \font: it does not
actually define a font \a at a specific size. Instead it defines a
macro \a that defines and then selects a font with an internal,
temporary name, using the local font size etc.









___
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] The ultimate (?) float problem

2009-05-12 Thread Piotr Kopszak
Only to show better how I would like text and images placed on the page.

\definelayer  [figure][width=\overlaywidth,height=\overlayheight]
\defineoverlay[figure][{\directsetup{figure}\tightlayer[figure]}]
\setupcolors[state=start]
\setupbackgrounds[page][background=figure]


\starttext

\dorecurse{4}{\input knuth}

\startsetups figure
\setlayerframed[figure][x=.3\layerwidth,y=.2\layerheight]{\externalfigure[cow][width=3cm,height=4cm]}
\setlayerframed[figure][x=.55\layerwidth,y=.4\layerheight]{\externalfigure[cow][width=3cm]}
\setlayerframed[figure][x=.4\layerwidth,y=.6\layerheight]{\externalfigure[cow][width=2cm,height=4cm]}
\stopsetups

\stoptext


2009/5/12 luigi scarso luigi.sca...@gmail.com:


 On Tue, May 12, 2009 at 11:22 AM, Piotr Kopszak kops...@gmail.com wrote:

 Dear all,

 I am close to give up, but maybe there is a solution... I have a book
 to typeset literally peppered with hundreds of little drawings which
 are supposed to appear irregularly surrounded by text flowing around
 them on all sides.
 
 |xx |
 |x-xx|
 |x|     |xx |
 |x|__|xx|     ||
 |xx |__||
 |xx|
 

 I naively imagine that should not be that hard to implement ;) Since
 we already have overlays it's no problem to place images in arbitrary
 places. It only remains to drill white holes in the text to make room
 for them.  What about such procedure:

 1. While building the line TeX checks if there is any overlay ahead.
 2 if so, it puts empty hbox of the overlay width when it reaches
 necessary distance from the edge.
 3. and does so for the number of lines which equal overlay height.

 Of course that  leaves aside the problem of justification and without
 justification such page would probably look very ugly (I dare not to
 think if hz optimization, which I really got used to, would still
 work).
 Is there still hope I could stay with ConTeXt this time as well?

 Many thanks for any ideas in advance

 can you post a little example ?
 --
 luigi


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





-- 
http://okle.pl
___
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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Yue Wang
On Tue, May 12, 2009 at 7:26 PM, Taco Hoekwater t...@elvenkind.com wrote:
 Hans Hagen wrote:

   Taco Hoekwater wrote:

 Hans Hagen wrote:

 anyway .. i cannot comment on runtimes as xetex on my windows box runs
 too slow (caching issue) and all examples are slow, no matter how i
 specify fonts so i will not look into the code till that gets fixed
 first

 The example with the typescript seems logical to me: a typescript does
 much work beforehand, so I assume SimSum is loaded multiple times.

 I am trying the AdobeSong example as we speak, there surely seems
 something wrong there.

 let's start with saying that I have no intention to optimize mkii for
 xetex as we decided some time ago (at the context meeting) that we would

 For educational purposes: whether you have

  \definefont[a][file:AdobeSongLight-Std]
 or
  \definefont[a][file:AdobeSongLight-Std.otf]

 makes no difference to context at all.

 The first makes \a expand into (simplified)

  \font\internala=[AdobeSongLight-Std] at 12pt\internala

 the second into

  \font\internala=[AdobeSongLight-Std.otf] at 12pt\internala

 but there are no other macro expansion changes at all. You can test
 this yourself by making two alternative files an adding \loggingall
 to them, then compare the two logs using diff.

 As to the reason why one of the two is much slower than the other:
 I do not know for sure, but I suspect that XeTeX does not cache
 the (some of) the internals results of font file assignments with
 explicit extensions. The speed difference is most certainly *not*
 caused by anything the context macros do.


disagreed: you can test by yourself that

\font\a=[simsun]
\starttext
\dorecurse{1}{ hello {\a 你好}\par}
\stoptext

runtime: TeXExec | runtime: 2.922

\font\a=[simsun.ttf]
\starttext
\dorecurse{1}{ hello {\a 你好}\par}
\stoptext

runtime: TeXExec | runtime: 2.938




 Best wishes,
 Taco

 PS As to why \definefont is itself slower than \font: it does not
 actually define a font \a at a specific size. Instead it defines a
 macro \a that defines and then selects a font with an internal,
 temporary name, using the local font size etc.









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

___
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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Hans Hagen
Yue Wang wrote:
 Thank you, Taco.
 
 currently I found one way to speed up font loading:
 
 \synchronizemathfontsfalse
 \let\synchronizetext\relax
 \starttypescript[serif] [myzhfont]
  \definefontsynonym [Serif]   [file:SimSun]
 \stoptypescript
 \definetypeface [myzhfont] [rm] [serif][myzhfont]   [default]
 \def\a{\myzhfont}
 \dorecurse{1}{{hello {\a 你好}}\par}
 \bye

as wolfgang already pointed out, if you want fast fonts you should
define them directly using \definefont

if you disable bits and pieces of the setupbodyfont mechanism you will
eventually run into problems, for instance because \tfd etc are not
defined and your chapter titles etc will behave unexpected (sizes as
well as when mixed with math)

in a regular document you only set up the bodyfont once (not 1
times) and then use \bf, \sl, \itc etc which are pretty fast

 TeXExec | runtime: 10.172
 much faster, but still far slower than \definefont.
 
 this reminds me another possible bug in ConTeXt:

as mentioned ... we're no talking bugs here but 'features' and side
effects of them

 
 Test1:
 
 \definetypeface[iwona][ss][sans] [iwona] [default]
 \definetypeface[iwona][mm][math] [iwona] [default][text=ss]
 \setupbodyfont[iwona]
 \starttext
 foobar
 \stoptext
 
 runtime= 6.625. There is a 5 seconds pause after loading
 (c:/context/tex/texmf-context/tex/context/base/spec-xet.tex)
 
 But I don't know what xetex is loading.

fonts (like the sans and more noticeably math (6 families * 3 sizes = 18
fonts at least)

 Test 2:
 
 \definetypeface[iwona][ss][sans] [iwona] [default]
 %\definetypeface[iwona][mm][math] [iwona] [default][text=ss]
 \setupbodyfont[iwona]
 \starttext
 foobar
 \stoptext
 
 I only comment the math defination line. now
 runetime = 0.969

right .. and as context is supposed to do math (keep in mind that some
symbols come from math anyway) this is expected

 Test 3:
 
 move the three lines to context.rme,
 \definetypeface[iwona][ss][sans] [iwona] [default]
 \definetypeface[iwona][mm][math] [iwona] [default][text=ss]
 \setupbodyfont[iwona]
 then rebuild the format.
 note we also load the math font. but one thing is clear: Hans said
 unlike plain TeX and LaTeX, font tfm is not dumped into ConTeXt
 format.

well, in this case you probably *did* force them in format; the normal
default font (lm) is not in the format and loading is delayed

 However, at this time we compile
 \starttext
 foobar
 \stoptext
 
 runtime =0.875
 
 I don't know the reason for this problem too
 I think XeTeX load math tfms quite fast. (it should be even faster
 than otf loading, but in xecontext, this is not true).

more needs to be set up ... not only fonts, + some testing + ...

just do a \tracingall before setupbodyfont and you will see

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] XeConTeXt bug report II: MetaPost Graphics

2009-05-12 Thread Jin-Hwan Cho

Hi, Yue Wang,

Many years have passed since I wrote spec-dpx.tex for ConTeXt.

The file spec-dpx.tex included in texlive 2008 (the only one I have)
looks quite changed according to the progression of ConTeXt.

Anyway, your example worked when I change the 763th line of
spec-dpx.tex as follows:

{\scratchdimen\wd#2\scratchdimen.5\scratchdimen\hskip-\the\scratchdimen

==

{%

But, I do not know this modification of \setMPPDFobject does not affect
other cases. Could you check more examples?

Best regards, ChoF.

On May 12, 2009, at 2:00 PM, Yue Wang wrote:


Hi, Hans and Jin-Hwan:

Here is a simple ConTeXt metafun demo file:

\starttext
\setupcolors[state=start]
\startMPpage
 path p ; color c[] ;
 p := fullsquare scaled 4cm ;
 c[0] := transparent(1,.5,red) ;
 c[1] := transparent(1,.5,green) ;
 c[2] := transparent(1,.5,blue) ;
 for i = 0 upto 2 :
   fill p rotated (i*30) withcolor white ;
 endfor ;
 for i = 0 upto 2 :
   fill p rotated (i*30) withcolor c[i] ;
 endfor ;
 addbackground withcolor transparent(1,.5,cmyk(0,0,1,0)) ;
\stopMPpage
\stoptext

When process the file using luatex or pdftex, we can see a nice  
picture there.

However, when
1) using pdftex to produce the dvi, and convert the dvi using dvipdfmx
2) using xetex to produce the pdf using xdvipdfmx
the figure is placed at the wrong place. there will be a displacement
for all the metapost figures when xetex is used to produce the
graphics. I attach the wrong result in the mail.

So my question is :
- is this a bug in ConTeXt, or in (x)dvipdfmx. can the bug be fixed?

Thanks

Yue Wang
test-metafun.pdf


___
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] XeConTeXt bug report III: Wrong hyperlink

2009-05-12 Thread Jin-Hwan Cho

On May 12, 2009, at 2:00 PM, Yue Wang wrote:


Hi, Hans and Jin-Hwan:

When using ConTeXt to produce my documents, I found that all
hyperlinks are wrong. And here is a simple test.

The tex and pdf files are attached in the mail. The problem will  
happen when:
1) using pdftex to produce the dvi, and use dvipdfmx to convert the  
dvi to pdf.

2) using xetex to produce xdv, and xdvipdfmx that xdv to pdf.

Open the file in Acrobat Reader, Go to page three, and you can see a
hyperlink text Equation 1, it links to page 2. however, the equation
is in page1.

The section 1 or  page 4 should point to page 4, but it point to  
page 5 now.


So my question:
- As far as I know, dvipdfmx's ConTeXt support was written by
Jin-Hwan. and the hyperlink code is written by Hans. Surely at least
one of the two source code files has a cross-ref bug. But I don't know
which. Can the bug be fixed?


It's not a BUG in a strict sense.

The driver file spec-dpx.tex (included in texlive 2008) just give

\special{pdf:names /Dests (#1) [...@thispage \PDFpageviewwrd]}

in the 463th line for \doPDFdestination.

However, \PDFpageviewwrd is defined in the 1666th line of spec-fdf.tex.
Here, generated is /XYZ 0 0 0. PDF Reference 1.7 (p.582) says that

 /XYZ left top zoom displays the page designated by page, with the  
coordinates
 (left, top) positioned at the upper-left corner of the window and  
the contents of

 the page magnified by the factor zoom.

So /XYZ 0 0 0 means that the coordinates (0,0) of the page will be  
positioned at
the upper-left corner of the window. But what is (0,0)? It is not the  
upper-left corner
of the page, but the lower-left corner of the page. Therefore, it  
looks the next page

is displayed.

Hans already gave a comment at the 1656th line of spec-fdf.tex as

 \def\PDFpagexyzspec{0 0 0} % hack, pdftex does handle this

I think that the value of the paperheight is better than 0 for top  
value.


Best regards, ChoF.

___
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] The ultimate (?) float problem

2009-05-12 Thread luigi scarso
On Tue, May 12, 2009 at 1:28 PM, Piotr Kopszak kops...@gmail.com wrote:

 Only to show better how I would like text and images placed on the page.

 \definelayer  [figure][width=\overlaywidth,height=\overlayheight]
 \defineoverlay[figure][{\directsetup{figure}\tightlayer[figure]}]
 \setupcolors[state=start]
 \setupbackgrounds[page][background=figure]


 \starttext

 \dorecurse{4}{\input knuth}

 \startsetups figure

 \setlayerframed[figure][x=.3\layerwidth,y=.2\layerheight]{\externalfigure[cow][width=3cm,height=4cm]}

 \setlayerframed[figure][x=.55\layerwidth,y=.4\layerheight]{\externalfigure[cow][width=3cm]}

 \setlayerframed[figure][x=.4\layerwidth,y=.6\layerheight]{\externalfigure[cow][width=2cm,height=4cm]}
 \stopsetups

 \stoptext

hmm
what about columnsets ?
http://wiki.contextgarden.net/Columns#Column_Sets

-- 
luigi
___
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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Taco Hoekwater


Yue Wang wrote:
 
 \font\a=[simsun]
 \starttext
 \dorecurse{1}{ hello {\a 你好}\par}
 \stoptext
 
 runtime: TeXExec | runtime: 2.922
 
 \font\a=[simsun.ttf]
 \starttext
 \dorecurse{1}{ hello {\a 你好}\par}
 \stoptext
 
 runtime: TeXExec | runtime: 2.938

Please try an otf font and/or actually compare the log files,
as I said.

Best wishes,
Taco

___
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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Hans Hagen
Taco Hoekwater wrote:
 
 Yue Wang wrote:
 \font\a=[simsun]
 \starttext
 \dorecurse{1}{ hello {\a 你好}\par}
 \stoptext

 runtime: TeXExec | runtime: 2.922

 \font\a=[simsun.ttf]
 \starttext
 \dorecurse{1}{ hello {\a 你好}\par}
 \stoptext

 runtime: TeXExec | runtime: 2.938
 
 Please try an otf font and/or actually compare the log files,
 as I said.

also, make sure that the *same* font is used as on my machine there is
no ttf but a simsun.ttc file so it can well be that th efirst call loads
a different font than the suffix call

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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Yue Wang
Hi,

 \font\a=[AdobeSongStd-Light.otf]
 \starttext
 \dorecurse{1}{ hello {\a 你好}\par}
 \stoptext
runtime = 3.25

 \font\a=[AdobeSongStd-Light]
 \starttext
 \dorecurse{1}{ hello {\a 你好}\par}
 \stoptext
runtime=3.234

Yue Wang

2009/5/12 Taco Hoekwater t...@elvenkind.com:


 Yue Wang wrote:

 \font\a=[simsun]
 \starttext
 \dorecurse{1}{ hello {\a 你好}\par}
 \stoptext

 runtime: TeXExec | runtime: 2.922

 \font\a=[simsun.ttf]
 \starttext
 \dorecurse{1}{ hello {\a 你好}\par}
 \stoptext

 runtime: TeXExec | runtime: 2.938

 Please try an otf font and/or actually compare the log files,
 as I said.

 Best wishes,
 Taco

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

___
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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Hans Hagen
Yue Wang wrote:

 \font\a=[simsun]
 \starttext
 \dorecurse{1}{ hello {\a 你好}\par}
 \stoptext

 runtime: TeXExec | runtime: 2.922

 \font\a=[simsun.ttf]
 \starttext
 \dorecurse{1}{ hello {\a 你好}\par}
 \stoptext

as taco already mentioned there's a problem with xetex caching fonts

in a traditional tex engine (pdftex, xetex) one can say

\font\xxx=blabla

many times but blabla is loaded only once; however, it looks like in the
following case

\font\xxx=blabla.suffix

no caching takes place and as a result you load the font 1 times
(can be seen when you enable a file tracer)

however, memory consumption does grow only in small steps so some
caching takes place (maybe only new id's)

if you define a font grouped {\a ...} the font gets defined each time
(as context has delayed font loading and supports local redefinitions
which is quite handy when using SymbolicNames for fonts) and normally
xetex's internal caching should make that efficient

i would not be surprised if the (forced) name-lookup problems are kind
of related to this

so ... this suffix problem is not related to context at all

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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Taco Hoekwater


Yue Wang wrote:
 
  \font\a=[AdobeSongStd-Light]

Why? I asked to use \definefont.


___
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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Yue Wang
2009/5/12 Hans Hagen pra...@wxs.nl:
 Yue Wang wrote:
 Thank you, Taco.

 currently I found one way to speed up font loading:

 \synchronizemathfontsfalse
 \let\synchronizetext\relax
 \starttypescript[serif] [myzhfont]
  \definefontsynonym [Serif]   [file:SimSun]
 \stoptypescript
 \definetypeface [myzhfont] [rm] [serif][myzhfont]   [default]
 \def\a{\myzhfont}
 \dorecurse{1}{{hello {\a 你好}}\par}
 \bye

 as wolfgang already pointed out, if you want fast fonts you should
 define them directly using \definefont


I have no speed gain while testing his example.


 if you disable bits and pieces of the setupbodyfont mechanism you will
 eventually run into problems, for instance because \tfd etc are not
 defined and your chapter titles etc will behave unexpected (sizes as
 well as when mixed with math)


You are right.

 in a regular document you only set up the bodyfont once (not 1
 times) and then use \bf, \sl, \itc etc which are pretty fast


for multilingual typesetting this is different.
different fonts will be used for full-width punctuations,
cjk-characters (maybe also splict to ruby, kanji, hangul and hanzi),
cjk-exta, cjk-extb, and latin. for a not-so-long document (100 pages),
switching more than 100times/page is ordinary case.
Especially for educational documents (For example, English text book
for Chinese students)


 TeXExec | runtime: 10.172
 much faster, but still far slower than \definefont.

 this reminds me another possible bug in ConTeXt:

 as mentioned ... we're no talking bugs here but 'features' and side
 effects of them

ok. this is a feature that I don't like so much...



 Test1:

 \definetypeface[iwona][ss][sans] [iwona] [default]
 \definetypeface[iwona][mm][math] [iwona] [default][text=ss]
 \setupbodyfont[iwona]
 \starttext
 foobar
 \stoptext

 runtime= 6.625. There is a 5 seconds pause after loading
 (c:/context/tex/texmf-context/tex/context/base/spec-xet.tex)

 But I don't know what xetex is loading.

 fonts (like the sans and more noticeably math (6 families * 3 sizes = 18
 fonts at least)


but it's pretty fast on mac (only 1 second delay) on the same machine.
[mac do not use fontconfig for searching system fonts]
Strange uh? Well, I call it Windows features:)

moreover, can you tell me why pdftex load these fonts so fast? (also 6
families * 3 sizes)

 Test 2:

 \definetypeface[iwona][ss][sans] [iwona] [default]
 %\definetypeface[iwona][mm][math] [iwona] [default][text=ss]
 \setupbodyfont[iwona]
 \starttext
 foobar
 \stoptext

 I only comment the math defination line. now
 runetime = 0.969

 right .. and as context is supposed to do math (keep in mind that some
 symbols come from math anyway) this is expected


ok.

 Test 3:

 move the three lines to context.rme,
 \definetypeface[iwona][ss][sans] [iwona] [default]
 \definetypeface[iwona][mm][math] [iwona] [default][text=ss]
 \setupbodyfont[iwona]
 then rebuild the format.
 note we also load the math font. but one thing is clear: Hans said
 unlike plain TeX and LaTeX, font tfm is not dumped into ConTeXt
 format.

 well, in this case you probably *did* force them in format; the normal
 default font (lm) is not in the format and loading is delayed


no. I did exactly the same as the default settings do.
you also use :
\setupencoding[default=ec]
\usetypescript[fallback][\defaultencoding] \setupbodyfont[rm,12pt]
in cont-en.tex. also in context.tex:
\setupencoding[default=ec]
\usetypescript[fallback][\defaultencoding]
\setupbodyfont[rm,12pt]

So I am not forcing them into the format. actually the loading of
iwona is delayed to runtime.


 However, at this time we compile
 \starttext
 foobar
 \stoptext

 runtime =0.875

 I don't know the reason for this problem too
 I think XeTeX load math tfms quite fast. (it should be even faster
 than otf loading, but in xecontext, this is not true).

 more needs to be set up ... not only fonts, + some testing + ...

 just do a \tracingall before setupbodyfont and you will see

 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
 ___

___
If your question is of interest to 

Re: [NTG-context] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Yue Wang
Hi,


On Tue, May 12, 2009 at 8:26 PM, Taco Hoekwater t...@elvenkind.com wrote:


 Yue Wang wrote:

  \font\a=[AdobeSongStd-Light]

 Why? I asked to use \definefont.

After reading Hans' explanation, I understand what you said now.
\dorecurse{1}{ hello {\font\a=[AdobeSongStd-Light]\a 你好}\par}
is fast while
\dorecurse{1}{ hello {\font\a=[AdobeSongStd-Light.otf]\a 你好}\par}
is slow

Thank you. Will report that to Jonathan Kew.


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
 ___

___
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] XeConTeXt bug report III: Wrong hyperlink

2009-05-12 Thread Hans Hagen

Jin-Hwan Cho wrote:



I think that the value of the paperheight is better than 0 for top value.


thanks for figuring it out ... i now just fall back to fit

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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Hans Hagen
Yue Wang wrote:


 moreover, can you tell me why pdftex load these fonts so fast? (also 6
 families * 3 sizes)

i don't know; as the same code is used so it must be xetex itself then


-
  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] The ultimate (?) float problem

2009-05-12 Thread Piotr Kopszak
But I want text in one column in the whole document. I was wondering
however if I could mimick something similar with textflows but cannot
understand the Dutch example in page-flw.tex.

Piotr

2009/5/12 luigi scarso luigi.sca...@gmail.com:


 On Tue, May 12, 2009 at 1:28 PM, Piotr Kopszak kops...@gmail.com wrote:

 Only to show better how I would like text and images placed on the page.

 \definelayer  [figure][width=\overlaywidth,height=\overlayheight]
 \defineoverlay[figure][{\directsetup{figure}\tightlayer[figure]}]
 \setupcolors[state=start]
 \setupbackgrounds[page][background=figure]


 \starttext

 \dorecurse{4}{\input knuth}

 \startsetups figure

 \setlayerframed[figure][x=.3\layerwidth,y=.2\layerheight]{\externalfigure[cow][width=3cm,height=4cm]}

 \setlayerframed[figure][x=.55\layerwidth,y=.4\layerheight]{\externalfigure[cow][width=3cm]}

 \setlayerframed[figure][x=.4\layerwidth,y=.6\layerheight]{\externalfigure[cow][width=2cm,height=4cm]}
 \stopsetups

 \stoptext

 hmm
 what about columnsets ?
 http://wiki.contextgarden.net/Columns#Column_Sets

 --
 luigi


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





-- 
http://okle.pl
___
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] The ultimate (?) float problem

2009-05-12 Thread luigi scarso
On Tue, May 12, 2009 at 3:03 PM, Piotr Kopszak kops...@gmail.com wrote:

 But I want text in one column in the whole document. I was wondering
 however if I could mimick something similar with textflows but cannot
 understand the Dutch example in page-flw.tex.


Do you mean this ?

% Example (dutch)
%
% \stelpapierformaatin [S6]
% \steltolerantiein[soepel,rek]
% \stelkleurenin   [status=start]
% \stelvoetin  [strut=nee]
% \stelwitruimtein [groot]
%
% \stellayoutin
%   [rechterrand=5cm,breedte=passend,marge=0pt,randafstand=1cm,
%voet=4cm,voetafstand=1cm,hoofd=0cm]
%
% \stelteksttekstenin[rand][][\vbox{\flushtextflow{alpha}}]
% \stelvoettekstenin [rand][][\vbox{\flushtextflow{beta}}]
% \stelvoettekstenin [\vbox{\flushtextflow{gamma}}][]
%
% \definetextflow [alfa]  [breedte=\rechterrandbreedte]
% \definetextflow [beta]  [breedte=\rechterrandbreedte]
% \definetextflow [gamma] [breedte=\voethoogte]
%
% \starttekst
%
% \dorecurse{50}
%   {\getrandomnumber{\funny}{0}{8}
%\ifcase\funny \starttextflow[alfa]  \input tufte.tex   \stoptextflow
%\or   \starttextflow[beta]  \input knuth.tex   \stoptextflow
%\or   \starttextflow[gamma] \input materie.tex \stoptextflow
%\or  {\bf   TUFTE}\quad \input tufte   \par
%\or  {\bf   TUFTE}\quad \input tufte   \par
%\or  {\bf   KNUTH}\quad \input knuth   \par
%\or  {\bf   KNUTH}\quad \input knuth   \par
%\or  {\bf MATERIE}\quad \input materie \par
%\else{\bf MATERIE}\quad \input materie \par
%\fi}
%
% \stoptekst



-- 
luigi
___
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] The ultimate (?) float problem

2009-05-12 Thread Piotr Kopszak
Yes, exactly.

2009/5/12 luigi scarso luigi.sca...@gmail.com:


 On Tue, May 12, 2009 at 3:03 PM, Piotr Kopszak kops...@gmail.com wrote:

 But I want text in one column in the whole document. I was wondering
 however if I could mimick something similar with textflows but cannot
 understand the Dutch example in page-flw.tex.


 Do you mean this ?

 % Example (dutch)
 %
 % \stelpapierformaatin [S6]
 % \steltolerantiein    [soepel,rek]
 % \stelkleurenin   [status=start]
 % \stelvoetin  [strut=nee]
 % \stelwitruimtein [groot]
 %
 % \stellayoutin
 %   [rechterrand=5cm,breedte=passend,marge=0pt,randafstand=1cm,
 %    voet=4cm,voetafstand=1cm,hoofd=0cm]
 %
 % \stelteksttekstenin[rand][][\vbox{\flushtextflow{alpha}}]
 % \stelvoettekstenin [rand][][\vbox{\flushtextflow{beta}}]
 % \stelvoettekstenin [\vbox{\flushtextflow{gamma}}][]
 %
 % \definetextflow [alfa]  [breedte=\rechterrandbreedte]
 % \definetextflow [beta]  [breedte=\rechterrandbreedte]
 % \definetextflow [gamma] [breedte=\voethoogte]
 %
 % \starttekst
 %
 % \dorecurse{50}
 %   {\getrandomnumber{\funny}{0}{8}
 %    \ifcase\funny \starttextflow[alfa]  \input tufte.tex   \stoptextflow
 %    \or   \starttextflow[beta]  \input knuth.tex   \stoptextflow
 %    \or   \starttextflow[gamma] \input materie.tex \stoptextflow
 %    \or  {\bf   TUFTE}\quad \input tufte   \par
 %    \or  {\bf   TUFTE}\quad \input tufte   \par
 %    \or  {\bf   KNUTH}\quad \input knuth   \par
 %    \or  {\bf   KNUTH}\quad \input knuth   \par
 %    \or  {\bf MATERIE}\quad \input materie \par
 %    \else    {\bf MATERIE}\quad \input materie \par
 %    \fi}
 %
 % \stoptekst



 --
 luigi


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





-- 
http://okle.pl
___
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] enco-xtx.tex is still wrong

2009-05-12 Thread Yue Wang
On Tue, May 12, 2009 at 5:27 PM, Hans Hagen pra...@wxs.nl wrote:
 Mojca Miklavec wrote:

 wrong:
   f:write(format(\\XeTeXcharclass\%04X
 \\XeTeXcharclass%s\n,i,upper(lbc)))
 better:
   f:write(format(\\XeTeXcharclass\%04X
 \\XeTeXcharclass%s\n,code,upper(lbc)))

 But I didn't test anything at all.

 ok, i'll fix that




Hi

The current version is still not right.
in unicode-letters.tex, three ranges are defined to id:

\ID 3400 4DB5
\ID 4E00 9FC3
\ID 2 2A6D6

So in fact all the codes from 3400-4DB5, 4E00-9FC3, 2-2A6D6 are
assigned to \ID.

these ranges are missing in xetx-cls.tex:

...
\setXTXcharacterclass 3400 lb:id
\setXTXcharacterclass 4DB5 lb:id
...
\setXTXcharacterclass 4E00 lb:id
\setXTXcharacterclass 9FBB lb:id
...
\setXTXcharacterclass 2 lb:id
\setXTXcharacterclass 2A6D6 lb:id
...

so in xetx.cls, the boundaries are roughly there, but all the numbers
in the range are missing.


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


[NTG-context] [***SPAM***] Bug? \getmarking fails under some circumstances

2009-05-12 Thread Oliver Heins
Hello,

I'm new to ConTeXt, so this is perhaps not a bug but a fault on my side.

Under some circumstances, the living column heads fail to refer to the
subsubject.  As you can see from the attached minimal example

\startsetups[header]
  \getmarking[subject]\ $\cdot$ \getmarking[subsubject]
\stopsetups

will yield something like »Mikrotypografie *«, though it should be
»Mikrotypografie * Absatzumbruch«.

If you uncomment the \subsubject-line at the end of the example,
everything works as expected unless you uncomment the former line, too.

A workaround is to add a \vfill\eject just before the next \subject.

Best regards,
 olli


You probably can ignore the environments used in the minimal example, they
are copied from the document from which I ran into the problem and are
just dummy text.  I hope I have stripped down the preamble to an
acceptable amount of lines.

---

% interface=en output=pdftex

\usetypescript[fourier][ec]
\setupbodyfont[fourier,12pt]

\setuppapersize
  [A4][A4]

\usemodule[layout]
\chardef\charwidthmethod=3
\def\charwidthlanguage{\currentmainlanguage}
\setuplayout
  [width=70\averagecharwidth,
  height=middle,
  grid=yes]

\startsetups[header]
  \hfill
  \getmarking[subject]\ $\cdot$ \getmarking[subsubject]
  \hfill
\stopsetups

\setupheadertexts[\setups{header}]

\setuphead
  [title]
  [before=\hairline,
   after=\blank\leftline{\tfa Ein
   Beispieldokument}\blank\leftline{\tfa Oliver Heins
 \ss$\langle$\from[email]$\rangle$}
 \bigskip\hairline]

\definehead[subject][section]
\setuphead[subject][number=no]
\definehead[subsubject][subsection]
\setuphead[subsubject][number=no]

\setuphead
  [subject]
  [style=\tfb]


% Text

\starttext


\startlinecorrection
\title{Mikrotypografie und Interaktivität}
\stoplinecorrection

\setupindenting[medium, yes]
\setupwhitespace[none]

\vskip-\baselineskip

\subject{Mikrotypografie}

Besonderes Augenmerk legt scriptorium adp auf die typografische
Qualität der erzeugten Dokumente.  Die von uns verwendeten
Textsatzsysteme aus der Programmfamilie \TeX{} ermöglichen einen
besonders hochwertigen Satz.

\subsubject{Mathematiksatz}

Der Mathematiksatz von \TeX{} ist legendär.  Kein Wunder, wurde \TeX{}
doch vom amerikanischen Informatikprofessor und Turing-Preisträger
Donald Knuth entwickelt, der mit der immer schlechter werdenden
Qualität seiner Buchreihe \quotation{The Art of Computer Programming}
unzufrieden war, seit von Hand- auf Fotosatz umgestellt worden war.

Von 1977 bis 1986 entwickelte Knuth \TeX{}: {\en\quotation{Ever since
those beginnings in 1977, the TeX research project that I embarked
on was driven by two major goals.  The first goal was quality: we
wanted to produce documents that were not just nice, but actually
the best. {\dots} The second major goal was archival: to create
systems that would be independent of changes in printing
technology as much as possible.  When the next generation of
printing devices came along, I wanted to be able to retain the
same quality already achieved, instead of having to solve all the
problems anew.  I wanted to design something that would be still
usable in 100 years.}}\footnote{Donald E. Knuth, {\it Digital
typography.} Stanford, Calif.: CSLI Publications, 1999, S.~559.}

\TeX{} stellt im engeren Sinn lediglich eine Programmiersprache
bereit, mit der sich Textsatzsysteme entwickeln lassen. Knuth
entwickelte ein erstes mit dem sogenannten plain-\TeX-Format, weitere
wie {\LaTeX} oder {\ConTeXt} folgten.  scriptorium adp setzt die
beiden letztgenannten Formate ein.

Hier ein Beispiel für den Mathematiksatz von \TeX{}:

\startlinecorrection
\vskip-.5\baselineskip
\placeformula
\startformula
  \startmathalignment[m=2,distance=2em]%Notice distance=2em
   \NC \nabla\cdot \bf E \NC= \frac{\rho}{\varepsilon_0},
   \NC \nabla\times \bf E \NC= -\frac{\partial \bf B}{\partial t}, \NR[+]
   \NC \nabla\cdot \bf B \NC= 0,
   \NC \nabla\times \bf B \NC= \mu_0{\bf j}+\varepsilon_0\mu_0
   \frac{\partial \bf E}{\partial t}. \NR[+]
 \stopmathalignment
\stopformula
\vskip-.5\baselineskip
\stoplinecorrection


Auch im Fließtext ist Mathematik problemlos möglich.

\startlinecorrection
\placeformula
\startformula
  f(x) =
  \startmathcases[style=\displaystyle]
\NC \int_0^x g(y)\,dy,\NC if $x \ge 0$; \NR
\NC \int_{-x}^0 g(y)\,dy, \NC otherwise.\NR
  \stopmathcases
\stopformula
\stoplinecorrection


\subsubject{Absatzumbruch}

Hervorzuheben ist insbesondere der absatzbasierte {\it
  Total|-|Fit}|-|Umbruchalgorithmus: nach einem raffinierten
Optimierungsverfahren werden alle möglichen Zeilenumbrüche (inklusive
Worttrennung) im Absatz gleichzeitig bestimmt und bewertet.  Der
Umbruch, der den besten optischen Gesamteindruck verspricht, wird dann
vom System benutzt.  Im Vergleich mit dem verbreiteten {\it
  First|-|Fit}|-|Algorithmus, der die Zeilenumbrüche Zeile für Zeile

[NTG-context] ppchtex color

2009-05-12 Thread Alan BRASLAU
No, ppchtex is not dead...

I would like to use color.

1. color= and rulecolor= does not appear to be implemented (mkiv)...
2. how can one change the color of the bonds?
3. using \color[red]{} causes the text to be offset.

minimal example:

\setupcolors[state=start]
\usemodule[chemic]
\starttext

\startchemical
\chemical[ONE,SB,Z0][C]
\stopchemical

\startchemical
\color[red]{\chemical[ONE,SB,Z0][C]}
\stopchemical
% text C is offset...

\startchemical
\chemical[ONE,SB,Z0][{\red C}]
\stopchemical
% OK, but I would like to draw the bonds as well in red.

\startchemical[color=red]
\chemical[ONE,SB,Z0][C]
\stopchemical
% C is red in mkii, black in mkiv

\startchemical[rulecolor=red]
\chemical[ONE,SB,Z0][C]
\stopchemical
% bonds are black, C is red in mkii, black in mkiv

\stoptext

___
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] The ultimate (?) float problem

2009-05-12 Thread Wolfgang Schuster


Am 12.05.2009 um 15:18 schrieb Piotr Kopszak:


Yes, exactly.


\setuppapersize [S6]
\setuptolerance [soepel,rek]
\setupcolors[state=start]
\setupfooter[strut=no]
\setupwhitespace[big]

\setuplayout
  [rightmargin=5cm,
   width=fit,
   margin=0pt,
   edgedistance=1cm,
   footer=4cm,
   footerdistance=1cm,
   header=0cm]

\setuptexttexts  [margin][][\vbox{\flushtextflow{alpha}}]
\setupfootertexts[margin][][\vbox{\flushtextflow{beta}}]
\setupfootertexts[\vbox{\flushtextflow{gamma}}][]

\definetextflow [alfa]  [width=\rightmarginwidth]
\definetextflow [beta]  [width=\rightmarginwidth]
\definetextflow [gamma] [width=\footerheight]

\starttext

\dorecurse{50}
  {\getrandomnumber{\funny}{0}{8}
   \ifcase\funny \starttextflow[alfa]  \input tufte.tex   \stoptextflow
   \or   \starttextflow[beta]  \input knuth.tex   \stoptextflow
   \or   \starttextflow[gamma] \input materie.tex \stoptextflow
   \or  {\bf   TUFTE}\quad \input tufte   \par
   \or  {\bf   TUFTE}\quad \input tufte   \par
   \or  {\bf   KNUTH}\quad \input knuth   \par
   \or  {\bf   KNUTH}\quad \input knuth   \par
   \or  {\bf MATERIE}\quad \input materie \par
   \else{\bf MATERIE}\quad \input materie \par
   \fi}

\stoptext

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
___


Re: [NTG-context] The ultimate (?) float problem

2009-05-12 Thread Piotr Kopszak
Right. If I understand correctly on the first look textflows appear
in fixed locations on consecutive pages. I guess I'm banging my head
against a wall but what about if it was possible to have them side by
side on the same page?



2009/5/12 Wolfgang Schuster schuster.wolfg...@googlemail.com:

 Am 12.05.2009 um 15:18 schrieb Piotr Kopszak:

 Yes, exactly.

 \setuppapersize [S6]
 \setuptolerance [soepel,rek]
 \setupcolors    [state=start]
 \setupfooter    [strut=no]
 \setupwhitespace[big]

 \setuplayout
  [rightmargin=5cm,
   width=fit,
   margin=0pt,
   edgedistance=1cm,
   footer=4cm,
   footerdistance=1cm,
   header=0cm]

 \setuptexttexts  [margin][][\vbox{\flushtextflow{alpha}}]
 \setupfootertexts[margin][][\vbox{\flushtextflow{beta}}]
 \setupfootertexts        [\vbox{\flushtextflow{gamma}}][]

 \definetextflow [alfa]  [width=\rightmarginwidth]
 \definetextflow [beta]  [width=\rightmarginwidth]
 \definetextflow [gamma] [width=\footerheight]

 \starttext

 \dorecurse{50}
  {\getrandomnumber{\funny}{0}{8}
   \ifcase\funny \starttextflow[alfa]  \input tufte.tex   \stoptextflow
   \or           \starttextflow[beta]  \input knuth.tex   \stoptextflow
   \or           \starttextflow[gamma] \input materie.tex \stoptextflow
   \or          {\bf   TUFTE}\quad \input tufte   \par
   \or          {\bf   TUFTE}\quad \input tufte   \par
   \or          {\bf   KNUTH}\quad \input knuth   \par
   \or          {\bf   KNUTH}\quad \input knuth   \par
   \or          {\bf MATERIE}\quad \input materie \par
   \else        {\bf MATERIE}\quad \input materie \par
   \fi}

 \stoptext

 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
 ___




-- 
http://okle.pl
___
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] What is equivalent of latex math aligned in ConTeXt?

2009-05-12 Thread Xan

En/na Olivier ha escrit:

Hi Xan,

  

For example, what is the equivalent of:

\begin{equation*}
\left.\begin{aligned}
 2^2 | n_0\\
 4^2 | n_0 + 2 \Rightarrow (2^2)^2 | n_0 +2 \Rightarrow 2^2 | n_0 +2  
\text{ ya que } 2^2 | (2^2)^2

\end{aligned}\right\} \Rightarrow 2^2 | (n_0 + 2 - n_0) \Rightarrow 2^2 | 2
\end{equation*}

in ConTeXt?



Maybe for simple alignments the following is good enough?

\startformula
\left.\eqalign{
 2^2 | n_0\cr
 4^2 | n_0 + 2 \Rightarrow (2^2)^2 | n_0 +2 \Rightarrow 2^2 | n_0 +2  
\text{ ya que } 2^2 | (2^2)^2

}\right\} \Rightarrow 2^2 | (n_0 + 2 - n_0) \Rightarrow 2^2 | 2
\stopformula

Olivier
  

Thanks Aditya and Olivier.
I will try something more difficult with these commands.

Xan.
___
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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Yue Wang
On Tue, May 12, 2009 at 8:54 PM, Hans Hagen pra...@wxs.nl wrote:
 Yue Wang wrote:


 moreover, can you tell me why pdftex load these fonts so fast? (also 6
 families * 3 sizes)

 i don't know; as the same code is used so it must be xetex itself then

Then let me tell you why: ConTeXt tries to load lmmono10-regular at
least 6 times, failed after two testing, then succeed in the end.
However, try to testing whether a loaded font is \nullfont or not is
quite slow in XeTeX (Jonathan already mentioned that in
\testFontIsAvailable). we should definately avoid that.
But why pdftex is so fast? because it does not involve font testing.

So why XeTeX is spending 6 seconds aimlessly? since ConTeXt asked it
to search for a non-existed font.

Yue Wang






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

___
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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Yue Wang
Hi, Hans:

here is the solution to your great feature:

change
 \def\defaultfontfile{lmmono10-regular}
in font-ini.mkii to
\def\defaultfontfile{[lmmono10-regular]}
to disable that feature.

Yue Wang

On Tue, May 12, 2009 at 9:59 PM, Yue Wang yuleo...@gmail.com wrote:
 On Tue, May 12, 2009 at 8:54 PM, Hans Hagen pra...@wxs.nl wrote:
 Yue Wang wrote:


 moreover, can you tell me why pdftex load these fonts so fast? (also 6
 families * 3 sizes)

 i don't know; as the same code is used so it must be xetex itself then

 Then let me tell you why: ConTeXt tries to load lmmono10-regular at
 least 6 times, failed after two testing, then succeed in the end.
 However, try to testing whether a loaded font is \nullfont or not is
 quite slow in XeTeX (Jonathan already mentioned that in
 \testFontIsAvailable). we should definately avoid that.
 But why pdftex is so fast? because it does not involve font testing.

 So why XeTeX is spending 6 seconds aimlessly? since ConTeXt asked it
 to search for a non-existed font.

 Yue Wang






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


___
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] Metapost question

2009-05-12 Thread Jean Magnan de Bornier
Le 12 mai à 09:42:29 Taco Hoekwater t...@elvenkind.com écrit notamment:

| Jean Magnan de Bornier wrote:
|  Le 11 mai à 20:02:36 Mojca Miklavec mojca.miklavec.li...@gmail.com écrit 
notamment:
|  
|  |  | Which command does that evil? They both seem to work here ...
|  | 
|  |  mpost, texexec --mpgraphic, mpost -mem=metafun.mem, all three of them!
|  | I don't understand. Can you please post the whole log. You cannot get
|  | metafun warnings when running just mpost unless something is set up
|  | in some really weird way. I could imagine that there could be some
|  | infinite loop in some metafun macro, but I cannot imagine why mpost
|  | would fall into infinite loop.
|  
|  I have stopped compilation after no more than 30 seconds, the log is 14MB
|  large with many lines:

| It looks like you should also post ecindf.mp so we can try for
| ourselves (or did I miss that?).

OK, here's a test file that works as expected:

...
numeric u; u=.5cm;
path AX; AX = drawdblarrow (10u,0) -- (0,0) -- (0,10u);
beginfig(1); 



  draw AX;
  label.lft(btex Coûts, prix etex rotated 90, (-.2u,8u));
 label.bot(btex Quantités  etex, (8u,0));
 for i=0 step u until 9u:
 draw (i,u/20)--(i,0);
 draw (u/20,i)--(0,i);
 endfor;
 picture ax; ax := currentpicture;
endfig;


No need for metafun here, but for other pictures I use it; and if I add
« input metafun;» at the top I get the unending message! 
-- 
Jean
___
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] Metapost question

2009-05-12 Thread Aditya Mahajan

On Tue, 12 May 2009, Jean Magnan de Bornier wrote:


Le 12 mai à 09:42:29 Taco Hoekwater t...@elvenkind.com écrit notamment:

| Jean Magnan de Bornier wrote:
|  Le 11 mai à 20:02:36 Mojca Miklavec mojca.miklavec.li...@gmail.com écrit 
notamment:
|  
|  |  | Which command does that evil? They both seem to work here ...

|  | 
|  |  mpost, texexec --mpgraphic, mpost -mem=metafun.mem, all three of them!
|  | I don't understand. Can you please post the whole log. You cannot get
|  | metafun warnings when running just mpost unless something is set up
|  | in some really weird way. I could imagine that there could be some
|  | infinite loop in some metafun macro, but I cannot imagine why mpost
|  | would fall into infinite loop.
|  
|  I have stopped compilation after no more than 30 seconds, the log is 14MB

|  large with many lines:



| It looks like you should also post ecindf.mp so we can try for
| ourselves (or did I miss that?).

OK, here's a test file that works as expected:


Can you post a file that fails at your end?

Aditya___
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] Chinese opentype fonts can not be loaded in luatex-plain

2009-05-12 Thread Hans Hagen

Yanrui Li wrote:

Hi Hans,

I tried to use Chinese opentype fonts with luatex + plain fmt but I
failed. Only with Chinese TTF fonts it can work.

This a simple example:

\pdfoutput=1
\font\myfont=AdobeSongStd-Light

\myfont
我想实现 LuaTeX 对中文的支持

\end

When I compiled it, I got the following messages:

This is LuaTeX, Version beta-0.41.0-2009051221 (Web2C 7.5.7)
 \write18 enabled.
(tt.tex (luatex-basics.tex) (luatex-fonts.tex luatex-fonts-merged.lua luatex
-fonts.lua loaded in 0.027 seconds) (luatex-mplib.tex)
LuaTeX warning: lua-loaded font [51] (/usr/share/fonts/adobe/AdobeSongStd-Light
.otf) has no characters!
[1{/opt/context/tex/texmf/fonts/map/pdftex/plain/pdftex.map}] ){/opt/context/te
x/texmf/fonts/enc/dvips/lm/lm-rep-cmrm.enc}/opt/context/tex/texmf/fonts/type1/
public/lm/lmr10.pfb
Output written on tt.pdf (1 page, 17128 bytes).
Transcript written on tt.log.


this is because a cidmap is needed and the kpse that you use does not 
have it; upcoming versions of kpse (and luatex's kpse lib) will support 
it given that you also adapted your texmf.cnf accordingly then


so a bit patience is needed

Hans

(worls ok in mkiv because it follows a different route)

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


[NTG-context] Chinese opentype fonts can not be loaded in luatex-plain

2009-05-12 Thread Yanrui Li
Hi Hans,

I tried to use Chinese opentype fonts with luatex + plain fmt but I
failed. Only with Chinese TTF fonts it can work.

This a simple example:

\pdfoutput=1
\font\myfont=AdobeSongStd-Light

\myfont
我想实现 LuaTeX 对中文的支持

\end

When I compiled it, I got the following messages:

This is LuaTeX, Version beta-0.41.0-2009051221 (Web2C 7.5.7)
 \write18 enabled.
(tt.tex (luatex-basics.tex) (luatex-fonts.tex luatex-fonts-merged.lua luatex
-fonts.lua loaded in 0.027 seconds) (luatex-mplib.tex)
LuaTeX warning: lua-loaded font [51] (/usr/share/fonts/adobe/AdobeSongStd-Light
.otf) has no characters!
[1{/opt/context/tex/texmf/fonts/map/pdftex/plain/pdftex.map}] ){/opt/context/te
x/texmf/fonts/enc/dvips/lm/lm-rep-cmrm.enc}/opt/context/tex/texmf/fonts/type1/
public/lm/lmr10.pfb
Output written on tt.pdf (1 page, 17128 bytes).
Transcript written on tt.log.

My test environment is minimals 2009.05.12 11:27 with Linux x86.

-- 
Best wishes,
Li Yanrui
___
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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Hans Hagen

Yue Wang wrote:

On Tue, May 12, 2009 at 8:54 PM, Hans Hagen pra...@wxs.nl wrote:

Yue Wang wrote:



moreover, can you tell me why pdftex load these fonts so fast? (also 6
families * 3 sizes)

i don't know; as the same code is used so it must be xetex itself then


Then let me tell you why: ConTeXt tries to load lmmono10-regular at
least 6 times, failed after two testing, then succeed in the end.
However, try to testing whether a loaded font is \nullfont or not is
quite slow in XeTeX (Jonathan already mentioned that in
\testFontIsAvailable). we should definately avoid that.
But why pdftex is so fast? because it does not involve font testing.

So why XeTeX is spending 6 seconds aimlessly? since ConTeXt asked it
to search for a non-existed font.


well, even locating a font 6 times should be no big deal

btw, you can try to change the following into

\def\defaultfontfile{file:lmmono10-regular}

but even then ... if that one is used then there is something else going 
on so best find out what happens ... in context we can have 4 extra math 
families and in most cases only two are used (MathAlpha and MathBeta) 
while (just in onder to catch errors) MathGamma etc then automatically 
will trigger the default font to be used (other approached would demand 
more definitions at the user end and/or a more low level 
implementation); the only optimization i can imagine is more clever 
sharing of the default font but as in other cases one expects the 
default to be properly scaled it not that simple; after all, users also 
expect proper error recovery (and in many cases missing some specific 
fonts is no real problem until it's used); so, you can hardly blame 
context for the fact that xetex has a certain logix on locating fonts 
that happens to be not that good a match for context


The fact that xetex uses this mixture of  en [] does not help either 
as context uses [] itself so parsing is somewhat complicated (the 
file/name prefix was introduced to circumvent this problem);


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] Chinese opentype fonts can not be loaded in luatex-plain

2009-05-12 Thread Yanrui Li
On Tue, May 12, 2009 at 10:37 PM, Hans Hagen pra...@wxs.nl wrote:
 Yanrui Li wrote:

 Hi Hans,

 I tried to use Chinese opentype fonts with luatex + plain fmt but I
 failed. Only with Chinese TTF fonts it can work.


 this is because a cidmap is needed and the kpse that you use does not have
 it; upcoming versions of kpse (and luatex's kpse lib) will support it given
 that you also adapted your texmf.cnf accordingly then

I see. Thanks.


 so a bit patience is needed

Yes. I prepared for it because Yue had told me those calculations in
OTF font processing of luatex.
I need to load it only for the experiments of Chinese punctuation
compression in the bbox way.

-- 
Best wishes,
Li Yanrui
___
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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Hans Hagen

Yue Wang wrote:

Hi, Hans:

here is the solution to your great feature:


huh? what great features? what's wrong with the features anyway? you 
want a special version that instead prints hundreds of error messages 
each and every run because some font is missing which in practice is 
harmless?



change
 \def\defaultfontfile{lmmono10-regular}
in font-ini.mkii to
\def\defaultfontfile{[lmmono10-regular]}
to disable that feature.


it should be \defaultfontfile{file:lmmono10-regular} (when i  played 
with that this morning it made not much difference on the test runs here 
but the file: prefix does not hurt)


don't use the [ ] syntax which is rather engine specific

i moved all xetex code to a separate file font-xtx now (not sure if that 
 has side effects due to definition order but don't want to mess up the 
mkii code)


but it cannot solve the suffix problem nor the name lookup problems due 
to caching


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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Yue Wang
On Tue, May 12, 2009 at 10:50 PM, Hans Hagen pra...@wxs.nl wrote:
 Yue Wang wrote:

 On Tue, May 12, 2009 at 8:54 PM, Hans Hagen pra...@wxs.nl wrote:

 Yue Wang wrote:


 moreover, can you tell me why pdftex load these fonts so fast? (also 6
 families * 3 sizes)

 i don't know; as the same code is used so it must be xetex itself then

 Then let me tell you why: ConTeXt tries to load lmmono10-regular at
 least 6 times, failed after two testing, then succeed in the end.
 However, try to testing whether a loaded font is \nullfont or not is
 quite slow in XeTeX (Jonathan already mentioned that in
 \testFontIsAvailable). we should definately avoid that.
 But why pdftex is so fast? because it does not involve font testing.

 So why XeTeX is spending 6 seconds aimlessly? since ConTeXt asked it
 to search for a non-existed font.

 well, even locating a font 6 times should be no big deal



loading 6 fonts, each fonts will be scanned for 3 times. so there are
18 searching. 12 of them are fc searches, and these are quite slow.

 btw, you can try to change the following into

 \def\defaultfontfile{file:lmmono10-regular}


After changing like this, XeTeX runs like a blink. (It wasted 6
seconds for each compile. now it won't)

 but even then ... if that one is used then there is something else going on
 so best find out what happens ... in context we can have 4 extra math
 families and in most cases only two are used (MathAlpha and MathBeta) while
 (just in onder to catch errors) MathGamma etc then automatically will
 trigger the default font to be used (other approached would demand more
 definitions at the user end and/or a more low level implementation); the
 only optimization i can imagine is more clever sharing of the default font
 but as in other cases one expects the default to be properly scaled it not
 that simple; after all, users also expect proper error recovery (and in many
 cases missing some specific fonts is no real problem until it's used); so,
 you can hardly blame context for the fact that xetex has a certain logix on
 locating fonts that happens to be not that good a match for context

 The fact that xetex uses this mixture of  en [] does not help either as
 context uses [] itself so parsing is somewhat complicated (the file/name
 prefix was introduced to circumvent this problem);

 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
 ___

___
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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Yue Wang
On Tue, May 12, 2009 at 11:02 PM, Hans Hagen pra...@wxs.nl wrote:
 Yue Wang wrote:

 Hi, Hans:

 here is the solution to your great feature:

 huh? what great features? what's wrong with the features anyway? you want a
 special version that instead prints hundreds of error messages each and
 every run because some font is missing which in practice is harmless?

 change
  \def\defaultfontfile{lmmono10-regular}
 in font-ini.mkii to
 \def\defaultfontfile{[lmmono10-regular]}
 to disable that feature.

 it should be \defaultfontfile{file:lmmono10-regular} (when i  played with
 that this morning it made not much difference on the test runs here but the
 file: prefix does not hurt)


There is great difference here (8 sec compare to 1.2 seconds per run)


 don't use the [ ] syntax which is rather engine specific

But that line is enclosed in
\ifXeTeX and \endif...
So it will be fine.


 i moved all xetex code to a separate file font-xtx now (not sure if that
  has side effects due to definition order but don't want to mess up the mkii
 code)


I see.

 but it cannot solve the suffix problem nor the name lookup problems due to
 caching

I already reported that feature/bug to Jonathan Kew



 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
 ___

___
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] Metapost question

2009-05-12 Thread Jean Magnan de Bornier
Le 12 mai à 16:32:26 Aditya Mahajan adit...@umich.edu écrit notamment:

| Can you post a file that fails at your end?

here, but it doesn't *fail*, it produces ecindf.1 ok but then shows
infinitely this message. 

...
 input metafun;

numeric u; u=.5cm;
path AX; AX = drawdblarrow (10u,0) -- (0,0) -- (0,10u);
beginfig(1); 
  draw AX;
 label.lft(btex Coûts, prix etex rotated 90, (-.2u,8u));
 label.bot(btex Quantités  etex, (8u,0));
 for i=0 step u until 9u:
 draw (i,u/20)--(i,0);
 draw (u/20,i)--(0,i);
 endfor;
 picture ax; ax := currentpicture;
endfig;
end 
...
-- 
Jean
___
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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Taco Hoekwater


Yue Wang wrote:

 \def\defaultfontfile{file:lmmono10-regular}
 
 After changing like this, XeTeX runs like a blink. (It wasted 6
 seconds for each compile. now it won't)

Does that mean that the near-endless font issues with xetex are
now finally fixed?

Cheers,
Taco


___
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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Hans Hagen

Yue Wang wrote:


loading 6 fonts, each fonts will be scanned for 3 times. so there are
18 searching. 12 of them are fc searches, and these are quite slow.


if so, then this fc mechanism is pretty messed up as it's just a hash 
lookup which cna be fast


also, it does not explain why simple plain definitions also have a 
suffix and/or name lookup problem so you'd better make sure that that is 
fixed too (if only because we cannot be sure of users always using 
filenames)


in the meantime i'll add some lookup caching in the xetex specific 
context code (costs a bit of extra hash mem but lets not bother about that)


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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Hans Hagen

Yue Wang wrote:

On Tue, May 12, 2009 at 11:02 PM, Hans Hagen pra...@wxs.nl wrote:

Yue Wang wrote:

Hi, Hans:

here is the solution to your great feature:

huh? what great features? what's wrong with the features anyway? you want a
special version that instead prints hundreds of error messages each and
every run because some font is missing which in practice is harmless?


change
 \def\defaultfontfile{lmmono10-regular}
in font-ini.mkii to
\def\defaultfontfile{[lmmono10-regular]}
to disable that feature.

it should be \defaultfontfile{file:lmmono10-regular} (when i  played with
that this morning it made not much difference on the test runs here but the
file: prefix does not hurt)



There is great difference here (8 sec compare to 1.2 seconds per run)


makes no difference here for the big test

\setupbodyfont[myzhfont] \dorecurse{1}{{hello 
{\switchtobodyfont[myzhfont] 你好}}\par}


so it's probably also an operating system issue (caching files in mem, 
disk access etc)


-
  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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Hans Hagen

Taco Hoekwater wrote:


Yue Wang wrote:

\def\defaultfontfile{file:lmmono10-regular}

After changing like this, XeTeX runs like a blink. (It wasted 6
seconds for each compile. now it won't)


Does that mean that the near-endless font issues with xetex are
now finally fixed?


no ... suffix and name lookup remain (but the file: before the fallback 
font saves such name lookups so we disguised the problem)


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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Yue Wang
On Tue, May 12, 2009 at 11:22 PM, Hans Hagen pra...@wxs.nl wrote:
 Yue Wang wrote:

 On Tue, May 12, 2009 at 11:02 PM, Hans Hagen pra...@wxs.nl wrote:

 Yue Wang wrote:

 Hi, Hans:

 here is the solution to your great feature:

 huh? what great features? what's wrong with the features anyway? you want
 a
 special version that instead prints hundreds of error messages each and
 every run because some font is missing which in practice is harmless?

 change
  \def\defaultfontfile{lmmono10-regular}
 in font-ini.mkii to
 \def\defaultfontfile{[lmmono10-regular]}
 to disable that feature.

 it should be \defaultfontfile{file:lmmono10-regular} (when i  played with
 that this morning it made not much difference on the test runs here but
 the
 file: prefix does not hurt)


 There is great difference here (8 sec compare to 1.2 seconds per run)

 makes no difference here for the big test


Well, I always split my projects into small pieces so... it really counts.


 \setupbodyfont[myzhfont] \dorecurse{1}{{hello
 {\switchtobodyfont[myzhfont] 你好}}\par}

 so it's probably also an operating system issue (caching files in mem, disk
 access etc)


Well, that is possible. But in fact no new font is defined during the
font switching, which is paradoxical.
I will look into that tomorrow.

Please fix the
- lmmono defination
- unicode-letters charclass definations
- mpgraphics displacement bug (or feature...)
- dvipdfmx focus=standard feature
that I reported today.

Thank you. Good night and good luck!

Yue Wang

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

___
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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Hans Hagen

Yue Wang wrote:

On Tue, May 12, 2009 at 11:02 PM, Hans Hagen pra...@wxs.nl wrote:

Yue Wang wrote:

Hi, Hans:

here is the solution to your great feature:

huh? what great features? what's wrong with the features anyway? you want a
special version that instead prints hundreds of error messages each and
every run because some font is missing which in practice is harmless?


change
 \def\defaultfontfile{lmmono10-regular}
in font-ini.mkii to
\def\defaultfontfile{[lmmono10-regular]}
to disable that feature.

it should be \defaultfontfile{file:lmmono10-regular} (when i  played with
that this morning it made not much difference on the test runs here but the
file: prefix does not hurt)



There is great difference here (8 sec compare to 1.2 seconds per run)


i uploaded a new zip to the website

you can say:

\settrue\tracexetexfonts

as you will see, not that much fonts are loaded; once a font (in 
typefaces) is found, it is remembered; for xetex i now added an extra 
layer of remembering (the checks) so that misses in lookups might happen 
less (it might speed up the MathGamma cases a bit but i didn't notice 
much performance gain so it probably depends on other factors as well)


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
___


[NTG-context] Howto add a # sign to a \button URL?

2009-05-12 Thread Oliver Heins
Hallo,

I try to send a message from a pdf to a webserver.  This works fine,
unless the URL has a `#' in it.  Then TeX throws an error:

! Illegal parameter number in definition of \!!stringa

I tried to work around it with \edef'ing a \doublecross macro which
expands to \char35, but this did not work.  I also tried some extensive
use of \noexpand and \expandafter, but it failed, too.  Obviously, there's
some \csname...\endcsname stuff going on when creating the URL.

TIA,
 olli


Here's a minimal example:

\setupcolors[state=start]
\setupinteraction[state=start]

\starttext

\definefield[shorttext] [line] [ShortLine] [] []

\setupfield
[ShortLine]
[label,frame,horizontal]
[frame=off]
[height=18pt,width=15em,align=middle,frame=off]
[height=18pt,width=20em,align=right,style=\tfx,,frame=on]

\field[shorttext][Bitte geben Sie einen Text ein:]
\blank
\button[]{Abschicken}[SubmitForm{http://mydomain.test/formular#fdf,Shortline}]

\stoptext

___
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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Yue Wang
On Tue, May 12, 2009 at 11:41 PM, Hans Hagen pra...@wxs.nl wrote:
 Taco Hoekwater wrote:

 Yue Wang wrote:

 \def\defaultfontfile{file:lmmono10-regular}

 After changing like this, XeTeX runs like a blink. (It wasted 6
 seconds for each compile. now it won't)

 Does that mean that the near-endless font issues with xetex are
 now finally fixed?

 no ... suffix and name lookup remain (but the file: before the fallback font
 saves such name lookups so we disguised the problem)


no.  \definetypeface[foobar][blablabla] \dorecurse{1}{{hello
{\foobar 你好}}\par}
is still very slow. I will look into that tomorrow.

Other problems are solved (why \setupbodyfont[iwona] is slow, why
\definefont[simsun.ttf] is slow, etc.)

Concerning the suffix problem, I already reported that to Jonathan
Kew. I think he will fix that very soon.

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

___
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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Hans Hagen

Yue Wang wrote:


So why XeTeX is spending 6 seconds aimlessly? since ConTeXt asked it
to search for a non-existed font.


keep in mind that the font (lmmono10-regular) *is* existing, it's ust 
that xetex cannot find it as it favors names instead of files (and 
praise yourself happy that it's not looking for lmtypewriter10-regular 
as some older tex distributions ship that font).


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] Metapost question

2009-05-12 Thread Taco Hoekwater


Jean Magnan de Bornier wrote:
 Le 12 mai à 16:32:26 Aditya Mahajan adit...@umich.edu écrit notamment:
 
 | Can you post a file that fails at your end?
 
 here, but it doesn't *fail*, it produces ecindf.1 ok but then shows
 infinitely this message. 

I cannot reproduce this problem. To make sure it is not a mem file
version differencne, can you delete and regenerate mpost.mem ?

Best wishes,
Taco

___
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] Chinese opentype fonts can not be loaded in luatex-plain

2009-05-12 Thread Yue Wang
On Tue, May 12, 2009 at 11:47 PM, Hans Hagen pra...@wxs.nl wrote:
 Yanrui Li wrote:

 I need to load it only for the experiments of Chinese punctuation
 compression in the bbox way.

 i played with that and discarded the code (in mkiv) for the moment because
 first i want more info about fonts and their quality ... one easily spends
 days on solving 'bugs' that are actually bugs in fonts instead

 i will look again into these issues when

 - i get precise rules for spacing (or multiple rule sets)

No one have the epxerience of using the bbox information to typeset
Chinese before --- that information was not availble to the user until
LuaTeX came into being.
So even experienced Chinese typesetting artist don't know the spacing rules.
We have to play/experiment that in LuaTeX in order to find the best
possible parameters for typesetting.
Then we can report to you what should ConTeXt do in order to type
Chinese perfectly.

 - we have a set of default cjk fonts in tex live that can serve as reference

Adobe set will be good enough for reference.


 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
 ___

___
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] Chinese opentype fonts can not be loaded in luatex-plain

2009-05-12 Thread Wolfgang Schuster


Am 12.05.2009 um 18:04 schrieb Yue Wang:


On Tue, May 12, 2009 at 11:47 PM, Hans Hagen pra...@wxs.nl wrote:
- we have a set of default cjk fonts in tex live that can serve as  
reference


Adobe set will be good enough for reference.


With Adobes fonts you can use the 'palt' feature but this has a few  
effects
which are not always desired but I wasn't able in the past to use it  
in MkIV.


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
___


Re: [NTG-context] XeConTeXt bug report III: Wrong hyperlink

2009-05-12 Thread Yue Wang
On Tue, May 12, 2009 at 8:49 PM, Hans Hagen pra...@wxs.nl wrote:
 Jin-Hwan Cho wrote:


 I think that the value of the paperheight is better than 0 for top
 value.

 thanks for figuring it out ... i now just fall back to fit


then focus=standard wont make the link point to the right place...
btw, in ConTeXt's pdftex or luatex mode, it also point to the wrong place.
but Eplain and LaTeX hyperref handle that right...



 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] Metapost question

2009-05-12 Thread Jean Magnan de Bornier
Le 12 mai à 17:53:48 Taco Hoekwater t...@elvenkind.com écrit notamment:

| I cannot reproduce this problem. To make sure it is not a mem file
| version differencne, can you delete and regenerate mpost.mem ?

I followed this, nothing better! Then I tried to delete also metafun.mem
and that worked! (btw remaking mpost format didn't create metafun.mem
again, it doesn't seem to miss...)

So it all seems ok now
Thanks!
-- 
Jean
___
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] Chinese opentype fonts can not be loaded in luatex-plain

2009-05-12 Thread Dohyun Kim
2009/5/12 Hans Hagen pra...@wxs.nl:
 Yanrui Li wrote:

 Hi Hans,

 I tried to use Chinese opentype fonts with luatex + plain fmt but I
 failed. Only with Chinese TTF fonts it can work.

 This a simple example:

 \pdfoutput=1
 \font\myfont=AdobeSongStd-Light

 \myfont
 我想实现 LuaTeX 对中文的支持

 \end

 When I compiled it, I got the following messages:

 This is LuaTeX, Version beta-0.41.0-2009051221 (Web2C 7.5.7)
  \write18 enabled.
 (tt.tex (luatex-basics.tex) (luatex-fonts.tex luatex-fonts-merged.lua
 luatex
 -fonts.lua loaded in 0.027 seconds) (luatex-mplib.tex)
 LuaTeX warning: lua-loaded font [51]
 (/usr/share/fonts/adobe/AdobeSongStd-Light
 .otf) has no characters!
 [1{/opt/context/tex/texmf/fonts/map/pdftex/plain/pdftex.map}]
 ){/opt/context/te

 x/texmf/fonts/enc/dvips/lm/lm-rep-cmrm.enc}/opt/context/tex/texmf/fonts/type1/
 public/lm/lmr10.pfb
 Output written on tt.pdf (1 page, 17128 bytes).
 Transcript written on tt.log.

 this is because a cidmap is needed and the kpse that you use does not have
 it; upcoming versions of kpse (and luatex's kpse lib) will support it given
 that you also adapted your texmf.cnf accordingly then

 so a bit patience is needed


Yes, that is a source of problem; more obstacles, however, are waiting for us.

1.
To test an cid-keyed opentype fonts, I have copied *.cidmap files
into current directory and processed a simple document with luatex-plain.
But it did not work:

This is LuaTeX, Version beta-0.40.1-2009050920 (Web2C 7.5.7)
 \write18 enabled.
(nanumotf.tex
(/media/disk/context/tex/texmf-context/tex/generic/context/luatex-basics.tex)
(/media/disk/context/tex/texmf-context/tex/generic/context/luatex-fonts.tex lu
atex-fonts-merged.lua luatex-fonts.lua loaded in 0.027 seconds)
(/media/disk/context/tex/texmf-context/tex/generic/context/luatex-mplib.tex)
LuaTeX warning: lua-loaded font [51] (/media/disk/context/tex/texmf-local/fonts
/opentype/korean/NanumGothic.otf) has no characters!

The same message as that of Li Yanrui's experiment, which would not
occur on windows machine. But I am on my linux box, whose
file system, as you know, distinguishs upper- and lower-case letters:
Adobe-Korea1-2.cidmap is quite different from adobe-korea1-2.cidmap.
So I added one line into luatex-fonts-merged.lua as follows:

--- ../tex/texmf-context/tex/generic/context/luatex-fonts-merged.lua
2009-05-12
18:29:55.0 +0900
+++ luatex-fonts-merged.lua 2009-05-13 01:14:55.0 +0900
@@ -3898,6 +3898,7 @@

 local function locate(registry,ordering,supplement)
 local filename = format(template,registry,ordering,supplement)
+filename = string.lower(filename)
 local cidmap = fonts.cid.map[filename]
 if not cidmap then
 if trace_loading then


2.
However, I still got an error even after that one-line patch:

This is LuaTeX, Version beta-0.40.1-2009050920 (Web2C 7.5.7)
 \write18 enabled.
(nanumotf.tex
(/media/disk/context/tex/texmf-context/tex/generic/context/luatex-basics.tex)
(/media/disk/context/tex/texmf-context/tex/generic/context/luatex-fonts.tex lu
atex-fonts-merged.lua luatex-fonts.lua loaded in 0.029 seconds)
(/media/disk/context/tex/texmf-context/tex/generic/context/luatex-mplib.tex)
! LuaTeX error ./luatex-fonts-merged.lua:3879: attempt to call field 'loaddata'
 (a nil value).

In other words, loaddata is not defined.  So I issued grep command,
which helped me finding io.loaddata function defined in l-io.lua.

In sum:
even after modification of kpse, two more problems should be fixed.
1. lowering uppercase filename before searching cidmap
2. including l-io.lua into luatex-plain

Regards,
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] bugs in beta (footnotes)

2009-05-12 Thread Henning Hraban Ramm

Am 2009-05-10 um 18:44 schrieb Henning Hraban Ramm:

But it doesn't work, it's always bytext, i.e. numbering runs  
through from start to end.

And the marks still don't show up in the text!

(Latest minimals beta, 2009-05-10 18.30 MESZ)


I find this is fixed now (Beta 2009.05.12 17:37). Great, thanks!

Only footnotes in section titles don't work - should they?


\chapter{My chapter\footnote{Note: might be also a section or  
subsection}}


Shows the note mark, but eats the footnote text.


I can work around that like so:

\footnotetext[chap]{blah}
\subsection{My chapter\note[chap]}


It works in a minimal example, but in my actual project I get this  
error:


! Argument of \dostructurecomponent has an extra }.
inserted text
\par
to be read again
   }
\dostructurecomponent ...ctureparameter \c!title }
  }}\endgroup \fi \fi  
\fi \g...

\doregisterstructurehead ... \c!command =, #2][#3]
   
\reportcurrentstructure

\dohandlestructurehead ...ructurehead {#1}{#2}{#3}
  \let  
\getstructureheadsync...

l.76 \subsection{The European Dream\note[dream]}


I couldn't construct a minimal failing example - any hints?


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] Chinese opentype fonts can not be loaded in luatex-plain

2009-05-12 Thread Hans Hagen
Dohyun Kim wrote:

 even after modification of kpse, two more problems should be fixed.
 1. lowering uppercase filename before searching cidmap
 2. including l-io.lua into luatex-plain

i uploaded a beta

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] Howto add a # sign to a \button URL?

2009-05-12 Thread Hans Hagen

Oliver Heins wrote:

Hallo,

I try to send a message from a pdf to a webserver.  This works fine,
unless the URL has a `#' in it.  Then TeX throws an error:


does \# work?


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


[NTG-context] color

2009-05-12 Thread Hans Hagen

Hi,

just a note ... mkiv now defaults to color as nobody objected wolfgangs 
(if i remember right) request


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] ppchtex color

2009-05-12 Thread Hans Hagen

Alan BRASLAU wrote:


\startchemical
\color[red]{\chemical[ONE,SB,Z0][C]}
\stopchemical
% text C is offset...


add a % after the } (maybe we should ignore endofline, i.e. make a mkiv 
variant and extend/maintain that)



-
  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] ppchtex color

2009-05-12 Thread Hans Hagen

Alan BRASLAU wrote:

No, ppchtex is not dead...

I would like to use color.

1. color= and rulecolor= does not appear to be implemented (mkiv)...
2. how can one change the color of the bonds?
3. using \color[red]{} causes the text to be offset.

minimal example:

\setupcolors[state=start]
\usemodule[chemic]
\starttext

\startchemical
\chemical[ONE,SB,Z0][C]
\stopchemical

\startchemical
\color[red]{\chemical[ONE,SB,Z0][C]}
\stopchemical
% text C is offset...

\startchemical
\chemical[ONE,SB,Z0][{\red C}]
\stopchemical
% OK, but I would like to draw the bonds as well in red.

\startchemical[color=red]
\chemical[ONE,SB,Z0][C]
\stopchemical
% C is red in mkii, black in mkiv


has to do with different color mechanism ..

path line 1171:

\setbox2=\hbox{\@@dochemicalcolor$\@@dochemicalstyle{\@@localchemicalformat 
\chemicaltext}$}%




\startchemical[rulecolor=red]
\chemical[ONE,SB,Z0][C]
\stopchemical
% bonds are black, C is red in mkii, black in mkiv

\stoptext

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



--

-
  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] ppchtex color

2009-05-12 Thread Hans Hagen

Alan BRASLAU wrote:

No, ppchtex is not dead...

I would like to use color.

1. color= and rulecolor= does not appear to be implemented (mkiv)...
2. how can one change the color of the bonds?
3. using \color[red]{} causes the text to be offset.

minimal example:

\setupcolors[state=start]
\usemodule[chemic]
\starttext

\startchemical
\chemical[ONE,SB,Z0][C]
\stopchemical

\startchemical
\color[red]{\chemical[ONE,SB,Z0][C]}
\stopchemical
% text C is offset...

\startchemical
\chemical[ONE,SB,Z0][{\red C}]
\stopchemical
% OK, but I would like to draw the bonds as well in red.

\startchemical[color=red]
\chemical[ONE,SB,Z0][C]
\stopchemical
% C is red in mkii, black in mkiv

\startchemical[rulecolor=red]
\chemical[ONE,SB,Z0][C]
\stopchemical


setting happened at the outer level (ok, that's broken now but we can 
fix that later); so now, each formula must have the settings; when i 
have time i'll make a mkiv variant so that we can upgrade (i don't want 
interference with mkii since that version is also used in latex and we 
don't need to upgrade that)


\def\setchemicalattributes
  {\scratchdimen\@@chemicalrulethickness
   \def\chemicalattributes
 {withpen pencircle scaled \the\scratchdimen\space
  withcolor }%
   \doifelsenothing\@@chemicalrulecolor
 {\edef\chemicalattributes{\chemicalattributes black}}
 {\edef\chemicalattributes{\chemicalattributes 
\MPcolor{\@@chemicalrulecolor}}}%

   \startMPdrawing
 drawoptions (\chemicalattributes) ;
   \stopMPdrawing}


-
  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] ppchtex color

2009-05-12 Thread Hans Hagen

Alan BRASLAU wrote:

No, ppchtex is not dead...


i split ppchtex in mkii/mkiv (and included the fixes) so we can improve 
things eventually


can you check if it still runs ok (beta zip on website)

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] ppchtex color

2009-05-12 Thread Alan BRASLAU
 i split ppchtex in mkii/mkiv (and included the fixes) so we can improve
 things eventually
 
 can you check if it still runs ok (beta zip on website)
 
 Hans

Unzipped cont-tmf.zip on top of my minimals installation and ran context on my 
current working documents:

system  : module chemic loaded
(/usr/local/context.new/tex/texmf-context/tex/context/base/m-chemic.tex 
(/usr/local/context.new/tex/texmf-context/tex/context/base/m-chemic.mkiv
system  : module pictex loaded
(/usr/local/context.new/tex/texmf-context/tex/context/base/m-pictex.tex 
(/usr/local/context.new/tex/texmf-context/tex/context/base/thrd-pic.tex
warning : \dimen \linethickness is already defined (\relax it first)
)) (/usr/local/context.new/tex/texmf-context/tex/context/base/ppchtex.mkiv
ppchtex : using PiCTeX and MetaPost
)))

It appears to work as before...
(I will now look into your color suggestions.)

Alan



___
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] ppchtex color

2009-05-12 Thread Alan BRASLAU
 i split ppchtex in mkii/mkiv (and included the fixes) so we can improve
 things eventually
 
 can you check if it still runs ok (beta zip on website)
 
 Hans

Works correctly (bonds in red, atoms in black):

\usemodule[chemic]
\setupchemical[rulecolor=red]
\starttext
\startchemical
\chemical[ONE,SB,Z0][C]
\stopchemical
\stoptext


However, the following variant does not work.

\usemodule[chemic]
\starttext
\startchemical[rulecolor=red]
\chemical[ONE,SB,Z0][C]
\stopchemical
\stoptext

I don't understand, as my (quick) look at the source code
indicates that the parameters should be handled identically.

Alan

___
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] ppchtex color

2009-05-12 Thread Hans Hagen

Alan BRASLAU wrote:

i split ppchtex in mkii/mkiv (and included the fixes) so we can improve
things eventually

can you check if it still runs ok (beta zip on website)

Hans


Unzipped cont-tmf.zip on top of my minimals installation and ran context on my 
current working documents:


system  : module chemic loaded
(/usr/local/context.new/tex/texmf-context/tex/context/base/m-chemic.tex 
(/usr/local/context.new/tex/texmf-context/tex/context/base/m-chemic.mkiv

system  : module pictex loaded
(/usr/local/context.new/tex/texmf-context/tex/context/base/m-pictex.tex 
(/usr/local/context.new/tex/texmf-context/tex/context/base/thrd-pic.tex

warning : \dimen \linethickness is already defined (\relax it first)
)) (/usr/local/context.new/tex/texmf-context/tex/context/base/ppchtex.mkiv
ppchtex : using PiCTeX and MetaPost
)))

It appears to work as before...
(I will now look into your color suggestions.)


color should work ok (that is: color=red, and rulecolor=red)


-
  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] XeConTeXt bug report I: strange benchmark

2009-05-12 Thread Yue Wang
Hi, Hans:

On Tue, May 12, 2009 at 11:22 PM, Hans Hagen pra...@wxs.nl wrote:
 \setupbodyfont[myzhfont] \dorecurse{1}{{hello
 {\switchtobodyfont[myzhfont] 你好}}\par}
 so it's probably also an operating system issue (caching files in mem, disk 
 access etc)

After debugging for half an hour in the morning, finally I know why
this is so slow on both XeTeX and pdfTeX.
This problem is not an operating system issue, But a ConTeXt feature.

in font-mkii, you use the following to define a actual font
(\definefontlocal and \definefontglobal):
  {\expandafter\xdef\csname#1\endcsname  % ! ! ! ! not needed in luatex ! ! ! !
 {\noexpand\csname#1:\endcsname
  \noexpand\reactivatefont{\somefontname}{\fontfile}}%

For example, in the previous example, it will define a lot of fonts,
like \*myzhfont12ptmmexrm*: , is defined as
\reactivatefont{cmex10}{lmex10}. When define that font, a macro
\*myzhfont12ptmmexrm* is defined to select the \*myzhfont12ptmmexrm* :
font.
\*myzhfont12ptmmexrm* =\csname *myzhfont12ptmmexrm* :\endcsname
\reactivefont{cmex10}{lmex10}
TeX then expand your reactivatefont macros to lmex10 at 12.0pt. So the
\*myzhfont12ptmmexrm*: font will assigned to lmex10 at 12.0pt. This is
quite right for definition.

However, after switching the font, the problems occurs:
it tries to call \*myzhfont12ptmmexrm* macro. the macro then expands to
\csname *myzhfont12ptmmexrm* :\endcsname \reactivefont{cmex10}{lmex10}
then to
\*myzhfont12ptmmexrm* :\reactivefont{cmex10}{lmex10}
and here TeX tries to do the following thing:
TeX select the font \*myzhfont12ptmmexrm*:, which is lmex10 at 12pt,
then *changing* into that font environment in order to *typeset*
\reactivefont.  it then expand the macro of reacitve font, but found
nothing to typeset...

what's worse, this will occur on every real fonts in the definition.
So in fact TeX will switching dozens of fonts into the *current* font
for a \switchtobodyfont call, in order to typeset nothing. And
that's why ConTeXt is so slow on typeface changing.

The solution to this bug (or feature?) is quite easy, just use \font
to define the \*myzhfont12ptmmexrm*: font, but pay attention not to
switch the current font to \*myzhfont12ptmmexrm*: . Since it is quite
slow to switch to dozens of font for one \switchtobodyfont call even
in Knuth TeX.




Yue Wang









 so it's probably also an operating system issue (caching files in mem, disk
 access etc)

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

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