Re: [NTG-context] stupbackgrounds and margin

2009-02-01 Thread Antoine Junod
Hi wolfgang, and thanks for your reply.

Wolfgang Schuster schuster.wolfg...@googlemail.com writes:

[trying to get a red leftmargin]

 Make a complete (with text) example where we can see your problem (a
 example of the output could help), I get a red background for the
 left margin.

Here it is. And the output (processed with texexec --lua) is attached.

Thanks for everything.
-AJ

\setuppapersize
[A5][A4]
\setuparranging
[2UP,rotated,doublesided]
\setuplayout
[margin=18mm,
 width=middle,height=middle,
 topspace=0cm,backspace=18mm]
\setupcolors
[state=start]
\setupbackgrounds
[text]
[leftmargin]
[background=color,backgroundcolor=red]

\showframe
\showgrid

\enableregime[utf]

\starttext

\section{my taylor is rich}
knuthknuth
\page[yes]
\section{God save the Queen}
knuthknuth
\stoptext



left_margin_in_red.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] stupbackgrounds and margin

2009-02-01 Thread Wolfgang Schuster


Am 01.02.2009 um 14:11 schrieb Antoine Junod:


Hi wolfgang, and thanks for your reply.

Wolfgang Schuster schuster.wolfg...@googlemail.com writes:

[trying to get a red leftmargin]


Make a complete (with text) example where we can see your problem (a
example of the output could help), I get a red background for the
left margin.


Here it is. And the output (processed with texexec --lua) is attached.

\showframe


\showframe overwrites the \setupbackgrounds settings, comment it and
you can see it.

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] XeTeX and/or LuaTeX?

2009-02-01 Thread Hans Hagen

Mojca Miklavec wrote:

On Sat, Jan 31, 2009 at 12:50 AM, Hans Hagen wrote:

attached a more efficient variant


Hello Hans,

I don't know anything about right-to-left typesetting, but is the
result of this desired? (not sure if I copy-pasted properly)

\sethebrew test \ConTeXt\  הָלַך test

Mojca

PS: I get tXeTnoC. I also get some funny results like disappearing
words, but since I'm completely ignorant here, I won't even start
complaining.


it should be ok if automirroring is on but even then one might expect 
some issues


we will cook up a proper bidi support model in the oriental tex project 
(not so much the text, but how layout, boxed and other issues has to be 
 dealt with)


currently hartmut is revisioning all directional issues (we took some 
code from omega but it was not always properly/consistently acting in 
relation with backend issues in dvi/pdf) and when that is done i'll see 
what is needed (the main layout is not the issue, but more details like 
boxed stuff, think of llap and friends as well as spacing)


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] Possible memory leak?

2009-02-01 Thread Yue Wang
Hi, Hans:

in font-afm.lua, you use fontforge to open and to_table a pfb, but
without closing it?

btw, when MKIV is running for the first time (i.e., no cache file). it
will use a lot of memory (parsing a 10M font will use 700-800 MB
memory), are there some ways to reduce that? Another problem is, the
memory usage seems incremental:
I watch the memory usage in top carefully, it does not reduce when
MKIV finish reading and caching an otf font. (well I read the
font-otf.lua, and you are actually closing that font. so maybe that's
because luatex is leaking memory?)

btw, I load arial 300 times using the following file,

%engine=luatex
\directlua0{
function load_font (filename)
local metrics = nil
local font = fontforge.open(filename)
if font then
metrics = fontforge.to_table(font)
fontforge.close(font)
end
return metrics
end
myfont = load_font('arial.ttf')
% 300 myfont = load_font('arial.ttf')
myfont = load_font('arial.ttf')
myfont = load_font('arial.ttf')
myfont = load_font('arial.ttf')
myfont = load_font('arial.ttf')
}
and I can see the memory usage may ebb and flow, but actually it is
leaking memory.

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] stupbackgrounds and margin

2009-02-01 Thread Antoine Junod
Wolfgang Schuster schuster.wolfg...@googlemail.com writes:

 Am 01.02.2009 um 14:11 schrieb Antoine Junod:

 Hi wolfgang, and thanks for your reply.

 Wolfgang Schuster schuster.wolfg...@googlemail.com writes:

 [trying to get a red leftmargin]

 Make a complete (with text) example where we can see your problem (a
 example of the output could help), I get a red background for the
 left margin.

 Here it is. And the output (processed with texexec --lua) is attached.

 \showframe

 \showframe overwrites the \setupbackgrounds settings, comment it and
 you can see it.

Thanks Wolfgang, that was that.

A+
-AJ
___
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] Possible memory leak?

2009-02-01 Thread Taco Hoekwater

Hi Yue Wang,

Yue Wang wrote:

myfont = load_font('arial.ttf')
myfont = load_font('arial.ttf')
}
and I can see the memory usage may ebb and flow, but actually it is
leaking memory.


I also see a non-trivila leak (somewhere inside the fontforge library).
I will investigate further next week, it is not that massive. I get this
result for your input file, with 500 arial.ttfs (ArialMT  version 3.0,
367112 bytes):

==8819== LEAK SUMMARY:
==8819==definitely lost: 16,965,191 bytes in 707,541 blocks.
==8819==  possibly lost: 1,128 bytes in 22 blocks.
==8819==still reachable: 202,135,427 bytes in 81,127 blocks.
==8819== suppressed: 0 bytes in 0 blocks.
==8819== Rerun with --leak-check=full to see details of leaked memory.

So some 32kb per font. Noticeable, but not enormous. The growth in
'top' is probably caused more by memory fragmentation than by this leak.

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] XeTeX and/or LuaTeX?

2009-02-01 Thread Hans Hagen

Mojca Miklavec wrote:

On Sat, Jan 31, 2009 at 7:54 PM, J.A.J. Pater wrote:

My guess was incorrect.
I copy-pasted the underneath text into my test file and I got good results.
No tXeTnoC.
So here it just works like a charm.


I'm sorry. I accidentally commented out \setcharactermirroring[1]
while switching between XeTeX and LuaTeX. So this time just for fun:
XeTeX doesn't know textdir command, so I commented out both textdir
and setcharactermirroring. And then you get XtEConT with XeTeX :) :)
:)


xetex uses the etex bidi method (\beginL .. \endL and such)


I used the wrong set of direction-switching commands, though it's
still interesting that XeTeX and LuaTeX both accept input, but
generate completely different results. (\pardir without \textdir has
no influence in mkiv while it changes word stacking direction in
XeTeX.)


well, since they both use different rl machinery it can never be the same;

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] How to capture a typeset page into a box instead of shipping it out

2009-02-01 Thread Roger Mason
Hello,

Kevin D. Robbins krobb...@alumni.princeton.edu writes:

Thanks for the suggestions Wolfgang and Luigi. I've now got several
good options to research.
Kevin


I use 3  modes for teaching:

manuscript -- notes that go on-line for students to download
presentation -- pictures for use in class
speakernotes -- miniatures of the pictures, each on a separate page,
 that I scrawl on for use in class (so I know what I'm
 supposed to say).

I got a lot of help from this list in putting these together.  Context
experts might find them laughable, but I'm attaching the modes in a
tarball just in case they are useful.  They are still evolving, by the
way -- I wrote speakernotes last week, inspired by something of the same
name on the wiki (sorry, I can't remember who the author is).

Cheers,
Roger



modes.tar.gz
Description: Binary data
___
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] Possible memory leak?

2009-02-01 Thread Yue Wang
 ok, thanks for noticing, i added a

  fontforge.close(pfbblob)


good

 btw, when MKIV is running for the first time (i.e., no cache file). it
 will use a lot of memory (parsing a 10M font will use 700-800 MB

 hm so much?


Yes, when finish reading the following tex file without \bye using plain TeX,
LuaTeX will cost 719M memory on my machine. The font used is Adobe
song std light.

[...@localhost ~]$ cat a.tex
\directlua0{
function load_font (filename)
local metrics = nil
   local font = fontforge.open(filename)
   if font then
   metrics = fontforge.to_table(font)
   fontforge.close(font)
   end
   return metrics
end
myfont = load_font('song.otf')
}
[...@localhost ~]$

when using the above script loading four fonts (you can try this by
adding 3 myfont = load_font('song.otf')),
the memory consumption will be higher than 1G on my machine. Remember
I am using Plain TeX to do this test, MKIV will consume more memory.


 also, mem consumption reported is a bit of a lie because lua seems to
 allocates double of what it needed with each increment but not always use it

 otf fonts are already quite packed in mkiv (i'm considering adding an option
 to mtx-font to precache fonts but i'm not sure if it's worth the trouble

 is mem consumption less a second run?

Yes, dramatically less. with 4 chinese fonts loaded (I use zhfonts.tex
for testing), MKIV consumes 300-400MB.

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
___