[luatex] Printing to the console

Will Robertson wspr81 at gmail.com
Wed Jun 2 09:13:50 CEST 2010


Hi,

I apologise in advance if this is a silly question.

In luaotfload & fontspec, we're automatically (re-)generating the font 
names database as users load fonts; this is very slow the first time it 
occurs.

In trying to output some messages to tell the user what is taking so 
long, I've found that I can't get anything printed to the console until 
*after* the very-slow-operation has occurred. For example: (change the 
number of zeros if this takes too long)

\directlua{ texio.write_nl("start") }
\directlua{
  local x = 1
  local s = 1
  for i = 1,100000000 do
    x = x+s*i/x
    s = -s
  end
  texio.write_nl(x)
}
\directlua{ texio.write_nl("stop") }
\bye

Is there any way to "flush" the console buffer before the 
very-slow-operation begins?

Many thanks,
Will




More information about the luatex mailing list