texlive[66639] Master/texmf-dist: linebreaker (21mar23)

commits+karl at tug.org commits+karl at tug.org
Tue Mar 21 21:23:57 CET 2023


Revision: 66639
          http://tug.org/svn/texlive?view=revision&revision=66639
Author:   karl
Date:     2023-03-21 21:23:57 +0100 (Tue, 21 Mar 2023)
Log Message:
-----------
linebreaker (21mar23)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/lualatex/linebreaker/README.md
    trunk/Master/texmf-dist/doc/lualatex/linebreaker/linebreaker-doc.pdf
    trunk/Master/texmf-dist/doc/lualatex/linebreaker/linebreaker-doc.tex
    trunk/Master/texmf-dist/tex/lualatex/linebreaker/linebreaker.lua

Modified: trunk/Master/texmf-dist/doc/lualatex/linebreaker/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/linebreaker/README.md	2023-03-21 20:23:42 UTC (rev 66638)
+++ trunk/Master/texmf-dist/doc/lualatex/linebreaker/README.md	2023-03-21 20:23:57 UTC (rev 66639)
@@ -1,4 +1,4 @@
-#The Linebreaker package, version v0.1b (2023-03-06)
+#The Linebreaker package, version v0.1c (2023-03-21)
 
 This package tries to prevent overflow lines in paragraphs or boxes.
 It changes the LuaTeX's `linebreak` callback, and it re-typesets the paragraph 

Modified: trunk/Master/texmf-dist/doc/lualatex/linebreaker/linebreaker-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/lualatex/linebreaker/linebreaker-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/linebreaker/linebreaker-doc.tex	2023-03-21 20:23:42 UTC (rev 66638)
+++ trunk/Master/texmf-dist/doc/lualatex/linebreaker/linebreaker-doc.tex	2023-03-21 20:23:57 UTC (rev 66639)
@@ -191,8 +191,12 @@
 \section{Changes}
 
 \begin{description}
-  \item[v0.1b, 2023-03-06]\hfill
+  \item[v0.1c, 2023-03-21]\hfill
     \begin{itemize}
+      \item Pass default parameters to all calls of \verb|tex.linebreak|, in order to support Bidi text in all instances.
+    \end{itemize}
+  \item[v0.1b, 2023-03-08]\hfill
+    \begin{itemize}
       \item Set maximal value of tolerance to 8189, bigger value doesn't have any effect.
       \item Added \verb|cubic| method for calculating tolerance.
       \item Explicitly set the \verb|tex.linebreak| parameters, to support paragraph direction and other paragraph variables.

Modified: trunk/Master/texmf-dist/tex/lualatex/linebreaker/linebreaker.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/linebreaker/linebreaker.lua	2023-03-21 20:23:42 UTC (rev 66638)
+++ trunk/Master/texmf-dist/tex/lualatex/linebreaker/linebreaker.lua	2023-03-21 20:23:57 UTC (rev 66639)
@@ -160,8 +160,14 @@
 		end
 	end
 	linebreaker.debug_print "best solution"
+  local ignored_types = {userdata=true, table = true}
 	for k,v in pairs(n) do 
-		linebreaker.debug_print(k,v)
+    -- we must ignore some properties in the params table,
+    -- as they produce errors when used in debug_print,
+    -- and they are not interesting for debugging anyway
+    if not ignored_types[type(v)]  then
+      linebreaker.debug_print(k,v)
+    end
 	end
 	return n
 end
@@ -406,7 +412,7 @@
   local params = parameters[#parameters]	-- newest parameters are last in the
   -- table that will be used in recursive invocations of this function
   -- it holds updated parameters
-  local newparams =  {}
+  local newparams =  linebreaker.parameters()
   -- this value is set by hpack_quality callback that is executed by
   -- tex.linebreak when overflow or underflow happens
   linebreaker.badness = 0
@@ -474,16 +480,17 @@
   tex.nest[tex.nest.ptr].prevgraf=info.prevgraf
 end
 
+
 -- test whether the current overfull box message occurs inside our linebreaker function
 local is_inside_linebreaker = false
 function linebreaker.linebreak(head,is_display)
+  local parameters = linebreaker.parameters()
   -- we can disable linebreaker processing
   if linebreaker.active == false then
-    local newhead, info =  linebreaker.breaker(head)
+    local newhead, info =  linebreaker.breaker(head, parameters)
     fix_nest(info)
     return newhead
   end
-  local parameters = linebreaker.parameters()
   is_inside_linebreaker = true
   local newhead, info = linebreaker.best_solution(head, {parameters}) 
   is_inside_linebreaker = false



More information about the tex-live-commits mailing list.