OSDN Git Service

Add buildpage_callback to fix ticket #33939
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Thu, 12 Jun 2014 04:27:04 +0000 (13:27 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Thu, 12 Jun 2014 04:27:04 +0000 (13:27 +0900)
src/ltj-direction.lua
test/test51-vtest.pdf
test/test51-vtest.tex

index f16df90..1ff9c1a 100644 (file)
@@ -847,17 +847,36 @@ do
       stop_time_measure('direction_vpack')
       return to_node(hd)
    end
-   luatexbase.add_to_callback('vpack_filter', 
+   luatexbase.add_to_callback('vpack_filter',
                              dir_adjust_vpack,
                              'ltj.direction', 10000)
 end
 
+-- supply direction whatsit to the main vertical list "of the next page"
 do
    local function dir_adjust_pre_output(h, gc)
       return to_node(create_dir_whatsit_vbox(to_direct(h), gc))
    end
-   luatexbase.add_to_callback('pre_output_filter', 
+   luatexbase.add_to_callback('pre_output_filter',
                              dir_adjust_pre_output,
                              'ltj.direction', 10000)
+end
 
+-- 
+do
+   local function dir_adjust_buildpage(info)
+      if info=='box' then
+        local head = to_direct(tex.lists.contrib_head)
+        local nb
+        head, _, nb
+           = make_dir_whatsit(head, 
+                              node_tail(head),
+                              get_dir_count(), 
+                              'buildpage')
+        tex.lists.contrib_head = to_node(head)
+      end
+   end
+   luatexbase.add_to_callback('buildpage_filter',
+                             dir_adjust_buildpage,
+                             'ltj.direction', 10000)
 end
index 2d452b0..69e5ec5 100644 (file)
Binary files a/test/test51-vtest.pdf and b/test/test51-vtest.pdf differ
index 270fcb9..193a81d 100644 (file)
@@ -1,6 +1,6 @@
 %#!luatex
 
-%\directlua{luatexja_debug = 1}
+\directlua{luatexja_debug = 1}
 \input luatexja.sty
 %\input lua-visual-debug.sty
 
@@ -51,7 +51,7 @@
 \message{^^JTATE, DTOU IN YOKO (HMODE))^^J}
 \hbox{\yoko
   横水平\H\vrule\hbox{\yoko 横水平\H }\vrule かき◆
-  \vrule\hbox{\tate 縦水平\H }◆おおおお\vrule
+  \vrule\hbox{\tate 縦水平\H }\message{HOGE}◆おおおお\vrule
   \vbox{\yoko\hsize=30mm 横垂直\H ああああああああああ\hfill\H}かき◆%
   \vrule
   \vbox{\tate\hsize=30mm 縦垂直\H ああああああああああ\hfill\H}%
   \vbox{\dtou\hsize=30mm 下垂直\H ああああああああああ\hfill\H}%
   \vrule かき◆
 }
+\hbox{\yoko
+  ああ\setbox0=\vtop{\yoko\hsize=30mm \ifhmode\message{H}\else\message{V}\fi 横垂直\H ああああああああああ\hfill\H}%
+  {\tracingonline1\showboxdepth2\showboxbreadth100\showbox0}かき◆\copy0 ◆
+}
+
 \vfill\eject
 
 \message{^^JYOKO, DTOU IN TATE (HMODE)^^J}
@@ -291,8 +296,10 @@ abc&かきくけこ&xyz\cr}}%
 {\obeylines\seventt\baselineskip=10pt
 \directlua{luatexja.ext_show_node_list(tex.box[1], 'alter Yht> ', tex.print)}\par}
 
-\setbox0=\hbox{\tate \ltjsetwd1=50pt}
-{\obeylines\seventt\baselineskip=10pt
+\message{HOGE}
+\setbox0=\hbox{\tate \ltjsetwd1=50pt\immediate\message{PIYO}}
+
+{\obeylines\seventt\baselineskip=10pt\message{HOGE}\hbox{a}\message{HOGE}
 \directlua{luatexja.ext_show_node_list(tex.box[1], 'alter Twd> ', tex.print)}\par}
 
 \setbox0=\hbox{\yoko \ltjsetht1=70pt}
@@ -325,6 +332,9 @@ p\kern-.15em\TeX\ bug (2011-02-24)
 \hbox{\dtou\dimen0=\ltjgetht0}
 \the\ltjgetht0}% OK. 30pt
 
+\def\R{012345678901234567890123456789}
+\vbox{\tate\hsize=4\zw\R\R\R\R}
+ABCDE
 
 \end