Re: [NTG-context] stand-alone ConTeXt

2009-06-21 Thread Hans Hagen

Mojca Miklavec wrote:

On Sun, Jun 21, 2009 at 13:09, Hans Hagen wrote:

Mojca Miklavec wrote:

Hans ... I suspect that ConTeXt MKII (both pdftex and xetex) are
missing from the list ...

indeed. mkiv only as i don't want dependencies on perl/ruby in this case


So ... should I start blackmailing with I'll remove it from minimals
unless it starts supporting mkii or rather with I'll tell Jonathan
that your configuration doesn't support XeTeX? :) :) :) :) :) :)

(Let's leave it up to users to install ruby themselves and it's
totally ok if mkiv stays the default, but I see no reason for not
providing XeTeX and pdfTeX support (with synctex switch on by default)
on purpose ...)


well, it's not that pdftex cq. xetex are not supported, but more that 
mtxrun defaults to luatex / mkiv (just as texexec defaults to pdftex) 
and *i* want to default to luatex (no matter how much you blackmail me)


users can

% engine=pdftex
% engine=xetex

at the top of their document if they want and mtxrun will then run 
texexec instead


if users want syntex on they can enable it with

\synctex=1

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] stand-alone ConTeXt

2009-06-20 Thread Mojca Miklavec
On Mon, Jun 15, 2009 at 17:05, Hans Hagen wrote:
 Yue Wang wrote:

 It depends if the Minimals are intended to be a complete TeX system or
 if they are meant to be a minimal system for ConTeXt, possibly
 complementing the utility programs from TeX Live.

 it is just context minimals' extra...
 minimals can still be a minimal system for ConTeXt.

 there will be a goodies option:

 --goodies=scite,texworks,xml,gs

The option --goodies=texworks should work now. Once you run setuptex
(or if you have set the path), you should be able to call just
texworks filename from command line.

Hans ... I suspect that ConTeXt MKII (both pdftex and xetex) are
missing from the list ...

Mojca
___
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] stand-alone ConTeXt

2009-06-15 Thread Hans Hagen

Yue Wang wrote:

btw, if one uses mkiv, ruby is no longer needed unless one wants to run
specific scripts that are not yet luafied; but then, installing ruby is no
big deal anyway


How about process the mkii document using lua script too? So
eventually we can get rid of ruby and perl.


for that i need to rewrite the index sorting in lua (plus a little bit 
of tui - tuo handling)



now context script supports --pdftex and --xetex switch, but it still
fall back to texexec and texutils ruby scripts.


sure, time is limited

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] Is this font changing allowed/correct?

2009-06-14 Thread Wolfgang Schuster


Am 13.06.2009 um 16:12 schrieb Maurí cio:


Can I switch fonts like this?



{
 \switchtobodyfont[concrete]
 More text.
}



concrete roman? mkiv does not support bitmap fonts out of the box


I got the 'concrete' name from table 1.11 of 'typography.pdf',
The predefined body font identifiers for free OpenType fons.

This probably means I'm understanding something completely
wrong... What would that be?


You're right, the concrete fonts are mentioned in the typography chapter
but ConTeXt use now two different versions for XeTeX and LuaTeX and in
the LuaTeX part the old files are removed because we don't have the  
fonts

in the minimals and better alternatives (e.g. Computer Modern Unicode)
exists for them.

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] stand-alone ConTeXt

2009-06-14 Thread Yue Wang
 btw, if one uses mkiv, ruby is no longer needed unless one wants to run
 specific scripts that are not yet luafied; but then, installing ruby is no
 big deal anyway

How about process the mkii document using lua script too? So
eventually we can get rid of ruby and perl.

now context script supports --pdftex and --xetex switch, but it still
fall back to texexec and texutils ruby scripts.



 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] Is this font changing allowed/correct?

2009-06-13 Thread Wolfgang Schuster


Am 13.06.2009 um 03:43 schrieb Maurí cio:


Can I switch fonts like this? I know something is wrong
because it doesn't work ('concrete' typeface is not used),
but I would like to know if I'm in the right direction.


Latin Modern has no replacement for the Concrete fonts but you
can use the Computer Modern Unicode fonts.


\usetypescriptfile[type-otf]


You don't have to to load 'type-otf', it's always loaded by ConTeXt
itself with XeTeX or LuaTeX.

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] Commissioned work - we're looking for a ConTeXt person to help us finishing a 200+ pages multi-lingual art book (with Xetex?)

2009-06-13 Thread Pierre Huyghebaert

Dear list,

I'm part of a design group Open Source Publishing, and we use ConTeXt  
for a few months now. The main goal is to produce a 200+ pages multi- 
lingual art book for which we have in the past months some exchanges  
with kind members of the list about font install and Xetex. I  
currently work more on the design itself.


To finish on time, avoid loosing time on some hazardous/random errors,  
and also learning ConTeXt more from the inside, we're looking for a  
person interested to have a commissioned work -for a fair price per  
day- to help us crossing the last technical problems (some of them  
still unknown and only potential). It's not easy for us to plan the  
exact amount of work, but it will certainly be closely linked to :

- ConTeXt
- Xetex (or another solution to use custom fonts)
- Pictures
- Final production of CMYK PDF's for the printer

We work in Brussels but are able to travel to the Netherlands without  
problems. A first meeting will probably be helpful to go to more  
details. We'll try to push the project as far as possible this month  
and in July to be able to print the book in August.


If you are, or you know a person interested in, do not hesitate to  
contact us,


Pierre Huyghebaert +32 495 90 56 32
http://www.ospublish.constantvzw.org 
___

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] Commissioned work - we're looking for a ConTeXt person to help us finishing a 200+ pages multi-lingual art book (with Xetex?)

2009-06-13 Thread Wolfgang Schuster


Am 13.06.2009 um 12:41 schrieb Pierre Huyghebaert:


Dear list,

I'm part of a design group Open Source Publishing, and we use  
ConTeXt for a few months now. The main goal is to produce a 200+  
pages multi-lingual art book for which we have in the past months  
some exchanges with kind members of the list about font install and  
Xetex. I currently work more on the design itself.


To finish on time, avoid loosing time on some hazardous/random  
errors, and also learning ConTeXt more from the inside, we're  
looking for a person interested to have a commissioned work -for a  
fair price per day- to help us crossing the last technical problems  
(some of them still unknown and only potential). It's not easy for  
us to plan the exact amount of work, but it will certainly be  
closely linked to :

- ConTeXt
- Xetex (or another solution to use custom fonts)


Also possible in MkIV (LuaTeX) and even simpler with the simplefonts  
module.



- Pictures
- Final production of CMYK PDF's for the printer


\setupcolors[rgb=no]

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] Can't set typescript

2009-06-07 Thread Wolfgang Schuster


Am 07.06.2009 um 17:38 schrieb Maurí cio:


I'm trying this small test:

%

\enableregime[utf]
\usetypescriptfile[type-xtx]
\usetypescript[gentium]
\setupbodyfont[gentium]
\starttext
\showbodyfont
\stoptext

%

It's supposed to select 'gentium' as typeface,
but the chart shown by 'showbodyfont' says I'm
using 'modern'.

Am I missing something? I'm using minimal install,
updated yesterday (although I have this problem for
at least two weeks).


1. Do you use XeTeX to process your file?

2. Do you have the Gentium fonts on your system?

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] Can't set typescript

2009-06-07 Thread Maurí­cio

I'm trying this small test:

%

\enableregime[utf]
\usetypescriptfile[type-xtx]
\usetypescript[gentium]
\setupbodyfont[gentium]
\starttext
\showbodyfont
\stoptext

%

It's supposed to select 'gentium' as typeface,
but the chart shown by 'showbodyfont' says I'm
using 'modern'.

Am I missing something? I'm using minimal install,
updated yesterday (although I have this problem for
at least two weeks).


1. Do you use XeTeX to process your file?

2. Do you have the Gentium fonts on your system?



I use the minimal install from pragma site, as prescribed
in the 'simple' version of instructions in:

http://wiki.contextgarden.net/ConTeXt_Minimals

Aren't XeTeX and Gentium supposed to be there? I can find
these files:

context/tex/texmf-linux/xetex
context/tex/texmf-linux/bin/xetex

context/tex/texmf/fonts/enc/dvips/gentium
context/tex/texmf/fonts/truetype/public/gentium
context/tex/texmf/fonts/tfm/public/gentium
context/tex/texmf/fonts/map/pdftex/gentium
context/tex/texmf/tex/context/third/gentium

Thanks,
Maurício

___
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] Can't set typescript

2009-06-07 Thread Wolfgang Schuster


Am 07.06.2009 um 20:25 schrieb Maurí cio:


I'm trying this small test:

%

\enableregime[utf]
\usetypescriptfile[type-xtx]
\usetypescript[gentium]
\setupbodyfont[gentium]
\starttext
\showbodyfont
\stoptext

%

It's supposed to select 'gentium' as typeface,
but the chart shown by 'showbodyfont' says I'm
using 'modern'.

Am I missing something? I'm using minimal install,
updated yesterday (although I have this problem for
at least two weeks).

1. Do you use XeTeX to process your file?
2. Do you have the Gentium fonts on your system?



I use the minimal install from pragma site, as prescribed
in the 'simple' version of instructions in:

http://wiki.contextgarden.net/ConTeXt_Minimals



1. You don't need \enablregime[utf] for XeTeX or LuaTeX (you need
   it only when you want to process your document with pdfTeX too)

2. type-xtx is loaded for XeTeX by default

3. This should work:

   \usetypescriptfile[type-gentium]
   \usetypescript[gentium]
   \setupbodyfont[gentium]
   \starttext
   ...
   \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] Where to store typescripts ?

2009-06-04 Thread Wolfgang Schuster


Am 04.06.2009 um 16:44 schrieb Nicolas Girard:


Wow. Now, I'm lost -- and i still can't make it work anyway.
Could you explain right from the start ?

Let's assume (as it is the case on my system) that the Delicious fonts
are properly installed *and* the font database knows about it.
Let's assume context = LuaTeX mkiv

Now,

1. if I want to create a typescript file supporting some XX fonts, do
I need to name the file type-XX.some_extension, or is it only a
convention and the file could also be named XX.some_extension or even
whatever.some_extension ?


You can use whatever.tex for the name of the file but the convention  
is

to name it type-whatever.tex.

2. what should be the extension for mkiv ? .mkiv ? .tex ? Are both  
allowed ?


You could write extra files to follow the different naming conventions
for XeTeX and LuaTeX and name the files type-whatever.mkii/mkiv and
load it in the type-tex file with \loadmarkfile{type-...}.


3. Assuming I properly install such
http://bitbucket.org/wolfs/typescripts/src/7050bb6918bb/type-exljbris.mkiv
file, should I load it using
 \usetypescriptfile[type-exljbris]
or
 \usetypescriptfile[exljbris]
?


You load in your document type-exljbris.tex, the mkii/mkiv files are
loaded from type-exljbris.tex dependend what engine you use and never
by yourself.


4. What is the relationship between type-exljbris.mkiv and
type-exljbris.tex ? Is type-exljbris.tex necessary when using mkiv ?


See above.


5. In order to install one or several typescript files, I should first
copy them, either in
   tex/texmf-fonts/tex/context/user
or in
   tex/texmf-project/tex/context/user
right ?


Yes but I can create a package with all files you can the load from
the modules section or with the minimals updater.


But then,
what is it necessary to run ?
- context --generate ?
- mtxrun --script fonts --reload ?
- both ?


When you saved the typescript files (tex + mkii/mkiv) in the above  
folder
call 'context --generate' to let ConTeXt know there are new files  
available.


The second command 'mtxrun --script fonts --reload' is used to let  
ConTeXt

look for new fonts but this normally happen by default when you request
a new font which is unknown to ConTeXt. The only case (I know at the  
moment)
when you need the command is when you have install a new font which  
has the
same name as a old one but a different file extension, did not happen  
very

often a few fonts are available in TT and OT format.


6. How comes ConTeXt can silently substitute my fonts, without even
outputting any error message ?
How to change this behaviour ?
How to disable font substitution ?


This happens only when the font you requested is not available
or you try to load not existing typescripts.

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

2009-05-27 Thread Wolfgang Schuster


Am 27.05.2009 um 10:34 schrieb richard.steph...@converteam.com:


\usetypescriptfile[type-win]
\usetypescript[arial]\setupbodyfont[arial, 12pt]


I'm being asked to use Arial font (not my choice!)


I am using Windows, but the above did nothing - I ended up with the  
default

serif font.


You need XeTeX to let this work.

You can also use helevetica. Most people will not notice the  
difference.


So,

\usetypescript[postscript]
\setupbodyfont[ss, 12pt]


The above changed the font to sans serif, but it doesn't look like
Helvetica (or Arial)


The second line has to be \setupbodyfont[postscript,ss] and with a  
recent

ConTeXt version you can write

\usetypescript[helvetica]
\setupbodyfont[helvetica]

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] Size of \copyright

2009-05-27 Thread Taco Hoekwater


richard.steph...@converteam.com wrote:
 Hello all,
 
 I would like to include a very small copyright notice, e.g.
 
 {\tfxx \copyright 2009 Acme Co Ltd}
 
 but the © does not shrink with the text. How do I change the size of
 \copyright?

EC encoding does not reserve a slot for the copyright symbol,
so in default mkii, it is being built up from (math) macros,
a bit like how it used to work in plain TeX.

Options are: switch to a different font encoding, switch to
mkiv or xetex, or do something like this:

  {\switchtobodyfont[xx]\copyright 2009 Acme Co Ltd}

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] Size of \copyright

2009-05-27 Thread richard . stephens
  I would like to include a very small copyright notice, e.g.
 
  {\tfxx \copyright 2009 Acme Co Ltd}
 
  but the © does not shrink with the text. How do I change the size of
  \copyright?

 EC encoding does not reserve a slot for the copyright symbol,
 so in default mkii, it is being built up from (math) macros,
 a bit like how it used to work in plain TeX.

 Options are: switch to a different font encoding, switch to
 mkiv or xetex, or do something like this:

   {\switchtobodyfont[xx]\copyright 2009 Acme Co Ltd}

 Best wishes,
 Taco

That works, thanks.

Best regards,
Richard



Converteam UK Ltd. Registration Number: 5571739 and Converteam Ltd. 
Registration Number: 2416188  
Registered in England and Wales.  
Registered office: Boughton Road, Rugby, Warwickshire, CV21 1BU.  

CONFIDENTIALITY : This e-mail and any attachments are confidential and may be 
privileged. If you are not a named recipient, please notify the sender 
immediately and do not disclose the contents to another person, use it for any 
purpose or store or copy the information in any medium.  

Please consider the environment before printing this e-mail 
___
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] Fwd: [XeTeX] ANN: Custom Stories, Inc. using xelatex now live

2009-05-26 Thread Wolfgang Schuster


Anfang der weitergeleiteten E-Mail:


Von: William Adams will.ad...@frycomm.com
Datum: 26. Mai 2009 17:38:29 MESZ
An: Unicode-based TeX for Mac OS X and other platforms xe...@tug.org
Betreff: [XeTeX] ANN: Custom Stories, Inc. using xelatex now live
Antwort an: Unicode-based TeX for Mac OS X and other platforms xe...@tug.org 



I hope no one objects to this --- it's more of a public thank you  
than anything else.


We've just taken Custom Stories, Inc., a customized children's  
storybook site live. The typesetting is done using XeLaTeX, and I  
don't believe would've been as effective using any other tool.  
(Unfortunately we couldn't afford to license Linotype's Zapfino for  
server use, so the letter in _Love Story_ isn't as nice as it  
could've been IMO).


http://www.customstoriesinc.com/

William
(who is working on the typesetting for the next story sometime real  
soon now)


--
William Adams
senior graphic designer
Fry Communications
Sphinx of black quartz, judge my vow.



___
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] Fwd: [XeTeX] ANN: Custom Stories, Inc. using xelatex now live

2009-05-26 Thread William Adams

On May 26, 2009, at 1:03 PM, Wolfgang Schuster quoted my having written:

The typesetting is done using XeLaTeX, and I don't believe would've  
been as effective using any other tool.



That should probably say:

The typesetting is done using XeTeX, and I don't believe it would've  
been as effective using any other tool --- specifically I used  
xelatex, 'cause I'm not cool and hip enough to know ConTeXt well  
enough to've been able to develop it in ConTeXt in a reasonable  
timeframe, even though in many ways that would've made for a cleaner  
interface to the server.


William

--
William Adams
senior graphic designer
Fry Communications
Sphinx of black quartz, judge my vow.

___
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] How to make a stretched pdf file

2009-05-23 Thread Wolfgang Schuster


Am 23.05.2009 um 03:59 schrieb Zhichu Chen:


Awesome, but still, the javascript things are gone :(


I feared something like this will happen, I guess you get also  
problems with hyperlinks etc.



Anyway, I'll try the resolution method.


+1

By the way, is there any chance that I can use a stretched font  
without
disturbing the output routine? I think I can try a narrow font and  
re-draw

my pictures.


AFAIK XeTeX has such a feature but is the presentation worth such  
tricks.


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] MkIV italic correction?

2009-05-22 Thread Taco Hoekwater


Corsair wrote:
 On Thu, May 21, 2009 at 01:59:14PM +0200, Taco Hoekwater wrote:
 Corsair wrote:
 On Thu, May 21, 2009 at 11:55:45AM +0200, Hans Hagen wrote:
 open type fonts have no italic correction info (except in math)
 But I notice that using the same fonts in XeTeX produces italic
 correction.  Is it fake?
 I guess it is using the glyph boundingbox.
 
 Thank you.  This sounds reasonable.  Is there any way I can achieve
 this in MkIV?  I'm currently using \def\/{\kern0.1em}, which is kinda
 dirty...

Hans could implement something like this easily, but whether it does
much good is doubtful (that square box does not actually tell you where
something sticks out, just that it does).

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] MkIV italic correction?

2009-05-21 Thread Corsair
On Thu, May 21, 2009 at 11:55:45AM +0200, Hans Hagen wrote:
 open type fonts have no italic correction info (except in math)

But I notice that using the same fonts in XeTeX produces italic
correction.  Is it fake?

-- 
There is no emotion; there is peace.
There is no ignorance; there is knowledge.
There is no passion; there is serenity.
There is no death; there is the Force.


pgpcsgfJ4LDhX.pgp
Description: PGP signature
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] MkIV italic correction?

2009-05-21 Thread Taco Hoekwater

Corsair wrote:

On Thu, May 21, 2009 at 11:55:45AM +0200, Hans Hagen wrote:

open type fonts have no italic correction info (except in math)


But I notice that using the same fonts in XeTeX produces italic
correction.  Is it fake?


I guess it is using the glyph boundingbox.
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] MkIV italic correction?

2009-05-21 Thread Corsair
On Thu, May 21, 2009 at 01:59:14PM +0200, Taco Hoekwater wrote:
 Corsair wrote:
  On Thu, May 21, 2009 at 11:55:45AM +0200, Hans Hagen wrote:
  open type fonts have no italic correction info (except in math)
  
  But I notice that using the same fonts in XeTeX produces italic
  correction.  Is it fake?
 
 I guess it is using the glyph boundingbox.

Thank you.  This sounds reasonable.  Is there any way I can achieve
this in MkIV?  I'm currently using \def\/{\kern0.1em}, which is kinda
dirty...

-- 
There is no emotion; there is peace.
There is no ignorance; there is knowledge.
There is no passion; there is serenity.
There is no death; there is the Force.


pgpBwAEl15ODI.pgp
Description: PGP signature
___
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] Error with some italic fonts: Parsing CFF DICT failed

2009-05-20 Thread Robert-André Mauchin

Hi,

So I finally understand how to use my system fonts with Context (the 
--reload thing was not working), in order to use URW fonts, especially 
Nimbus Roman ones (I know there are TexGyre versions but that's not the 
point).


 * Here is my code :

% engine=luatex
\starttypescript [serif] [nimbus] [name]
  \definefontsynonym [Serif][n021003l]
  \definefontsynonym [SerifBold][n021004l]
  \definefontsynonym [SerifItalic]  [n021023l]
  \definefontsynonym [SerifBoldItalic]  [n021024l]
\stoptypescript

\definetypeface[basic][rm][serif][nimbus]
\setupbodyfont[basic,12pt]

\starttext
blah blah blah
\stoptext

 * When I compile this with Context, I get the following error :

!LuaTeX error (file 
/usr/local/tex/texmf/fonts/data/default/Type1/n021023l.pfb): Parsing CFF 
DICT failed. (error=-3)

 == Fatal error occurred, no output PDF file produced!
MTXrun | fatal error, return code: 70

It happens with other italic URW fonts, such as Palladio.


 * Googling a bit the error message, I found a similar error message 
but with Xetex (http://www.tug.org/pipermail/xetex/2008-March/009000.html ):


 OK, I think I have figured out what's wrong. The italic version
 of the font has an empty StemSnapV array in its PS Private data,
 and this stumbles xdvipdfmx which assumes every operator should
 be preceded by some operands. Particularly I think this is a bug
 in xdvipdfmx: although the specification doesn't say explicitly
 that dictionary keys with no value are allowed, other tools
 (e. g. TTX or FontForge) seem to have no problems with this
 situation.

 So my opinion is that the CFF_ERROR_STACK_UNDERFLOW error should
 not be triggered at the line 305 of cff_dict.c, if stack_top is 0.

 Thanks for your analysis of the issue. You are right, it is unclear
 from the CFF spec whether an operator like StemSnapV should be
 allowed with no operands; it doesn't really make any sense, but on
 the other hand it should be harmless.

 * So I searched in the luatex code to find the culprit, 
source/texk/web2c/luatexdir/font/writecff.c, where you might include a 
similar hack as in xdvipdfmx 
(http://scripts.sil.org/svn-view/xdvipdfmx/TRUNK/src/cff_dict.c?view=markup 
)


Thanks
___
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] Circumflex with FreeSerif and FreeSans

2009-05-20 Thread Robert-André Mauchin

Hi

When I use the FreeSerif and FreeSans fonts, I notice strange 
overlappping with words containing vowels with circumflex, such as â, ê, 
î, ô, û and  Â, Ê, Î, Ö, Ü.


I made a test case to show you, I hope attachments are allowed here.

Thanks.

nb: No problem with FreeMono, but I suspect monospaced fonts can't have 
such problem.

nb: There is no such problem when I use the Xetex engine.

Versions:
This is LuaTeX, Version beta-0.40.1-2009050920 (Web2C 7.5.7)
\write18 enabled.
ConTeXt  ver: 2009.05.14 16:44 MKIV  fmt: 2009.5.18  int: english/english


test.tex
Description: TeX document
___
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] Circumflex with FreeSerif and FreeSans

2009-05-20 Thread R. Bastian
On Wed, 20 May 2009 11:39:53 +0200
Robert-André Mauchin zebo...@pengzone.org scribit:

 Hi
 
 When I use the FreeSerif and FreeSans fonts, I notice strange 
 overlappping with words containing vowels with circumflex, such as â, ê, 
 î, ô, û and  Â, Ê, Î, Ö, Ü.
 
 I made a test case to show you, I hope attachments are allowed here.
 
 Thanks.
 
 nb: No problem with FreeMono, but I suspect monospaced fonts can't have 
 such problem.
 nb: There is no such problem when I use the Xetex engine.
 
 Versions:
 This is LuaTeX, Version beta-0.40.1-2009050920 (Web2C 7.5.7)
 \write18 enabled.
 ConTeXt  ver: 2009.05.14 16:44 MKIV  fmt: 2009.5.18  int: english/english

texexec 6.2.0 dont accept \setupbodyfont[free, 16pt]

rb

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] MKIV, fonts, confusion

2009-05-14 Thread Khaled Hosny
On Thu, May 14, 2009 at 11:03:10AM +0200, luigi scarso wrote:
 $pdffonts felltype.pdf
 name  
    type  emb sub uni object ID
  - --- --- --- -
 PDPWHW+LMRoman12-Regular CID Type 0C   yes yes yes  4  0
 DUTOMC+IM_FELL_Double_Pica_PRO_Roman CID Type 0C   yes yes yes  5  0
 
 $pdffonts felltype_oo.pdf
 name type  emb sub uni object ID
  - --- --- --- -
 FTLUYL+IM_FELL_Double_Pica_PRO_Roman Type 1C   yes yes no   8  0
 FTLUYL+IM_FELL_Double_Pica_PRO_Roman Type 1C
 
 So I don't understand how OO transform this opentype in a Type1 ,
 and if is it possible to do  the same thing in mkiv.

Not only OOo, InDesign does that too, moreover, someone said even if
LuaTeX (XeTeX too) output looked OK in Adobe reader 7, the print isn't
OK.


-- 
 Khaled Hosny
 Arabic localiser and member of Arabeyes.org team
 Free font developer


signature.asc
Description: Digital signature
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] MKIV, fonts, confusion

2009-05-14 Thread Arthur Reutenauer
 Not only OOo, InDesign does that too, moreover, someone said even if
 LuaTeX (XeTeX too) output looked OK in Adobe reader 7, the print isn't
 OK.

  On what printer?  It's probably a bug in the driver, too.  LuaTeX does
exactly according to specification, I discussed this strategy with Taco
years ago.  I suppose XeTeX does conform, too, and it came to that
arrangement independently.  It's really sad that Adobe does not conform
to its own specifications.

Arthur
___
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] OpenType Features

2009-05-14 Thread Arun Dev
Hello,

   I am using Context Mark II + XeTeX. I would like to know the
following things.

1. How to use opentype font features. I tried the following code but it is
not working.
  \definefontfeature[myfontfea][+onum]
  \definetypeface[Libertine][rm][Xserif][Linux Libertine
O][default][features=myfontfea]
  \setupbodyfont[Libertine,12pt]

2. Is there an eqivalent code to the following XeLaTeX code.
  \defaultfontfeatures{Scale=MatchLowercase}

3. How to use Cambria Math font to typeset math.
___
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] OpenType Features

2009-05-14 Thread Hans Hagen

Arun Dev wrote:

Hello,

   I am using Context Mark II + XeTeX. I would like to know the
following things.

1. How to use opentype font features. I tried the following code but it is
not working.
  \definefontfeature[myfontfea][+onum]
  \definetypeface[Libertine][rm][Xserif][Linux Libertine
O][default][features=myfontfea]
  \setupbodyfont[Libertine,12pt]


\definefontfeature[myfontfea][onum=yes]



2. Is there an eqivalent code to the following XeLaTeX code.
  \defaultfontfeatures{Scale=MatchLowercase}


i have no clue what that is supposed to do


3. How to use Cambria Math font to typeset math.


\usetypescript[cambria] \setupbodyfont[cambria]

but only in mkiv

-
  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] OpenType Features

2009-05-14 Thread Wolfgang Schuster

You asked the same questions a few days ago, what's your problem
with the answers you got last time?

Wolfgang


Am 14.05.2009 um 14:18 schrieb Arun Dev:



Hello,

   I am using Context Mark II + XeTeX. I would like to know the  
following things.


1. How to use opentype font features. I tried the following code but  
it is not working.

  \definefontfeature[myfontfea][+onum]
  \definetypeface[Libertine][rm][Xserif][Linux Libertine O][default] 
[features=myfontfea]

  \setupbodyfont[Libertine,12pt]

2. Is there an eqivalent code to the following XeLaTeX code.
  \defaultfontfeatures{Scale=MatchLowercase}
3. How to use Cambria Math font to typeset math.


___
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-13 Thread Yue Wang
I can confirm that I am wrong.

2009/5/13 Yue Wang yuleo...@gmail.com:
 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
___


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

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

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

some of that activation can involve things that set up the font (some
related properties) so the mechanism is kind of generic; at that point
it is not possible to determine what is relevant and what not

changing such things at frst sight might lead to unexpected side effects
later on (as the context history has proven)

although part of the activation code can be disables when defining a
sequence of fonts (as in a massive switch) it would complicate the font
code even more to do so; in mkiv we do need less of that as explained
below (hence the remark 'not needed in luatex')

for instance, we can redefine (for xetex)

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

\def\setfontcharacteristics
  {%\updatefontparameters % redundant, will go away, faster too
   \the\everyfont
   \synchronizepatternswithfont}

Which is faster,  but then we also need to make absolutely sure that
xetex only uses opentype fonts (which in turn means that we need to
provide separate typescript files for xetex to make sure that this
happens); this can be significant on a 10 second job with 10K switches,
but less in a complex document that takes 2 minutes to process, or as we
sometimes had, 20 minute jobs

Another option is to make all sizes (\tf*) optional, which then would
force a typeface switch in heads which in turn slows down things at that
end, or you could disable bigmath (that follows the sizes) and then end
 up with mails to this list why math does not scale in titles, etc etc

 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.

You make it sound as all of the font system's features are kind of wrong
and contain oversights ... i'm not going to enter a discussion about the
how and why of the context way of doing things as it is a accumulation
of over 15 years of development and experients and realistic typesetting
situations. We're not that stupid.

In mkii (and to a lesser extent in mkiv) we have to deal with several
situations:

Fonts have 256 chars at most so they cannot cover each language. This
means that when one mixes languages, one also might need multiple fonts.
 For instance using two complete different typefaces, one with ec
encoding, another with texnansi encoding and both with different math
fonts also in a different encoding is happing at our end.

As fonts encodings are related to hyphenation, there is a relationship
between a font switch and a language switch i.e. when we're typesetting
in czech it might be that a font switch also results in a patterns
switch due to the fact that patterns relate to fonts. The fact that CJK
does not hyphenate is no reason to remove that feature from the font
system. I know that the latex way of doing things is to replace and
redefine core code for specific purposes, but that's not the way we do
things in context. In my own usage i just accepted

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

2009-05-13 Thread Thomas A. Schmitz


On May 13, 2009, at 1:28 PM, Wolfgang Schuster wrote:


(Just thinking alound: aren't there plenty of books around that also
mix lots of greek and latin, possibly using different fonts for them?
How do they deal with the problem, or is the problem just
neglectable?)


Dunno, AFAIR Thomas use switch to a different font in his greek  
module,

in mkiv this is trivia with font fallbacks.

Wolfgang


Just FYI: yes, I do use switchtobodyfont in my Greek module, but I  
have more or less given up on XeTeX, so I've never encountered the  
problem. The font fallback is great for filling in some glyphs, but I  
haven't yet used it for entire Greek passages; haven't yet seen the  
advantage over switching the bodyfont.


All best

Thomas
___
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] MKIV, fonts, confusion

2009-05-13 Thread afsmith
Hi ntg-context.

I'm very confused about accomplishing something that to me seems as
though it should be quite simple, but has proven for weeks of
occasional attempts to be very confusing. I'm finding existing
information from the contextgarden wiki and ntg-context archives to be
very newbie-unfriendly and inconsistent.
I'm compelled to improve the wiki, if only I could comprehend what I
would be documenting.

What I would like to do is use the full range of TeX-Gyre fonts (and
later possibly others) for my existing documents.
It is not clear to me...
Whether or not I am using MKIV, nor how to determine which engine I am running.
If not running MKIV/XeTeX, how to determine which fonts are installed.
What the items from the output of fc-list or mtxrun --script fonts
--list correspond to.
How to use available fonts, nor where to draw valid parameters from
for use in font commands.
How to determine what font configurations are available for a given font.
Whether I need to write typescripts, nor how to find any existing ones.
Whether I need to concern myself with .map or any other font files.
Whether I need to configure anything, move any files, etcetera.
...As well as anything else I might need to install or use a font

For what it's worth, I have been using the command texexec to
process my tex files, am using a context minimals downloaded about two
months ago, and am running Linux.
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] MKIV, fonts, confusion

2009-05-13 Thread Hans Hagen

afsmith wrote:

Hi ntg-context.

I'm very confused about accomplishing something that to me seems as
though it should be quite simple, but has proven for weeks of
occasional attempts to be very confusing. I'm finding existing
information from the contextgarden wiki and ntg-context archives to be
very newbie-unfriendly and inconsistent.
I'm compelled to improve the wiki, if only I could comprehend what I
would be documenting.

What I would like to do is use the full range of TeX-Gyre fonts (and
later possibly others) for my existing documents.
It is not clear to me...
Whether or not I am using MKIV, nor how to determine which engine I am running.
If not running MKIV/XeTeX, how to determine which fonts are installed.
What the items from the output of fc-list or mtxrun --script fonts
--list correspond to.
How to use available fonts, nor where to draw valid parameters from
for use in font commands.
How to determine what font configurations are available for a given font.
Whether I need to write typescripts, nor how to find any existing ones.
Whether I need to concern myself with .map or any other font files.
Whether I need to configure anything, move any files, etcetera.
As well as anything else I might need to install or use a font

For what it's worth, I have been using the command texexec to
process my tex files, am using a context minimals downloaded about two
months ago, and am running Linux.


it depends on you language ...

the main complication with fonts is that in traditional tex there are 
only 256 slots in a font available


also, fonts relate to hyphenation

another complication is that traditional tex fonts come in design sizes

and yet another one is that we have math

and also in traditional tex fonts it vs sl

so, this is why a traditional tex font system is somewhat complex 
because it operates on several exis


now, for english you can ignore encoding issues but not for other languages

using the gyre fonts is not that complex as one of the objectives of the 
project is to provide consistent sets of fonts


\usetypescript[palatino][ec] % pdftex, one needs to choose an encoding

\usetypescript[palatino] % luatex, no encoding since unicode

and then

\setupbodyfont[palatino]

should for instance give you palatino

things like open type features etc etc demand some more knowledge as 
fonts differ considerably in this areas as well as can contain bugs or 
inconsistencies


if you ever have to use commercial fonts .. be prepared ... an even 
bigger mess is awaiting you since naming of files and fonts is often 
quite strange



-
  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 III: Wrong hyperlink

2009-05-13 Thread Yue Wang
oh, no. better change that to this:
/XYZ @xpos @ypos 0
so xetex and pdftex/luatex will share the same behavior. (it point to
the place a little bit lower, so the behavior is much better than fit)
as to the wrong destination.. I highly suspect that the PDF /Dests is
written right after the box, not before the box.


On Wed, May 13, 2009 at 1:37 AM, Hans Hagen pra...@wxs.nl wrote:
 Yue Wang wrote:

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

 well, so be it .. i have no time now to look into xyz placement

 btw, in ConTeXt's pdftex or luatex mode, it also point to the wrong place.
 but Eplain and LaTeX hyperref handle that right...

 as Chof pointed out, it also relates a bit to how the viewer shows the page

 i tested the fixes for pdftex/xetex and it seems to work ok now

 Hans

 -
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
 -

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] MKIV, fonts, confusion

2009-05-13 Thread afsmith
Luigi, Hans, and Wolfgang, thank you for your responses. I'm still
unclear on several things. (comments on your responses follow
afterwards)

Let me try asking these things as questions. Specifically, could
someone please tell me...
1. How do I determine whether I am using MKII, MKIV, or XeTeX to
process my documents?
2. Given the line from a typescript...
\definefontsynonym[LiberationSerif] [name:liberationserif]
... how do I determine which file name:liberationserif corresponds to?
3. In both MKII and MKIV, how can I determine which typescripts exist?
In other words, how do I determine working arguments for
\usetypescriptfile?
3b. Specifically, in the case of...
\usetypescript[palatino][ec]
... in which typescript is this defined? (given a vanilla context
minimals installation)
4. What defines the output of fc-list or mtxrun --script fonts
--list? Do they correspond to files? Type synonyms? etc.
5. Do I need to bother with map files for MKII?
6. Is it particularly recommended that I use MKIV? How stable is it
compared to MKII?

Luigi, what do you mean by and look into base/*? Which 'base'? Are
you talking about in the context minimals distribution? some specific
online repository? I have seen the two documents you mentioned.
Re-reading them has clarified things a little bit.

Wolfgang,
Currently the module you linked to
(http://bitbucket.org/wolfs/simplefonts/) is beyond my
understanding... I would first like to understand the mechanism your
module operates on before trying to automate it.

Hans,
I am aware that there are such types of parameters that must be
defined for fonts. I understand 'it is complicated' but this does not
really help make things clearer to me. The inner workings of fonts are
of little concern to me to me at the moment. Right now I do not even
know where to look. I have seen the examples you gave for palatino,
such as...
\usetypescript[palatino][ec]
...but I have no idea where those arguments come from

Thanks.


On 5/13/09, afsmith adventurecompl...@gmail.com wrote:
...
 What I would like to do is use the full range of TeX-Gyre fonts (and
 later possibly others) for my existing documents.
 It is not clear to me...
 Whether or not I am using MKIV, nor how to determine which engine I am
 running.
 If not running MKIV/XeTeX, how to determine which fonts are installed.
 What the items from the output of fc-list or mtxrun --script fonts
 --list correspond to.
 How to use available fonts, nor where to draw valid parameters from
 for use in font commands.
 How to determine what font configurations are available for a given font.
 Whether I need to write typescripts, nor how to find any existing ones.
 Whether I need to concern myself with .map or any other font files.
 Whether I need to configure anything, move any files, etcetera.
 ...As well as anything else I might need to install or use a font

 For what it's worth, I have been using the command texexec to
 process my tex files, am using a context minimals downloaded about two
 months ago, and am running Linux.
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] MKIV, fonts, confusion

2009-05-13 Thread Hans Hagen

afsmith wrote:

Luigi, Hans, and Wolfgang, thank you for your responses. I'm still
unclear on several things. (comments on your responses follow
afterwards)

Let me try asking these things as questions. Specifically, could
someone please tell me...
1. How do I determine whether I am using MKII, MKIV, or XeTeX to
process my documents?


\doifmode {mkiv} { ... }

\ifnum\texengine=\xetexengine .. \fi

mkiv only run son top of luatex (and the context command replaces 
texexec there)



2. Given the line from a typescript...
\definefontsynonym[LiberationSerif] [name:liberationserif]
 how do I determine which file name:liberationserif corresponds to?


not relevant since name will sort that out (given that the name is ok)


3. In both MKII and MKIV, how can I determine which typescripts exist?
In other words, how do I determine working arguments for
\usetypescriptfile?


by looking at the file, but at some point i expect users to switch to 
mkiv so if mkiv works for your document, then forget about mkii



3b. Specifically, in the case of...
\usetypescript[palatino][ec]
 in which typescript is this defined? (given a vanilla context
minimals installation)


that one in type-one (type one font)


4. What defines the output of fc-list or mtxrun --script fonts
--list? Do they correspond to files? Type synonyms? etc.


mkiv does not use fc-list and as fc-list does not work on my machine i 
have no clue



5. Do I need to bother with map files for MKII?


normally the typescript handles that


6. Is it particularly recommended that I use MKIV? How stable is it
compared to MKII?


depends on your document; currently somewhat in flux due to 
reimplementing structure but that will stabelize



Luigi, what do you mean by and look into base/*? Which 'base'? Are
you talking about in the context minimals distribution? some specific
online repository? I have seen the two documents you mentioned.
Re-reading them has clarified things a little bit.


tex/context/base


Wolfgang,
Currently the module you linked to
(http://bitbucket.org/wolfs/simplefonts/) is beyond my
understanding... I would first like to understand the mechanism your
module operates on before trying to automate it.

Hans,
I am aware that there are such types of parameters that must be
defined for fonts. I understand 'it is complicated' but this does not
really help make things clearer to me. The inner workings of fonts are
of little concern to me to me at the moment. Right now I do not even
know where to look. I have seen the examples you gave for palatino,
such as...
\usetypescript[palatino][ec]
but I have no idea where those arguments come from


well, palatino is defined in type-one

if ec makes no sense to you, then just use it (polish use qx, i use 
texnansi, etc ... it depends on the language you use and for english it 
hardly matters)


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] MKIV, fonts, confusion

2009-05-13 Thread Aditya Mahajan

On Wed, 13 May 2009, afsmith wrote:


Luigi, Hans, and Wolfgang, thank you for your responses. I'm still
unclear on several things. (comments on your responses follow
afterwards)

Let me try asking these things as questions. Specifically, could
someone please tell me...
1. How do I determine whether I am using MKII, MKIV, or XeTeX to
process my documents?


Depends on how you process your documents.

texexec filename= pdftex engine (mkii)
texexec --pdf filename  = pdftex engine (mkii)
texexec --xtx filename  = xetex engine  (mkii)
texexec --lua filename  = luatex engine (mkiv)
context filename= luatex engine (mkiv)


2. Given the line from a typescript...
\definefontsynonym[LiberationSerif] [name:liberationserif]
... how do I determine which file name:liberationserif corresponds to?


mtxrun --script font --list *liberation*

On my machine this gives

liberationmonobold Liberation Mono Bold 
/usr/share/fonts/TTF/LiberationMono-Bold.ttf
liberationmonobolditalic   Liberation Mono Bold Italic 
/usr/share/fonts/TTF/LiberationMono-BoldItalic.ttf
liberationmonoitalic   Liberation Mono Italic 
/usr/share/fonts/TTF/LiberationMono-Italic.ttf
liberationmonoregular  Liberation Mono Regular 
/usr/share/fonts/TTF/LiberationMono-Regular.ttf
liberationsansbold Liberation Sans Bold 
/usr/share/fonts/TTF/LiberationSans-Bold.ttf
liberationsansbolditalic   Liberation Sans Bold Italic 
/usr/share/fonts/TTF/LiberationSans-BoldItalic.ttf
liberationsansitalic   Liberation Sans Italic 
/usr/share/fonts/TTF/LiberationSans-Italic.ttf
liberationsansregular  Liberation Sans Regular 
/usr/share/fonts/TTF/LiberationSans-Regular.ttf
liberationserifboldLiberation Serif Bold 
/usr/share/fonts/TTF/LiberationSerif-Bold.ttf
liberationserifbolditalic  Liberation Serif Bold Italic 
/usr/share/fonts/TTF/LiberationSerif-BoldItalic.ttf
liberationserifitalic  Liberation Serif Italic 
/usr/share/fonts/TTF/LiberationSerif-Italic.ttf
liberationserifregular Liberation Serif Regular 
/usr/share/fonts/TTF/LiberationSerif-Regular.ttf



3. In both MKII and MKIV, how can I determine which typescripts exist?
In other words, how do I determine working arguments for
\usetypescriptfile?


ls $TEXMFCONTEXT/tex/context/base/type-*


3b. Specifically, in the case of...
\usetypescript[palatino][ec]
... in which typescript is this defined? (given a vanilla context
minimals installation)


type-one.tex for mkii, type-otf.tex for mkiv.


4. What defines the output of fc-list or mtxrun --script fonts
--list? Do they correspond to files? Type synonyms? etc.


mtxrun --script fonts lists fonts in $TEXMF/fonts/ and $OSFONTDIR.


5. Do I need to bother with map files for MKII?


No. Unless you want to create a typescript for font not present in the 
minimals and ctan.



6. Is it particularly recommended that I use MKIV? How stable is it
compared to MKII?


Mkii is extremely stable and well tested. Mkiv is in a state of flux right 
now. If you do not need any of the features of luatex (opentype fonts, 
ease of programming, etc.) stay with mkii for the time being. If you want 
to use luatex features, then you have to use Mkiv :-)



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] MKIV, fonts, confusion

2009-05-13 Thread Wolfgang Schuster


Am 13.05.2009 um 22:23 schrieb Aditya Mahajan:


On Wed, 13 May 2009, afsmith wrote:


Let me try asking these things as questions. Specifically, could
someone please tell me...
1. How do I determine whether I am using MKII, MKIV, or XeTeX to
process my documents?


Depends on how you process your documents.

texexec filename= pdftex engine (mkii)
texexec --pdf filename  = pdftex engine (mkii)
texexec --xtx filename  = xetex engine  (mkii)
texexec --lua filename  = luatex engine (mkiv)
context filename= luatex engine (mkiv)


context --pdftex filename = pdftex engine (mkii)
context --xetex filename  = xetex engine  (mkii)

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] MKIV, fonts, confusion

2009-05-13 Thread Mohamed Bana
if you don't require anything completex 
http://github.com/contextgarden/otfinstall/tree/master automates a lot 
of the tasks required in installing a font in mkii.


afsmith wrote:

Luigi, Hans, and Wolfgang, thank you for your responses. I'm still
unclear on several things. (comments on your responses follow
afterwards)

Let me try asking these things as questions. Specifically, could
someone please tell me...
1. How do I determine whether I am using MKII, MKIV, or XeTeX to
process my documents?


I tend to use

\begin{XETEX,OLDTEX,LUATEX}
...
\end{XETEX,OLDTEX,LUATEX}


2. Given the line from a typescript...
\definefontsynonym[LiberationSerif] [name:liberationserif]
... how do I determine which file name:liberationserif corresponds to?
3. In both MKII and MKIV, how can I determine which typescripts exist?
In other words, how do I determine working arguments for
\usetypescriptfile?
3b. Specifically, in the case of...
\usetypescript[palatino][ec]
... in which typescript is this defined? (given a vanilla context
minimals installation)
4. What defines the output of fc-list or mtxrun --script fonts
--list? Do they correspond to files? Type synonyms? etc.


fc-list also looks in $HOME/.fonts/


5. Do I need to bother with map files for MKII?
6. Is it particularly recommended that I use MKIV? How stable is it
compared to MKII?

Luigi, what do you mean by and look into base/*? Which 'base'? Are
you talking about in the context minimals distribution? some specific
online repository? I have seen the two documents you mentioned.
Re-reading them has clarified things a little bit.

Wolfgang,
Currently the module you linked to
(http://bitbucket.org/wolfs/simplefonts/) is beyond my
understanding... I would first like to understand the mechanism your
module operates on before trying to automate it.

Hans,
I am aware that there are such types of parameters that must be
defined for fonts. I understand 'it is complicated' but this does not
really help make things clearer to me. The inner workings of fonts are
of little concern to me to me at the moment. Right now I do not even
know where to look. I have seen the examples you gave for palatino,
such as...
\usetypescript[palatino][ec]
...but I have no idea where those arguments come from

Thanks.


On 5/13/09, afsmith adventurecompl...@gmail.com wrote:
...

What I would like to do is use the full range of TeX-Gyre fonts (and
later possibly others) for my existing documents.
It is not clear to me...
Whether or not I am using MKIV, nor how to determine which engine I am
running.
If not running MKIV/XeTeX, how to determine which fonts are installed.
What the items from the output of fc-list or mtxrun --script fonts
--list correspond to.
How to use available fonts, nor where to draw valid parameters from
for use in font commands.
How to determine what font configurations are available for a given font.
Whether I need to write typescripts, nor how to find any existing ones.
Whether I need to concern myself with .map or any other font files.
Whether I need to configure anything, move any files, etcetera.
...As well as anything else I might need to install or use a font

For what it's worth, I have been using the command texexec to
process my tex files, am using a context minimals downloaded about two
months ago, and am running Linux.

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


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


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

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

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


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


[NTG-context] Opentype features

2009-05-11 Thread Arun Dev
Hello,

   I am using Context Mark II + XeTeX. I would like to know the
following things.

1. How to use opentype font features. I tried the following code but it is
not working.
  \definefontfeature[myfontfea][+onum]
  \definetypeface[Libertine][rm][Xserif][Linux Libertine
O][default][features=myfontfea]
  \setupbodyfont[Libertine,12pt]

2. Is there an eqivalent code to the following XeLaTeX code.
  \defaultfontfeatures{Scale=MatchLowercase}

3. How to use Cambria Math font to typeset math.
___
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] Capital number when onum=yes?

2009-05-11 Thread Thomas A. Schmitz


On May 11, 2009, at 4:05 AM, Corsair wrote:


Ok.  Sorry for the vagueness.  I use Adobe Caslon Pro as my body font,
with XeTeX.  And I enable the `onum' feature so that all numbers in my
document appear as old-style numbers, which is good.  But I also
prefer some of them use the normal capital number glyphs, for example,
in page numbers.  How can I do that?


Not sure if this is the canonical way, but here's how I do it: If I  
have onum=yes enabled for my normal Roman font, I disable it for my  
smallcaps variant and set page numbers etc as \sc. Or am I  
misunderstanding something?


Thomas
___
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] Opentype features

2009-05-11 Thread Wolfgang Schuster


Am 10.05.2009 um 14:52 schrieb Arun Dev:


Hello,

I am using Context Mark II + XeTeX. I would like to know the  
following things.


1. How to use opentype font features. I tried the following code but  
it is not working.


  \definefontfeature[myfontfea][+onum]
  \definetypeface[Libertine][rm][Xserif][Linux Libertine O][default] 
[features=myfontfea]

   \setupbodyfont[Libertine,12pt]


\definefontfeature[default][default][onum=yes]
\definetypeface[Libertine][rm][Xserif][Linux Libertine O][default]
\setupbodyfont[Libertine]


2. Is there an eqivalent code to the following XeLaTeX code.

  \defaultfontfeatures{Scale=MatchLowercase}


Only when you port the fontspec package to ConTeXt.


3. How to use Cambria Math font to typeset math.


MkII (XeTeX): Write the code to use OpenType math fonts and send it to  
Hans.


MkIV (LuaTeX): \definetypeface[Libertine][mm][math][cambria][default]

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] Capital number when onum=yes?

2009-05-11 Thread Henning Hraban Ramm

Am 2009-05-11 um 08:13 schrieb Thomas A. Schmitz:

Ok.  Sorry for the vagueness.  I use Adobe Caslon Pro as my body  
font,
with XeTeX.  And I enable the `onum' feature so that all numbers in  
my

document appear as old-style numbers, which is good.  But I also
prefer some of them use the normal capital number glyphs, for  
example,

in page numbers.  How can I do that?


Not sure if this is the canonical way, but here's how I do it: If I  
have onum=yes enabled for my normal Roman font, I disable it for my  
smallcaps variant and set page numbers etc as \sc. Or am I  
misunderstanding something?


Similarly you could define an additional variant, like noos.
http://wiki.contextgarden.net/Font_Variants

(Didn't check if font variants work ok in MkIV; I used them only for  
light and medium weights before.)


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] Capital number when onum=yes?

2009-05-11 Thread Thomas A. Schmitz


On May 11, 2009, at 8:39 AM, Corsair wrote:


Thanks you for the reply!  But it doesn't work for me, because small
cap numbers in Adobe Caslon Pro are themselves old-style...


I don't use XeTeX, but this works in mkiv:

\definefontfeature
  [mydefault]
   
[mode 
= 
node 
,script=latn,language=dflt,liga=yes,onum=yes,kern=yes,tlig=yes,trep=yes]


\definefontfeature
  [mycaps]
   
[mode 
=node,script=latn,language=dflt,liga=yes,lnum=yes,kern=yes,smcp=yes]


\starttypescript [serif] [caslon]
  \definefontsynonym [Caslon-Roman]   
[name:acaslonproregular]  [features=mydefault]
  \definefontsynonym [Caslon-Bold]   [name:acaslonprobold]   
[features=mydefault]
  \definefontsynonym [Caslon-Italic] [name:acaslonproitalic]   
[features=mydefault]
  \definefontsynonym [Caslon-Bold-Italic] 
[name:acaslonprobolditalic] [features=mydefault]
  \definefontsynonym [Caslon-SmallCaps]   
[name:acaslonproregular]  [features=mycaps]

 \stoptypescript

\starttypescript [serif] [caslon]
  \definefontsynonym [Serif]   [Caslon-Roman]  
[features=mydefault]
  \definefontsynonym [SerifItalic] [Caslon-Italic]  
[features=mydefault]
  \definefontsynonym [SerifBold]   [Caslon-Bold]  
[features=mydefault]
  \definefontsynonym [SerifBoldItalic] [Caslon-Bold-Italic]  
[features=mydefault]
  \definefontsynonym [SerifCaps]   [Caslon-SmallCaps]  
[features=mycaps]

\stoptypescript

\starttypescript [Caslon]
  \definetypeface [Caslon] [rm] [serif] [caslon] [default]
\stoptypescript

\usetypescript[Caslon]
\setupbodyfont[Caslon,12pt]

\starttext

These are oldstyle: 1 2 3 4 5 6 7 8 9 0

{\sc These are not: 1 2 3 4 5 6 7 8 9 0}

\stoptext

HTH

Thomas
___
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] Capital number when onum=yes?

2009-05-11 Thread Corsair
On Mon, May 11, 2009 at 08:37:46AM +0200, Henning Hraban Ramm wrote:
 Am 2009-05-11 um 08:13 schrieb Thomas A. Schmitz:
 
  Ok.  Sorry for the vagueness.  I use Adobe Caslon Pro as my body  
  font,
  with XeTeX.  And I enable the `onum' feature so that all numbers in  
  my
  document appear as old-style numbers, which is good.  But I also
  prefer some of them use the normal capital number glyphs, for  
  example,
  in page numbers.  How can I do that?
 
  Not sure if this is the canonical way, but here's how I do it: If I  
  have onum=yes enabled for my normal Roman font, I disable it for my  
  smallcaps variant and set page numbers etc as \sc. Or am I  
  misunderstanding something?
 
 Similarly you could define an additional variant, like noos.
 http://wiki.contextgarden.net/Font_Variants
 
 (Didn't check if font variants work ok in MkIV; I used them only for  
 light and medium weights before.)
 
Wow, I didn't know about this one.  I'll see what I can do with it.

Thank you!

-- 
There is no emotion; there is peace.
There is no ignorance; there is knowledge.
There is no passion; there is serenity.
There is no death; there is the Force.


pgpXYyrAnk6Da.pgp
Description: PGP signature
___
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] Capital number when onum=yes?

2009-05-11 Thread Hans Hagen

Corsair wrote:

On Sun, May 10, 2009 at 09:44:58PM +0200, Hans Hagen wrote:

Corsair wrote:

Hi all,

I have `onum=yes' in my font features and it works great.  But how can
I type a capital number in this case?  I want to use capital numbers
in pagenumbers.

can you be a bit more explicit?

to what extend smallcaps are implemented is font dependent


Ok.  Sorry for the vagueness.  I use Adobe Caslon Pro as my body font,
with XeTeX.  And I enable the `onum' feature so that all numbers in my
document appear as old-style numbers, which is good.  But I also
prefer some of them use the normal capital number glyphs, for example,
in page numbers.  How can I do that?


you can try {\subff{oldstyle} 123} (this is kind of experimental and in 
testing by idris)


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] Opentype features

2009-05-11 Thread Hans Hagen

Wolfgang Schuster wrote:


2. Is there an eqivalent code to the following XeLaTeX code.

  \defaultfontfeatures{Scale=MatchLowercase}


Only when you port the fontspec package to ConTeXt.


i can not even imagine what it is supposed to mean -)


3. How to use Cambria Math font to typeset math.


MkII (XeTeX): Write the code to use OpenType math fonts and send it to 
Hans.


open type math in mkii is unlikely to happen soon (ok, at some point i 
can just generate the symbol etc initializations from the mkiv lua 
tables but it has a very low priority)


in mkiv there is some trickery that cannot be ported and i'm not going 
to cripple new (otf math related code) by fuzzy sharing with mkii



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] Opentype features

2009-05-11 Thread Wolfgang Schuster


Am 11.05.2009 um 09:37 schrieb Hans Hagen:


Wolfgang Schuster wrote:


2. Is there an eqivalent code to the following XeLaTeX code.

 \defaultfontfeatures{Scale=MatchLowercase}


Only when you port the fontspec package to ConTeXt.


i can not even imagine what it is supposed to mean -)


Write a module which has the same functionality as the fontspec  
package for XeLaTeX.


http://www.ctan.org/get/macros/xetex/latex/fontspec/fontspec.pdf

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] Font switching question

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

I am working on Chinese support on XeTeX/ConTeXt and I almost finished
that. I will later upload a module called t-zhspacing to the garden
(or CTAN?). But there is one last problem. Let me explain like this.

Suppost I have two typescripts (typeA and typeB) and both with
complete typeface defined (rm/ss/tt, bf/it/bfit/smcp)

Now I want to do something like this:

\usetypescript[typeA]
\usetypescript[typeB]
\setupbodyfont[typeA]
This should be typeA/rm/normal \it and this should be typeA/rm/it \ss
and this should be typeA/ss/it %here everything is ok in context
\typeB this should be typeB/ss/it %(but context gives me
typeB/rm/normal. How can I automatically get what I want?)

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

2009-05-11 Thread 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?

Yue Wang

On Mon, May 11, 2009 at 8:23 PM, Wolfgang Schuster
schuster.wolfg...@googlemail.com wrote:
 Hi all,

 I wrote a new module to load fonts without the need to write typescripts
 for them - http://bitbucket.org/wolfs/simplefonts/

 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
 ___

___
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-11 Thread Hans Hagen

Wolfgang Schuster wrote:


possible yes but it's a lot of work because the complete fallback mechanism
needs to be written for XeTeX which is available for MkIV since a while.


this is unlikely to happen (unless we add lots of optional code to mkii 
to deal with xetex which then probably results in a lot of other code 
hooked into other mechanisms as well) as mkii is kind of frozen


if we have to port all sophisticated (upcoming) mkiv features back to 
mkiv we might wonder why we started with mkiv in the first place; the 
whole idea is to have less (complex) code


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

2009-05-11 Thread Yue Wang
On Mon, May 11, 2009 at 9:48 PM, Hans Hagen pra...@wxs.nl wrote:
 Wolfgang Schuster wrote:

 possible yes but it's a lot of work because the complete fallback
 mechanism
 needs to be written for XeTeX which is available for MkIV since a while.

 this is unlikely to happen (unless we add lots of optional code to mkii to
 deal with xetex which then probably results in a lot of other code hooked
 into other mechanisms as well) as mkii is kind of frozen

 if we have to port all sophisticated (upcoming) mkiv features back to mkiv
 we might wonder why we started with mkiv in the first place; the whole idea
 is to have less (complex) code


not like that complicated (we do not need font fallback).

it is only something about:

save the current font style (like \ss, \it ,10pt) to a macro . then
apply the macro to a group.
for example

aa { \anotherfont bb}
we should save the style for aa when \anotherfont is called, and apply
that style to bb.

that should be enough. but we don't know how to get the font style.



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

2009-05-11 Thread Hans Hagen

Yue Wang wrote:

On Mon, May 11, 2009 at 9:48 PM, Hans Hagen pra...@wxs.nl wrote:

Wolfgang Schuster wrote:


possible yes but it's a lot of work because the complete fallback
mechanism
needs to be written for XeTeX which is available for MkIV since a while.

this is unlikely to happen (unless we add lots of optional code to mkii to
deal with xetex which then probably results in a lot of other code hooked
into other mechanisms as well) as mkii is kind of frozen

if we have to port all sophisticated (upcoming) mkiv features back to mkiv
we might wonder why we started with mkiv in the first place; the whole idea
is to have less (complex) code



not like that complicated (we do not need font fallback).

it is only something about:

save the current font style (like \ss, \it ,10pt) to a macro . then
apply the macro to a group.
for example

aa { \anotherfont bb}
we should save the style for aa when \anotherfont is called, and apply
that style to bb.

that should be enough. but we don't know how to get the font style.


see \pushcurrentfont

-
  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] Font switching question

2009-05-11 Thread Yue Wang
Hi Hans:

let me give a better explanation.

we define a typescript foobar. so we can call  \foobar to load the
foobar typeface.
then we should define a macro like this:
\def\switchtofoobar{\savecurrentstyle\foobar\getcurrentstyle}
and call it like that:

text 1 {\swichtofoobar text2} text 3
when \savecurrentstyle is called, it define a macro named
\getcurrentstyle in order to save the style of text 1 (like \ss\it,
10pt) into that. that's all we want.

So it's not complicated to do so as font fallback.
(we already done that in latex, but don't know how to do that in
ConTeXt due to lack of knowledge of font mechanism)

Yue Wang

On Mon, May 11, 2009 at 8:08 PM, Yue Wang yuleo...@gmail.com wrote:
 Hi, Hans:

 I am working on Chinese support on XeTeX/ConTeXt and I almost finished
 that. I will later upload a module called t-zhspacing to the garden
 (or CTAN?). But there is one last problem. Let me explain like this.

 Suppost I have two typescripts (typeA and typeB) and both with
 complete typeface defined (rm/ss/tt, bf/it/bfit/smcp)

 Now I want to do something like this:

 \usetypescript[typeA]
 \usetypescript[typeB]
 \setupbodyfont[typeA]
 This should be typeA/rm/normal \it and this should be typeA/rm/it \ss
 and this should be typeA/ss/it %here everything is ok in context
 \typeB this should be typeB/ss/it %(but context gives me
 typeB/rm/normal. How can I automatically get what I want?)

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

2009-05-11 Thread Yue Wang
On Mon, May 11, 2009 at 10:33 PM, Hans Hagen pra...@wxs.nl wrote:
 Yue Wang wrote:

 On Mon, May 11, 2009 at 9:48 PM, Hans Hagen pra...@wxs.nl wrote:

 Wolfgang Schuster wrote:

 possible yes but it's a lot of work because the complete fallback
 mechanism
 needs to be written for XeTeX which is available for MkIV since a while.

 this is unlikely to happen (unless we add lots of optional code to mkii
 to
 deal with xetex which then probably results in a lot of other code hooked
 into other mechanisms as well) as mkii is kind of frozen

 if we have to port all sophisticated (upcoming) mkiv features back to
 mkiv
 we might wonder why we started with mkiv in the first place; the whole
 idea
 is to have less (complex) code


 not like that complicated (we do not need font fallback).

 it is only something about:

 save the current font style (like \ss, \it ,10pt) to a macro . then
 apply the macro to a group.
 for example

 aa { \anotherfont bb}
 we should save the style for aa when \anotherfont is called, and apply
 that style to bb.

 that should be enough. but we don't know how to get the font style.

 see \pushcurrentfont

Thank you, I will look into that.

Many thanks:)


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


[NTG-context] New module t-zhspacing

2009-05-11 Thread Yue Wang
Dear list:

Chinese TeX Society is proud to announce the t-zhspacing module to the
ConTeXt society.
The module is developed by Yue Wang based on Yin Dian's zhspacing.sty
macro package and Jonathan Kew's unicode-letters.tex + xetex
interchartoks mechanism.
It is designed for the audience who interested perfect Chinese
typesetting using ConTeXt and XeTeX.
It handles Chinese font loading, switching, line breaking, and
punctuation compression rules quite well.
Moreover, since the freetype's performance is much better than
fontforge's on large cjk fonts, so the document compilation can be
much faster.
Users are free to visit http://code.google.com/p/ctex-kit/, and the
code is in svn  (the trunk/zhspacing directory) now.
Last but not least, we should thank Hans and Wolfgang since they help
us a lot to make the module possible :)

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] New module t-zhspacing

2009-05-11 Thread Yue Wang
Hi.

now the module uses \switchtobodyfont[foobar] to switch the typeface
which is not fast enough. in fact \foobar is the right way. I will
make a commit tomorrow to speed up the font switching.

By the way, After I finish the module, who should I turn to for submitting?
Hans, the garden, or CTAN? Thanks.
If Hans or the garden are the right person/place for submitting, are
there some coding/documentation rules to follow? Thanks.

Yue Wang


On Mon, May 11, 2009 at 10:55 PM, Yue Wang yuleo...@gmail.com wrote:
 Dear list:

 Chinese TeX Society is proud to announce the t-zhspacing module to the
 ConTeXt society.
 The module is developed by Yue Wang based on Yin Dian's zhspacing.sty
 macro package and Jonathan Kew's unicode-letters.tex + xetex
 interchartoks mechanism.
 It is designed for the audience who interested perfect Chinese
 typesetting using ConTeXt and XeTeX.
 It handles Chinese font loading, switching, line breaking, and
 punctuation compression rules quite well.
 Moreover, since the freetype's performance is much better than
 fontforge's on large cjk fonts, so the document compilation can be
 much faster.
 Users are free to visit http://code.google.com/p/ctex-kit/, and the
 code is in svn  (the trunk/zhspacing directory) now.
 Last but not least, we should thank Hans and Wolfgang since they help
 us a lot to make the module possible :)

 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] Two issues related to xetex

2009-05-11 Thread Yue Wang
Hi, Hans and Mojca:

first, (to Mojca) the first-setup.sh script still deletes fontconfig
cache when updating on windows.

second, (to Hans) unicode-letters.tex is read when we dump plain TeX
or LaTeX format in TeXLive. This file is wrote by Jonathan Kew in
order to initialize XeTeX. It defines many important unicode
properties into XeTeX. However, ConTeXt do not load that file when
dumping the xetex format. The file is not even in ConTeXt
distribution. I suggest that the file should be loaded.
You can find the file in
http://scripts.sil.org/svn-public/xetex/TRUNK/texmf/tex/generic/xetex/unicode-letters.tex
XeTeX's plain TeX ini file can be find in
http://scripts.sil.org/svn-public/xetex/TRUNK/texmf/tex/xetex/config/xetex.ini

If the file is not loaded, thousands of lines should be copied to
third party modules (like the module I announce on the mailing list
today) in order to support some language correctly. This method is
quite messy, not to say inefficient for loading.

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] Two issues related to xetex

2009-05-11 Thread Hans Hagen

Yue Wang wrote:


second, (to Hans) unicode-letters.tex is read when we dump plain TeX
or LaTeX format in TeXLive. This file is wrote by Jonathan Kew in
order to initialize XeTeX. It defines many important unicode
properties into XeTeX. However, ConTeXt do not load that file when
dumping the xetex format. The file is not even in ConTeXt
distribution. I suggest that the file should be loaded.


i don't want dependencies on files outside the context proper; too many 
bad experiences with that as they always are made for latex and i don'w 
want to waste time on keeping track of all those things anyway


context has enco-utf which is generated from the mkiv character database 
and that's our reference definition


(although not relevant for cjk, context also ships its own pattern, 
already in utf for quite a while)


so, if some definition is missing we should first fix char-def and then 
regenerate enco-utf using mtxrun --script chars --utf


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] New module t-zhspacing

2009-05-11 Thread Wolfgang Schuster


Am 11.05.2009 um 16:55 schrieb Yue Wang:


Dear list:

Chinese TeX Society is proud to announce the t-zhspacing module to the
ConTeXt society.
The module is developed by Yue Wang based on Yin Dian's zhspacing.sty
macro package and Jonathan Kew's unicode-letters.tex + xetex
interchartoks mechanism.
It is designed for the audience who interested perfect Chinese
typesetting using ConTeXt and XeTeX.
It handles Chinese font loading, switching, line breaking, and
punctuation compression rules quite well.
Moreover, since the freetype's performance is much better than
fontforge's on large cjk fonts, so the document compilation can be
much faster.
Users are free to visit http://code.google.com/p/ctex-kit/, and the
code is in svn  (the trunk/zhspacing directory) now.


After taking a closer look in zhspacing.sty I think it's better to  
include

the code in your t-zhspacing module and to replace a lot of macros with
their ConTeXT equivalent (e.g. \...@for...\do.. with \processcommalist).

The content from unicode-letters.tex should also be moved to a separate
file (e.g. t-zhspacing-unicode.tex) which can be removed when the  
information

is added to char-def.lua.

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

2009-05-11 Thread Wolfgang Schuster


Am 11.05.2009 um 15:48 schrieb Hans Hagen:


Wolfgang Schuster wrote:

possible yes but it's a lot of work because the complete fallback  
mechanism
needs to be written for XeTeX which is available for MkIV since a  
while.


this is unlikely to happen (unless we add lots of optional code to  
mkii to deal with xetex which then probably results in a lot of  
other code hooked into other mechanisms as well) as mkii is kind of  
frozen


Sorry Hans but my answer above has nothing to do with your code, I  
provided
in my module a mechanism to set fonts in a similar way as the fontspec  
and

xeCJK/zhspacing packages for LaTeX provide but *I* won't add extra code
to use my module with XeTeX.

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] Two issues related to xetex

2009-05-11 Thread Mojca Miklavec
On Mon, May 11, 2009 at 18:38, Yue Wang wrote:
 Hi, Hans and Mojca:

 first, (to Mojca) the first-setup.sh script still deletes fontconfig
 cache when updating on windows.

Hmmm ... while experimenting a bit and after writing a long answer
explaining that I'll come back to it after a while ... I figured out
that I have already implemented a fix, but completely forgot about it.
Hans, does this make sense?

local normalflags = states.get(rsync.flags.normal)
local deleteflags = 
if (destination:find(texmf$) or destination:find(context$)) and
(not environment.argument(keep)) then
deleteflags = states.get(rsync.flags.delete)
end
command = format(%s %s %s %s'%s' '%s', bin, normalflags,
deleteflags, url, archives, destination)

This only adds the --delete flag to texmf-context and texmf, others
are not touched. The consequence is that this won't delete your pdftex
binary automatically if you decide that you only need LuaTeX one day,
but I think that it makes sense as a temporary fix since:
- it prevents deleting font cache
- it reduces the need to recreate the formats when nothing has been updated

Mojca
___
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] Two issues related to xetex

2009-05-11 Thread Hans Hagen

Mojca Miklavec wrote:


Hans, does this make sense?

local normalflags = states.get(rsync.flags.normal)
local deleteflags = 
if (destination:find(texmf$) or destination:find(context$)) and
(not environment.argument(keep)) then
deleteflags = states.get(rsync.flags.delete)
end
command = format(%s %s %s %s'%s' '%s', bin, normalflags,
deleteflags, url, archives, destination)


ok, i'll change it

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

2009-05-11 Thread Yue Wang
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?

Thanks

Yue Wang


test-hyperlink.pdf
Description: Adobe PDF document


test-hyperlink.tex
Description: TeX document
___
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] XeConTeXt bug report I: strange benchmark

2009-05-11 Thread Yue Wang
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] XeConTeXt bug report II: MetaPost Graphics

2009-05-11 Thread Yue Wang
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
Description: Adobe PDF document
___
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] Capital number when onum=yes?

2009-05-10 Thread Corsair
On Sun, May 10, 2009 at 09:44:58PM +0200, Hans Hagen wrote:
 Corsair wrote:
  Hi all,
  
  I have `onum=yes' in my font features and it works great.  But how can
  I type a capital number in this case?  I want to use capital numbers
  in pagenumbers.
 
 can you be a bit more explicit?
 
 to what extend smallcaps are implemented is font dependent

Ok.  Sorry for the vagueness.  I use Adobe Caslon Pro as my body font,
with XeTeX.  And I enable the `onum' feature so that all numbers in my
document appear as old-style numbers, which is good.  But I also
prefer some of them use the normal capital number glyphs, for example,
in page numbers.  How can I do that?

-- 
There is no emotion; there is peace.
There is no ignorance; there is knowledge.
There is no passion; there is serenity.
There is no death; there is the Force.


pgpOtl2Tqe55f.pgp
Description: PGP signature
___
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] Why searching fonts in xetex is so slow?

2009-04-25 Thread Mojca Miklavec
On Sat, Apr 25, 2009 at 03:44, Yue Wang wrote:
 Hi, Mojca:

 However, when comment the second line (\definetypeface [iwona] [mm]
 [math] [iwona] [default] [encoding=ec]),
 TeXExec | runtime: 1.828
 total compile time is reduced to only 2 seconds. (of course, equations
 are typeset in latin modern).

But LM should suffer from the same problem.

 How can I speed up math font loading? change add file: suffix (like
 [file:rm-iwonar])  won't help :(

Core macros need to be changed somehow if you want to achieve that.
Hans doesn't use XeTeX, so you need strong arguments to convince him
to modify XeTeX-related code.

Hans wanted to implement
\definefontsynonym [a] [b]
to automatically work whether b is a font name, font filename or the
old good tfm font.

Even though the idea sounds OK and works well in LuaTeX, there's a big
problem with it, namely, it becomes so annoyingly slow that it's
basically useless (just for fun, you can try to remove file: in front
of LM fonts and observe the consequences). Usually filename and font
name don't match anyway, so you definitely need to specify which one
you want to use.

But there's one further problem. You can now specify file: or name:
prefix. In the first case this translates to
\font\a=[b]
and in the second case it translates to
\font\a=b

For tfm fonts you however need
\font\a=b
The second form with b works as well, but in that case XeTeX does
internal search by first asking fc and only if that fails it asks
kpathsea. If you don't provide either file: or name: then ConTeXt
needs to check all the three different options in the following order:
\font\a=b
\font\a=b
\font\a=[b]
I forgot whether the first one is already accepted (maybe it is), but
it any case it takes a lot of time before the right font is found.
Ideally ConTeXt should at least switch the order of searching for
fonts and should try kpatsea before fc, but then one runs into
problems with font names with spaces if one doesn't explicitely
provide the name: prefix.

The current clever scheme causes more problems  longer load times
than it brings advantages, but unless Hans changes core macros,
there's not much that you can do about it to speed up the loading
time.

Mojca
___
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] Why searching fonts in xetex is so slow?

2009-04-25 Thread Yue Wang
Hi,

On Sat, Apr 25, 2009 at 5:39 PM, Mojca Miklavec
mojca.miklavec.li...@gmail.com wrote:
 On Sat, Apr 25, 2009 at 03:44, Yue Wang wrote:
 Hi, Mojca:

 However, when comment the second line (\definetypeface [iwona] [mm]
 [math] [iwona] [default] [encoding=ec]),
 TeXExec | runtime: 1.828
 total compile time is reduced to only 2 seconds. (of course, equations
 are typeset in latin modern).

 But LM should suffer from the same problem.


I think LM tfm/otf metrics information are dumped to fmt statically.
See the TeX82 source code (don't know xetex's situation, but i am sure
tex82 works like that).

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
___


<    2   3   4   5   6   7   8   9   10   11   >