From ad8f7d8a553f208ff951ee7cec063e7ab7f4ceb9 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 11 Feb 2022 21:54:49 +0000 Subject: luatexja (11feb22) git-svn-id: svn://tug.org/texlive/trunk@61981 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/luatex/luatexja/addons/luatexja-adjust.sty | 15 ++++++++++----- .../texmf-dist/tex/luatex/luatexja/ltj-adjust.lua | 21 ++++++++++++++++++--- .../texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua | 2 +- Master/texmf-dist/tex/luatex/luatexja/luatexja.sty | 2 +- 4 files changed, 30 insertions(+), 10 deletions(-) (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-adjust.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-adjust.sty index 5d37eb6258d..ab0c5807468 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-adjust.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-adjust.sty @@ -64,7 +64,7 @@ \expandafter\let\csname ifltj@in@latex\expandafter\endcsname \csname iftrue\endcsname \NeedsTeXFormat{LaTeX2e} - \ProvidesPackage{luatexja-adjust}[2022-02-07] + \ProvidesPackage{luatexja-adjust}[2022-02-11] \fi % % Load core module if not yet. @@ -137,13 +137,18 @@ \define@key[ltj]{japaram}{profile_hgap_factor}{% \directlua{luatexja.adjust.profile_hgap_factor = math.abs(#1)}\relax} -\newluafunction\ltj@@ghost@jachar@inner -\typeout{\the\ltj@@ghost@jachar@inner.} +\newluafunction\ltj@@ghost@jachar@inner@both +\newluafunction\ltj@@ghost@jachar@inner@before +\newluafunction\ltj@@ghost@jachar@inner@after \directlua{ local t = lua.get_functions_table(); local cgj = luatexja.adjust.create_ghost_jachar_node; - t[\the\ltj@@ghost@jachar@inner] = function() cgj(0) end + t[\the\ltj@@ghost@jachar@inner@both] = function() cgj(0) end; + t[\the\ltj@@ghost@jachar@inner@before] = function() cgj(1) end; + t[\the\ltj@@ghost@jachar@inner@after] = function() cgj(2) end }% -\protected\def\ltjghostjachar{\ifhmode\relax\luafunction\ltj@@ghost@jachar@inner\fi} +\protected\def\ltjghostjachar{\ifhmode\relax\luafunction\ltj@@ghost@jachar@inner@both\fi}% will be removed +\protected\def\ltjghostbeforejachar{\ifhmode\relax\luafunction\ltj@@ghost@jachar@inner@before\fi} +\protected\def\ltjghostafterjachar{\ifhmode\relax\luafunction\ltj@@ghost@jachar@inner@after\fi} %%------------------ all done diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-adjust.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-adjust.lua index 87c85dd07a4..71584d8b5cf 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltj-adjust.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-adjust.lua @@ -565,11 +565,23 @@ do setfield(tn, 'value', cl) node_write(tn) end + local attr_curjfnt = luatexbase.attributes['ltj@curjfnt'] + local attr_curtfnt = luatexbase.attributes['ltj@curtfnt'] + local dir_tate = luatexja.dir_table.dir_tate + local get_dir_count = ltjd.get_dir_count + local ltjf_font_metric_table = ltjf.font_metric_table + local function get_current_metric(n) + local fn = has_attr(n, (get_dir_count()==dir_tate) and attr_curtfnt or attr_curjfnt) + return fn and ltjf_font_metric_table[fn] + end local function whatsit_callback(Np, lp, Nq) if Np and Np.nuc then return Np elseif Np and getfield(lp, 'user_id') == GHOST_JACHAR then - Np.first = lp; Np.nuc = lp; Np.last = lp; Np.class = getfield(lp,'value') - if Nq then Np.met = Nq.met; Np.pre = 0; Np.post = 0; Np.xspc = 3 end + Np.first = lp; Np.nuc = lp; Np.last = lp; Np.class = 0 + if getfield(lp,'value')<2 then + if Nq and Nq.met then Np.met = Nq.met; else Np.met = get_current_metric(lp) end + Np.pre = 0; Np.post = 0; Np.xspc = 3 + else Np.met, Np.pre = nil, nil; end Np.auto_kspc, Np.auto_xspc = (has_attr(lp, attr_autospc)==1), (has_attr(lp, attr_autoxspc)==1) return Np else return Np end @@ -578,7 +590,10 @@ do if not s and getfield(Nq.nuc, 'user_id') == GHOST_JACHAR then local x, y = node_prev(Nq.nuc), Nq.nuc Nq.first, Nq.nuc, Nq.last = x, x, x - if Np then Nq.met = Np.met end + if getfield(y,'value')%2==0 then + if Np and Nq.met then Nq.met = Np.met; else Nq.met = get_current_metric(y) end + Nq.pre = 0; Nq.post = 0; Nq.xspc = 3 + else Nq.met, Nq.pre = nil, nil; end s = node_remove(head, y); node_free(y) end return s diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua index 7ada76335b5..61c21b90944 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua @@ -3,7 +3,7 @@ -- luatexbase.provides_module({ name = 'luatexja.jfmglue', - date = '2022-02-03', + date = '2022-02-09', description = 'Insertion process of JFM glues, [x]kanjiskip and others', }) luatexja.jfmglue = luatexja.jfmglue or {} diff --git a/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty b/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty index ae389af99b9..26ebad2832a 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty @@ -27,7 +27,7 @@ \newif\ifltj@disablejfam %%%% VERSION -\def\LuaTeXjaversion{20220207.0} +\def\LuaTeXjaversion{20220211.0} %% Check if LaTeX is used. \begingroup\expandafter\expandafter\expandafter\endgroup -- cgit v1.2.3