Hi, I have just uploaded the archives for a new luatex release, 0.51.0. New features: * Various small manual improvements. * The backend message "cannot open Type 1 font file for reading" now reports which Type1 font it was looking for. * Fontforge clears some font names at loading time that will be refilled in at font generation time, but the fontloader should not do that. Patch from Khaled Hosny. * New synctex code imported from TeXLive. * luamd5/md5.h is renamed to luamd5/luamd5.h to avoid confusion. * Embedded mplib is now 1.209. * Some experimental tweaking of buildpage_filter, see the manual for details. * Luatex now detects kfreebsd (from Alan Braslau) * The new lua function tex.sp() converts a string to a number representing scaled points. * There is now support for revision numbers in the banner and stats library again. * The command line help and manual documentation page is extended. * node.hpack() now also accepts "cal_expand_ratio" and "subst_ex_font" modifiers. * node.hpack() and node.vpack() now give back the badness of the box as second return value. * node.copy_list() now allows a second (stop) argument, this stopper is not copied. * new lua functions in lfs: lfs.readlink() and lfs.shortname(). * new lua function tex.tprint() that can combine multiple catcode regime prints in one function call. * new lua sub-table: tex.nest[] (read/write access to the semantic nest state). * New lua functions in kpse: kpse.lookup() and kpse.version(). See the manual for more details. * New lua function tex.shipout(). Bug fixes: * There problems in the pdf output for Type3 (pk) fonts. * Fix a bug that allowed bad commandline quoting. * Fix a bug that sometimes caused crashes when \pdfprotrudechars. * The build script now exports CONFIG_SHELL to avoid problems with /bin/dash. * The was a bug in the generated /Image /ProcSet. * status.font_bytes reported the wrong value. * Lots of compiler warnings are removed (thanks Javier Mugica). * Patch to fontloader.info() to accept filenames with embedded parentheses. * Fix a \write error with docstrip package. * Fixed a crash on AdobeMyungjoStd-Medium.otf. * Fix coco stack overflows, needed for lpeg. * \pdfcompresslevel wasn't initialized for early immediate objects. * Fix for slanted fonts when HZ was on (slant angle was multiplied). * When concatenating content streams, put a space between them. * Allow pfb lines to end with \r as well as \n (for msam10.pfb). * Fix the internal string->scaled point conversion in the lua interface. * Memory leaks in the fontloader removed, thanks to patches from Elie Roux. * Fix a crash caused by the combination of coroutines and font.each(). Removed features: * Support for Type3 .pgc files (nobody used them). The archives can be downloaded from supelec as usual: http://foundry.supelec.fr/gf/project/luatex/ You could also check out the sources via anonymous svn: svn co http://foundry.supelec.fr/svn/luatex/tags/beta-0.51.0 Bugs and feature requests can be added to the issue tracker at http://tracker.luatex.org Have fun, Taco
Taco Hoekwater wrote:
Hi,
I have just uploaded the archives for a new luatex release, 0.51.0.
New features:
Actually, there is another feature but it is experimental enough that it is not documented in the manual yet. local <node> nodelist, <sp> founddepth = tex.linebreak(<node> listhead, <table> parameters) The understood parameters are as follows (with example code): d = false, % boolean pardir = 'TLT', % dir pretolerance = 100, % number tracingparagraphs = 0, % number tolerance = 200, % number looseness = 0, % number hyphenpenalty = 50, % number exhyphenpenalty = 50, % number pdfadjustspacing = 0, % number adjdemerits = 10000, % number pdfprotrudechars = 0, % number linepenalty = 10, % number lastlinefit = 0, % number doublehyphendemerits = 10000, % number finalhyphendemerits = 5000, % number hangafter = 1, % number interlinepenalty = 0, % number clubpenalty = 150, % number displaywidowpenalty = 150, % number widowpenalty = 150, % number brokenpenalty = 100, % number emergencystretch = 0, % sp hangindent = 0, % sp hsize = 65536*72*4, % sp leftskip = spec, % glue_spec node rightskip = spec, % glue_spec node parshape = {} % tabke pdfeachlineheight = -65536000, % sp pdfeachlinedepth = -65536000, % sp pdffirstlineheight =-65536000, % sp pdflastlinedepth = -65536000, % sp pdfignoreddimen = -65536000, % sp The 'd' is whether or not this should be taken as a pre-math-display subparagraph, everything else should be fairly obvious except for the last 5. The four pdf...line... things are ignored if their value equals pdfignoreddimen. Parshape is a list of 2-item arrays, like that returned from tex.parshape: local j = tex.linebreak(h,{parshape = { {tex.sp'1in',tex.sp'6in'}, {tex.sp'3in',tex.sp'3in'}, {tex.sp'4in',tex.sp'2in'}, {tex.sp'1in',tex.sp'6in'}}}) It is your own job to make sure that 'listhead' is a proper paragraph list: this function does not add any nodes to it. To be exact, if you want to replace the core line breaking, you may have to do the following (when you are not actually working in the pre_line_break or line_break callback, or when the original list starting at listhead was generated in horizontal mode): * make sure that all the prev pointers are ok, for example by using node.slide(listhead) * you may have to run lang.hyphenate(), node.ligaturing() or node.kerning() * add an 'indent box' and perhaps a local_par node at the start (only if you need them) * replace any found final glue by an infinite penalty (or add such a penalty, if the last node is not a glue). * add a glue node for the \parfillskip after that penalty. The result is just a node list, it still needs to be vpacked. There are a few special things you cannot interface using this function, because there is no lua glue for the underlying data yet: \interlinepenalties \clubpenalties \displaywidowpenalties \widowpenalties Also, you can't influence font expansion other than via 'pdfadjustspacing', because the settings for that take place elsewhere. The same is true for hbadness and hfuzz etc. All these are in the hpack() routine, and that fetches its own variables via globals. If there are no complaints, I plan to officially document this function for version 0.60. Best wishes, Taco
Taco Hoekwater
Taco Hoekwater wrote:
Hi,
I have just uploaded the archives for a new luatex release, 0.51.0.
New features:
Actually, there is another feature but it is experimental enough that it is not documented in the manual yet.
local <node> nodelist, <sp> founddepth = tex.linebreak(<node> listhead, <table> parameters)
The understood parameters are as follows (with example code):
A few notes: badness/demerits output? And I think it would be beneficial to have incremental line breaking, where you have as an input (and output) the list of current best breakpoints. That would make it possible to have text flow around shapes without requiring everything to fit a fixed base line distance. It also would make it possible to develop strategies for adjusting line break decisions depending on pagebreaks (\brokenpenalty, \widowpenalty and their ilk can't have the paragraph rebroken right now, making them pretty useless with fixed bottom page layouts). -- David Kastrup
David Kastrup wrote:
Taco Hoekwater
writes: Taco Hoekwater wrote:
Hi,
I have just uploaded the archives for a new luatex release, 0.51.0.
New features:
Actually, there is another feature but it is experimental enough that it is not documented in the manual yet.
local <node> nodelist, <sp> founddepth = tex.linebreak(<node> listhead, <table> parameters)
The understood parameters are as follows (with example code):
A few notes: badness/demerits output?
I'll see what can be done about that.
And I think it would be beneficial to have incremental line breaking, where you have as an input (and output) the list of current best breakpoints. That would make it possible to have text flow around shapes without requiring everything to fit a fixed base line distance.
Here I am not sure what you have in mind exactly. Can you create a mock up of the requested input/output? I will also say that -- before you spend a lot of time on this -- there are plans for a pure lua version of the whole line break algorithm. We did some experiments with that, and it is not noticeably slower on an average (context) document.
It also would make it possible to develop strategies for adjusting line break decisions depending on pagebreaks (\brokenpenalty, \widowpenalty and their ilk can't have the paragraph rebroken right now, making them pretty useless with fixed bottom page layouts).
You can already re-break the paragraph with the current tex.linebreak: just create a copy of the node list before feeding it in, and loop over the output boxes. tex.linebreak does not remove or reallocate those existing nodes, at most it hides them in discretionaries inside hlists. Probably this is not quite what you had in mind, though. Best wishes, Taco
Taco Hoekwater
David Kastrup wrote:
Taco Hoekwater
writes: Taco Hoekwater wrote:
Hi,
I have just uploaded the archives for a new luatex release, 0.51.0.
New features:
Actually, there is another feature but it is experimental enough that it is not documented in the manual yet.
local <node> nodelist, <sp> founddepth = tex.linebreak(<node> listhead, <table> parameters)
The understood parameters are as follows (with example code):
A few notes: badness/demerits output?
I'll see what can be done about that.
And I think it would be beneficial to have incremental line breaking, where you have as an input (and output) the list of current best breakpoints. That would make it possible to have text flow around shapes without requiring everything to fit a fixed base line distance.
Here I am not sure what you have in mind exactly. Can you create a mock up of the requested input/output?
Not exactly easy. The line break algorithm maintains a list of best active breakpoints in the "current line" under consideration, and each breakpoint is associated with a previous list of breakpoints. (Some sort of shortest path traversal). My first thought was that the "incremental line" breaking would add another line, but that's not actually a useful unit. Perhaps it would be able to do the paragraph breaking until a certain height is certainly exceeded. Then one has the list of possible breakpoints for the current line, each with a score and a list of preceding breakpoints.
I will also say that -- before you spend a lot of time on this -- there are plans for a pure lua version of the whole line break algorithm. We did some experiments with that, and it is not noticeably slower on an average (context) document.
Whether or not one has a C primitive for doing one step of the algorithm is probably not so important then.
You can already re-break the paragraph with the current tex.linebreak: just create a copy of the node list before feeding it in, and loop over the output boxes. tex.linebreak does not remove or reallocate those existing nodes, at most it hides them in discretionaries inside hlists. Probably this is not quite what you had in mind, though.
Fiddle and reiterate might do the trick most of the time, but it feels artificial in contrast to doing it in one pass "as intended" rather than brute-forcing an efficient algorithm iteratively. -- David Kastrup
David Kastrup wrote:
Taco Hoekwater
writes: You can already re-break the paragraph with the current tex.linebreak: just create a copy of the node list before feeding it in, and loop over the output boxes. tex.linebreak does not remove or reallocate those existing nodes, at most it hides them in discretionaries inside hlists. Probably this is not quite what you had in mind, though.
Fiddle and reiterate might do the trick most of the time, but it feels artificial in contrast to doing it in one pass "as intended" rather than brute-forcing an efficient algorithm iteratively.
I agree, and that is an important drive behind the wish for a pure lua solution. Best wishes, Taco
Taco Hoekwater wrote:
Actually, there is another feature but it is experimental enough that it is not documented in the manual yet.
local <node> nodelist, <sp> founddepth = tex.linebreak(<node> listhead, <table> parameters)
The understood parameters are as follows (with example code):
d = false, % boolean ... displaywidowpenalty = 150, % number widowpenalty = 150, % number
Just to keep you posted: I just committed 3493, and this dropped the 'd' and 'displaywidowpenalty' parameters. Just set up 'widowpenalty' appropriately yourself (the 'widow...' vs 'displaywidow...' choice was the only reason for 'd'). Best wishes, Taco
Taco Hoekwater wrote:
Taco Hoekwater wrote:
Actually, there is another feature but it is experimental enough that it is not documented in the manual yet.
local <node> nodelist, <sp> founddepth = tex.linebreak(<node> listhead, <table> paramet
After commit 3495 (just done), the syntax has changed to local <node> nodelist, <table> info = tex.linebreak(<node> listhead, <table> parameters ) The 'info' contains four values that are all numbers: prevdepth % depth of the last line in the broken paragraph prevgraf % number of lines in the broken paragraph looseness % the actual looseness value in the broken paragraph demerits % the total demerits of the chosen solution This is the best I can do at short notice Best wishes, Taco
Taco Hoekwater wrote:
\interlinepenalties \clubpenalties \displaywidowpenalties \widowpenalties
Finally (for now), revision 3496 allows the 'interlinepenalty', 'clubpenalty' and 'widowpenalty' arguments to be a table that represents an array of integer values, thereby allowing the above etex extensions to be used. Best wishes, Taco
participants (2)
-
David Kastrup
-
Taco Hoekwater