texlive[41489] Master/texmf-dist: luatexja (18jun16)

commits+karl at tug.org commits+karl at tug.org
Sun Jun 19 00:07:21 CEST 2016


Revision: 41489
          http://tug.org/svn/texlive?view=revision&revision=41489
Author:   karl
Date:     2016-06-19 00:07:21 +0200 (Sun, 19 Jun 2016)
Log Message:
-----------
luatexja (18jun16)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/luatex/luatexja/README
    trunk/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf
    trunk/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf
    trunk/Master/texmf-dist/doc/luatex/luatexja/luatexja-ruby.pdf
    trunk/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx
    trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-compat.lua
    trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-direction.lua
    trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua
    trunk/Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty
    trunk/Master/texmf-dist/tex/luatex/luatexja/luatexja.lua
    trunk/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty

Modified: trunk/Master/texmf-dist/doc/luatex/luatexja/README
===================================================================
--- trunk/Master/texmf-dist/doc/luatex/luatexja/README	2016-06-18 22:06:08 UTC (rev 41488)
+++ trunk/Master/texmf-dist/doc/luatex/luatexja/README	2016-06-18 22:07:21 UTC (rev 41489)
@@ -1,4 +1,4 @@
-The LuaTeX-ja Package 20160515.0
+The LuaTeX-ja Package 20160618.0
 --------------------------------
 Copyright (c) 2011--2016 The LuaTeX-ja project
 License: modified BSD (see COPYING)
@@ -34,9 +34,9 @@
 2. If you must/want to install manually:
 
    a. Download the source archive from CTAN,
-      or tagged as 20160515.0 in the Git repository by
+      or tagged as 20160618.0 in the Git repository by
       <http://git.osdn.jp/view?p=luatex-ja/luatexja.git
-                              ;a=snapshot;h=refs/tags/20160515.0;sf=tgz>
+                              ;a=snapshot;h=refs/tags/20160618.0;sf=tgz>
 
    b. Extract the archive and process following three files by LuaLaTeX
       to generate classes for Japanese typesetting:
@@ -81,4 +81,4 @@
 
 * src/*.{ins.dtx} and src/ltj-kinsoku_make.tex are not needed in regular use.
 
-Last commit date: Sun May 15 10:29:21 2016 +0900
+Last commit date: Sat Jun 18 17:43:10 2016 +0900

Modified: trunk/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/luatex/luatexja/luatexja-ruby.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx
===================================================================
--- trunk/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx	2016-06-18 22:06:08 UTC (rev 41488)
+++ trunk/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx	2016-06-18 22:07:21 UTC (rev 41489)
@@ -5827,7 +5827,7 @@
 \pTeX と同じようにJIS~X~0208の範囲しかサポートしていない.
 %</ja>
 \begin{center}
-\cs{kuten}, \cs{jis}, \cs{euc}, \cs{sjis}, \cs{jis}, \cs{kansuji}
+\cs{kuten}, \cs{jis}, \cs{euc}, \cs{sjis}, \cs{ucs}, \cs{kansuji}
 \end{center}
 %<*en>
 These six commands takes an internal integer, and returns a \emph{string}.

Modified: trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-compat.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-compat.lua	2016-06-18 22:06:08 UTC (rev 41488)
+++ trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-compat.lua	2016-06-18 22:07:21 UTC (rev 41489)
@@ -110,7 +110,7 @@
 	if c1>0x7f then i=0x40 else i=0x3f end
 	c1 = c1 - i
      else
-	c1 = c1 - 0x7e
+	c1 = c1 - 0x9e
      end
      from_kuten(c2*256+c1)
   end

Modified: trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-direction.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-direction.lua	2016-06-18 22:06:08 UTC (rev 41488)
+++ trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-direction.lua	2016-06-18 22:07:21 UTC (rev 41489)
@@ -168,6 +168,8 @@
 	 end
       end
    end
+   local node_next_node, node_tail_node = node.next, node.tail
+   local insert_after_node = node.insert_after
    function luatexja.direction.set_list_direction_hook(v)
       local lv = tex_nest.ptr -- must be >= 1
       if not v then
@@ -178,10 +180,12 @@
       elseif v=='adj' then
          v = get_adjust_dir_count()
       end
-      local h = to_direct(tex_nest[lv].head)
-      local w = dir_pool[v]()
-      insert_after(h, h, w)
-      tex_nest[lv].tail = to_node(node_tail(w))
+      local h = tex_nest[lv].head
+      local hn = node.next(h)
+      hn = (hn and hn.id==id_local) and hn or h
+      local w = to_node(dir_pool[v]())
+      insert_after_node(h, hn, w)
+      tex_nest[lv].tail = node_tail_node(w)
       ensure_tex_attr(attr_icflag, 0)
       ensure_tex_attr(attr_dir, 0)
    end
@@ -203,7 +207,7 @@
 		 "To change direction in an align, \n"
 		    .. "you shold use \\hbox or \\vbox.")
       else
-	 local h = (lv==0) and tex.lists.page_head or tex_nest[lv].head.next
+ 	 local h = (lv==0) and tex.lists.page_head or tex_nest[lv].head.next
 	 local flag,w = test_list(h,lv)
 	 if flag==0 then
 	    if lv==0 and not page_direction then
@@ -218,8 +222,15 @@
 	 elseif flag==1 then
 	    node_set_attr(w, attr_dir, v)
 	    if lv==0 then page_direction = v end
-	 else
-	    if lv==0 then page_direction = v end
+	 elseif lv==0 then
+	    page_direction = v
+	 else -- flag == 2: need to create dir whatsit.
+	    local h = tex_nest[lv].head
+	    local hn = node.next(h)
+	    hn = (hn and hn.id==id_local) and hn or h
+	    local w = to_node(dir_pool[v]())
+	    insert_after_node(h,hn,w)
+	    tex_nest[lv].tail = node_tail_node(w)
 	 end
          ensure_tex_attr(attr_icflag, 0)
       end
@@ -234,7 +245,7 @@
 	    getsubtype(hd)==sid_user and getfield(hd, 'user_id')==DIR then
       set_attr(hd, attr_icflag,
 	       get_attr_icflag(hd) + PROCESSED_BEGIN_FLAG)
-      local n = node_next(hd)
+      local n =node_next(hd)
       if n then
 	 set_attr(n, attr_icflag,
 		  get_attr_icflag(n) + PROCESSED_BEGIN_FLAG)

Modified: trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua	2016-06-18 22:06:08 UTC (rev 41488)
+++ trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua	2016-06-18 22:07:21 UTC (rev 41489)
@@ -122,7 +122,6 @@
 local function skip_table_to_glue(n)
    local g, st = node_new(id_glue), ltjs.fast_get_stack_skip(n)
    setglue(g, st.width, st.stretch, st.shrink, st.stretch_order, st.shrink_order)
-   -- luatexja.ext_show_node(to_node(g), 'sg ',print) 
    return g, (st.width==1073741823)
 end
 
@@ -302,7 +301,7 @@
 local ltjw_apply_ashift_math = ltjw.apply_ashift_math
 local ltjw_apply_ashift_disc = ltjw.apply_ashift_disc
 local min, max = math.min, math.max
-local function calc_np_aux_glyph_common(lp)
+local function calc_np_aux_glyph_common(lp, acc_flag)
    Np.nuc = lp
    Np.first= (Np.first or lp)
    if getfield(lp, 'lang') == lang_ja then
@@ -380,7 +379,7 @@
 	       node_free(r)
 	    elseif (ct.left_protruding or 0) == 0 then
 	       head = insert_before(head, npn, r)
-	       Np.first = (Np.first==npn) and r or npn
+	       Np.first = acc_flag and Np.first or ((Np.first==npn) and r or npn)
 	    elseif (ct.right_protruding or 0) == 0 then
 	       insert_after(head, npn, r); Np.last, lp = r, r
 	    else
@@ -490,7 +489,7 @@
 	 set_attr(lp, attr_icflag, PROCESSED); lp = node_next(lp)
 	 set_attr(lp, attr_icflag, PROCESSED); lp = node_next(lp)
 	 set_attr(lp, attr_icflag, PROCESSED);
-	 return calc_np_aux_glyph_common(lp)
+	 return calc_np_aux_glyph_common(lp, true)
       else
 	 Np.first = Np.first or lp
 	 Np.id = id_kern; set_attr(lp, attr_icflag, PROCESSED)

Modified: trunk/Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty	2016-06-18 22:06:08 UTC (rev 41488)
+++ trunk/Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty	2016-06-18 22:07:21 UTC (rev 41489)
@@ -758,6 +758,7 @@
 \protected\def\ltjsetht{\directlua{luatexja.direction.set_box_dim('height')}}
 \protected\def\ltjsetdp{\directlua{luatexja.direction.set_box_dim('depth')}}
 
+
 %%------------------ Load module for the format
 
 \ifltj at in@latex                 %<*LaTeX>

Modified: trunk/Master/texmf-dist/tex/luatex/luatexja/luatexja.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexja/luatexja.lua	2016-06-18 22:06:08 UTC (rev 41488)
+++ trunk/Master/texmf-dist/tex/luatex/luatexja/luatexja.lua	2016-06-18 22:07:21 UTC (rev 41489)
@@ -230,8 +230,8 @@
 do
    luatexja.binary_pars = {
       jacharrange = function(c, t)
-	 if type(c)~='number' or c<0 or c>31*ltjc.ATTR_RANGE then
-	    -- 0 はエラーにしない(隠し)
+	 if type(c)~='number' or c<-1 or c>31*ltjc.ATTR_RANGE then
+	    -- 0, -1 はエラーにしない(隠し)
 	    ltjb.package_error('luatexja',
 			       'invalid character range number (' .. tostring(c) .. ')',
 			       'A character range number should be in the range 1..'
@@ -344,6 +344,24 @@
 end
 
 
+-- lastnodechar
+do
+   local id_glyph = node.id('glyph')
+   function luatexja.pltx_composite_last_node_char()
+      local n = tex.nest[tex.nest.ptr].tail
+      local r = '-1'
+      if n then
+	 if n.id==id_glyph then
+	    while n.componetns and  n.subtype and n.subtype%4 >= 2 do
+	       n = node.tail(n)
+	    end
+	    r = tostring(n.char)
+	 end
+      end
+      tex.sprint(r)
+   end
+end
+
 -- debug
 
 do

Modified: trunk/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty	2016-06-18 22:06:08 UTC (rev 41488)
+++ trunk/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty	2016-06-18 22:07:21 UTC (rev 41489)
@@ -724,29 +724,57 @@
   \directlua{luatexja.jfont.does_alt_set'\luatexluaescapestring{#1}'}}
 
 %%%% patch \@text at composite because of {y,t}albaselineshift
-\def\@text at composite#1#2#3#{%
-  \begingroup
-  \setbox\z@=\hbox\bgroup%
-  \ltj at yablshift\z@\ltj at tablshift\z@
-  \expandafter\@text at composite@x
-  \csname\string#1-\string#2\endcsname}
+
+%% \pltx at isletter from plfonts.dtx
+\def\pltx at mark{\pltx at mark@}
+\let\pltx at scanstop\relax
+\long\def\pltx at cond#1\fi{%
+  #1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
+\long\def\pltx at isletter#1{%
+  \expandafter\pltx at isletter@i\romannumeral-`0#1\pltx at scanstop}
+\long\def\pltx at isletter@i#1\pltx at scanstop{%
+  \pltx at cond\ifx\pltx at mark#1\pltx at mark\fi{\@firstoftwo}%
+    {\pltx at isletter@ii\pltx at scanstop#1\pltx at scanstop{}#1\pltx at mark}}
+\long\def\pltx at isletter@ii#1\pltx at scanstop#{%
+  \pltx at cond\ifx\pltx at mark#1\pltx at mark\fi%
+    {\pltx at isletter@iii}{\pltx at isletter@iv}}
+\long\def\pltx at isletter@iii#1\pltx at mark{\@secondoftwo}
+\long\def\pltx at isletter@iv#1#2#3\pltx at mark{%
+  \pltx at cond\ifx\pltx at mark#3\pltx at mark\fi{%
+    \pltx at cond{\ifnum0\ifcat A\noexpand#21\fi\ifcat=\noexpand#21\fi>\z@}\fi
+      {\@firstoftwo}{\@secondoftwo}%
+  }{\@secondoftwo}}
+
 \def\@text at composite@x#1#2{%
   \ifx#1\relax
-    \expandafter\@secondoftwo
-  \else
-    \expandafter\@firstoftwo
+    #2%
+  \else\pltx at isletter{#1}{#1}{%
+    \begingroup
+    \setbox\z@\hbox\bgroup%
+      \ltj at yablshift\z@ \ltj at tablshift\z@
+      #1%
+      \@tempcntb\directlua{luatexja.pltx_composite_last_node_char()}%)
+      \xdef\pltx at composite@temp{\noexpand\@tempcntb=\the\@tempcntb\relax}%
+      \aftergroup\pltx at composite@temp
+    \egroup
+    \ifnum\ltjgetparameter{direction}=3 %
+      \@tempdima=\ltj at tablshift sp\else\@tempdima=\ltj at yablshift sp\fi
+    \ifnum\@tempcntb<\z@\@tempcnta\z@\else
+      \@tempcnta=\ltjgetparameter{jacharrange}{\ltjgetparameter{chartorange}{\@tempcntb}}\relax
+      \ifnum\@tempcnta=\z@\@tempdima\z@\fi
+    \fi
+    \ifnum\@tempcnta>\z@
+      \ifodd\ltjgetparameter{alxspmode}{\@tempcntb}\else\leavevmode\hbox{}\fi
+      \begingroup\mathsurround\z@$%
+        \hbox{\lower\@tempdima\box\z@}
+      $\endgroup%
+      \ifnum\ltjgetparameter{alxspmode}{\@tempcntb}<2\hbox{}\fi
+    \else
+      \ifdim\@tempdima=\z@{\ltj at yablshift\z@ \ltj at tablshift\z@#1}%
+      \else\lower\@tempdima\box\z@\fi
+    \fi
+    \endgroup}%
   \fi
-  #1{#2}\egroup
-  \leavevmode
-  \expandafter\lower
-    \ifnum\ltjgetparameter{direction}=3
-      \ltjgetparameter{talbaselineshift}
-    \else\ifmmode
-      \z@
-    \else
-      \ltjgetparameter{yalbaselineshift}
-    \fi\fi
-    \box\z@
-  \endgroup}
+}
 
 \endinput



More information about the tex-live-commits mailing list