From 73053561ab53b7eb9ef39d5ceb11a49812be47c4 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 14 Feb 2021 22:33:09 +0000 Subject: luatexja (14feb21) git-svn-id: svn://tug.org/texlive/trunk@57741 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/luatex/luatexja/README | 21 +- .../texmf-dist/doc/luatex/luatexja/luatexja-en.pdf | Bin 699665 -> 700774 bytes .../texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf | Bin 1135849 -> 1136034 bytes Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx | 10 +- .../texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua | 16 +- .../texmf-dist/tex/luatex/luatexja/ltj-jfont.lua | 11 +- .../tex/luatex/luatexja/ltj-setwidth.lua | 18 +- Master/texmf-dist/tex/luatex/luatexja/luatexja.lua | 2 +- Master/texmf-dist/tex/luatex/luatexja/luatexja.sty | 4 +- .../tex/luatex/luatexja/patches/lltjdefs.sty | 13 +- .../tex/luatex/luatexja/patches/lltjfont.sty | 291 +++++++++++++++++---- 11 files changed, 294 insertions(+), 92 deletions(-) diff --git a/Master/texmf-dist/doc/luatex/luatexja/README b/Master/texmf-dist/doc/luatex/luatexja/README index e6c21ab1002..de1f90c0a2f 100644 --- a/Master/texmf-dist/doc/luatex/luatexja/README +++ b/Master/texmf-dist/doc/luatex/luatexja/README @@ -1,4 +1,4 @@ -The LuaTeX-ja Package 20210103.0 +The LuaTeX-ja Package 20210214.0 -------------------------------- Copyright (c) 2011--2021 The LuaTeX-ja project License: modified BSD (see COPYING) @@ -25,14 +25,13 @@ Installation - LuaTeX 1.10.0 (or later) - luaotfload (v3.1 or later recommended) - adobemapping (Adobe CMap files) - - LaTeX 2020-02-02 patch level 5 or later (if you want to use with LaTeX) - - everysel package + - LaTeX2e 2020-02-02 patch level 5 or later (if you want to use with LaTeX) + Note that the adaptation for LaTeX2e 2021-05-01 is + work in progress; it will be done after the freeze of TL'20 - etoolbox package - - ltxcmds package - - pdftexcmds package - - atbegshi package - - filehook package - - stfloats package + - ltxcmds package, pdftexcmds package + - filehook package, atbegshi package (for LaTeX2e 2020-02-02) + - everysel package (for LaTeXe 2020-02-02 and 2020-10-01) - Harano Aji fonts (https://github.com/trueroad/HaranoAjiFonts) more specifically, HaranoAjiMincho-Regular and HaranoAjiGothic-Medium @@ -45,9 +44,9 @@ Installation 2. If you must/want to install manually: a. Download the source archive from CTAN, - or tagged as 20210103.0 in the Git repository by + or tagged as 20210214.0 in the Git repository by + ;a=snapshot;h=refs/tags/20210214.0;sf=tgz> b. Extract the archive and process following three files by LuaLaTeX to generate classes for Japanese typesetting: @@ -96,4 +95,4 @@ Notes This file and ltj-kinsoku.lua are not used anymore. (Do not remove ltj-kinsoku.tex.) -Last commit date: Sun Jan 3 09:48:34 2021 +0900 +Last commit date: Sun Feb 14 10:04:35 2021 +0900 diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf b/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf index 41fd1bd2464..a40501866e6 100644 Binary files a/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf and b/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf differ diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf b/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf index ea0025d79d1..ee3964dc097 100644 Binary files a/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf and b/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf differ diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx b/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx index eaf4b8ebae6..308288dabc9 100644 --- a/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx +++ b/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx @@ -652,17 +652,15 @@ and \emph{Japanese fonts} for fonts used in \textbf{JAchar}. % (DVI出力(\cs{outputmode=0})は対応していない.) \item recent \href{https://github.com/latex3/luaotfload}{\Pkg{luaotfload}} (v3.1 or later recommended) \item \Pkg{adobemapping} (Adobe cmap and pdfmapping files) -\item \LaTeX\ 2020-02-02 patch level 5 or later +\item \LaTeXe\ 2020-02-02 patch level 5 or later % (if you want to use \LuaTeX-ja with \LaTeXe) % (\LaTeXe 下で\LuaTeX-jaを使う場合) -\item \href{https://github.com/josephwright/etoolbox/}{\Pkg{etoolbox}}, - \Pkg{everysel} +\item \href{https://github.com/josephwright/etoolbox/}{\Pkg{etoolbox}} % (if you want to use \LuaTeX-ja with \LaTeXe) % (\LaTeXe 下で\LuaTeX-jaを使う場合) +\item \Pkg{everysel} (only for \LaTeXe\ 2020-02-02~and~2020-10-01) +\item \Pkg{filehook}, \Pkg{atbegshi} (only for \LaTeXe\ 2020-02-02) \item \Pkg{ltxcmds}, \Pkg{pdftexcmds} -\item \Pkg{filehook}, \Pkg{atbegshi} -% (not needed if you want to use \LuaTeX-ja with \LaTeXe~2020-10-01 or later) -% (\LaTeXe 2020-10-01以降で\LuaTeX-jaを使う場合はどちらも不要) \item \href{https://github.com/wspr/fontspec/}{\Pkg{fontspec}} v2.7c (or later) %<*en> \item \emph{Harano Aji fonts} (\url{https://github.com/trueroad/HaranoAjiFonts})\\ diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua index 019e24ae2ec..74374927726 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 = '2020-12-22', + date = '2021-02-11', description = 'Insertion process of JFM glues, [x]kanjiskip and others', }) luatexja.jfmglue = luatexja.jfmglue or {} @@ -347,8 +347,7 @@ function calc_np_aux_glyph_common(lp, acc_flag) local lx=lp while lx do local lai = get_attr_icflag(lx) - if lx==last or lai>=PACKED then - lp=lx; break + if lx==last or lai>=PACKED then break else local lid = getid(lx) if lid==id_glyph and not if_lang_ja(lx) then @@ -368,19 +367,20 @@ function calc_np_aux_glyph_common(lp, acc_flag) else -- アクセントは上下にシフトされている setfield(lx, 'shift', getfield(lx, 'shift') + (has_attr(lx,attr_ablshift) or 0)) end - lx = node_next(node_next(lx)) + set_attr(lx, attr_icflag, PROCESSED) + lx = node_next(lx); set_attr(lx, attr_icflag, PROCESSED) + lx = node_next(lx); set_attr(lx, attr_icflag, PROCESSED) elseif ls==0 then Np.last = lx; lx = node_next(lx) elseif (ls==3) or (lai==ITALIC) then Np.last = lx; set_attr(lx, attr_icflag, IC_PROCESSED); lx = node_next(lx) - else - lp=lx; break + else break end - else - lp=lx; break + else break end end end + lp=lx local r if adj_depth>node_depth then r = node_new(id_rule,3) diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua index ed40e86821f..ac8ce5c2fb6 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua @@ -784,6 +784,11 @@ end luatexja.jfont.font_extra_info = font_extra_info -- key: fontnumber local font_extra_basename = {} -- key: basename +local rotate_exception = { + [0xFF1A]= { ['zht'] = true, }, + [0xFF1B]= { ['zht'] = true, }, +} +luatexja.jfont.rotate_exception = rotate_exception local list_rotate_glyphs do local ceil = math.ceil @@ -825,14 +830,14 @@ do -- end) for i,_ in pairs(rot) do dest = dest or {}; dest.rotation = dest.rotation or {} - dest.rotation[i] = true + dest.rotation[i] = rotate_exception[i] or true end return dest end end do - local cache_ver = 23 + local cache_ver = 24 local nameonly, lower = file.nameonly, string.lower local lfs = require"lfs" local file_attributes = lfs.attributes @@ -972,7 +977,7 @@ luatexbase.add_to_callback( for j,w in pairs(vform) do if (i==j)and(w==k) then vform[j]=nil elseif w==i then vform[j] = k end end - end) + end) return fmtable end, 'ltj.get_vert_form', 1 ) diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-setwidth.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-setwidth.lua index c502e9879e0..03ec44fe136 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltj-setwidth.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-setwidth.lua @@ -190,13 +190,19 @@ local function capsule_glyph_tate(p, met, char_data, head, dir) local pf, pc = getfont(p), getchar(p) local feir = ltjf_font_extra_info[pf] if met.rotation and met.vert_activated then - if met.rotation[pc] and (has_attr(p, attr_vert_ori) or 0)<=0 then + local f = font_getfont(pf) + local r, l = met.rotation[pc], f.properties and f.properties.language + if ((r==true) or (type(r)=="table" and not r[l])) and (has_attr(p, attr_vert_ori) or 0)<=0 then return capsule_glyph_tate_rot(p, met, char_data, head, dir, 0.5*(get_ascender(pf)-get_descender(pf))) - end - end - pwidth, ascender = feir.vheight[pc]*met.size, feir.vorigin[pc]*met.size + end + end + pwidth, ascender = feir.vheight[pc]*met.size, feir.vorigin[pc]*met.size + -- print(pwidth/65536.,ascender/65536.) end + -- luatexja.ext_show_node(node.direct.tonode(p), 'B> ', print) + local xo, yo = getoffsets(p) + --pwidth = pwidth - yo fwidth = fwidth or pwidth if pwidth>fwidth and char_data.round_threshold then local frac = pwidth / fwidth @@ -207,7 +213,6 @@ local function capsule_glyph_tate(p, met, char_data, head, dir) fshift = call_callback("luatexja.set_width", fshift, met, char_data) local fheight = char_data.height or 0 local fdepth = char_data.depth or 0 - local xo, yo = getoffsets(p) local y_shift = xo + (has_attr(p,attr_tkblshift) or 0) local q head, q = node_remove(head, p) @@ -215,7 +220,7 @@ local function capsule_glyph_tate(p, met, char_data, head, dir) setwhd(box, fwidth, fheight, fdepth) setfield(box, 'shift', y_shift) setdir(box, dir) - + -- print(yo, ascender, char_data.align, fwidth-pwidth) setoffsets(p, -fshift.down, yo -(ascender + char_data.align*(fwidth-pwidth) - fshift.left) ) local ws = node_new(id_whatsit, sid_save) @@ -231,6 +236,7 @@ local function capsule_glyph_tate(p, met, char_data, head, dir) setnext(k3, wr); set_attr(box, attr_icflag, PACKED) + -- luatexja.ext_show_node(node.direct.tonode(box), 'A> ', print) head = q and node_insert_before(head, q, box) or node_insert_after(head, node_tail(head), box) return q, head, box diff --git a/Master/texmf-dist/tex/luatex/luatexja/luatexja.lua b/Master/texmf-dist/tex/luatex/luatexja/luatexja.lua index b4e2e68efb6..fbda46e3440 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/luatexja.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/luatexja.lua @@ -351,7 +351,7 @@ do r = tostring(n.char) end end - tex.sprint(r) + tex.sprint(-2, r) end end diff --git a/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty b/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty index 34486345922..c389cf8d50a 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty @@ -35,13 +35,13 @@ \expandafter\let\csname ifltj@in@latex\expandafter\endcsname \csname iftrue\endcsname \NeedsTeXFormat{LaTeX2e} - \ProvidesPackage{luatexja}[2021-01-03 Japanese Typesetting with Lua(La)TeX] + \ProvidesPackage{luatexja}[2021-02-14 Japanese Typesetting with Lua(La)TeX] \DeclareOption{disablejfam}{\ltj@disablejfamtrue} \DeclareOption*{} \ProcessOptions\relax \fi % %%%% VERSION -\def\LuaTeXjaversion{20210103.0} +\def\LuaTeXjaversion{20210214.0} \directlua{require('ltj-unicode-ccfix.lua')}% catcode of ideographs diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjdefs.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjdefs.sty index 754a9122f84..07b2c0d58b1 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjdefs.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjdefs.sty @@ -3,7 +3,7 @@ % \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{lltjdefs}[2020-10-05 Default font settings of LuaTeX-ja] +\ProvidesPackage{lltjdefs}[2021-01-24 Default font settings of LuaTeX-ja] \ifdefined\ltj@stdmcfont\else\def\ltj@stdmcfont{file:HaranoAjiMincho-Regular.otf}\fi \ifdefined\ltj@stdgtfont\else\def\ltj@stdgtfont{file:HaranoAjiGothic-Medium.otf}\fi @@ -18,8 +18,13 @@ \DeclareKanjiEncodingDefaults{}{} \DeclareErrorKanjiFont{JY3}{mc}{m}{n}{10} \kanjifamily{mc} -\kanjiseries{m} -\kanjishape{n} +\ifnum\ltj@@latex@plv<1500 % <=2020-10-01 + \kanjiseries{m} + \kanjishape{n} +\else % >=2021-05-01 + \def\k@series{m} + \def\k@shape{n} +\fi \fontsize{10}{10} \DeclareYokoKanjiEncoding{JY3}{}{} \DeclareKanjiSubstitution{JY3}{mc}{m}{n} @@ -35,7 +40,7 @@ \ifnum 0\ifltj@ltfilehook@avail1\fi\ifdefined\@rmfamilyhook1\fi>0 %% LaTeX 2020-02-02 \newcommand\kanjishapedefault{\shapedefault} -\else %% LaTeX 2019-10-01 +\else%% LaTeX 2019-10-01 \newcommand\kanjishapedefault{\updefault} \fi diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty index 287a3968f5d..8ebe8e7af23 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty @@ -3,7 +3,30 @@ % \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{lltjfont}[2020-12-29 Patch to NFSS2 for LuaTeX-ja] +\ProvidesPackage{lltjfont}[2021-02-14 Patch to NFSS2 for LuaTeX-ja] + +%%%%%%%% LaTeX2e version detection +\newcount\ltj@@latex@plv \ltj@@latex@plv=-1 +\ifltj@ltfilehook@avail + \IfHookExistsTF{selectfont}% + {\ltj@@latex@plv=1500}% 2021-05-01 + {\ifnum\patch@level>2 \ltj@@latex@plv=1300\else \ltj@@latex@plv=1000\fi}% 2020-10-01 +\else\ifdefined\@rmfamilyhook % 2020-02-02 + \ifx\@forced@seriestrue\@undefined % 2020-02-02 pl0--2 + \@latex@error + {Please update LaTeX2e!^^J\space\space + At least LaTeX2e 2020-02-02 patch level 3 is required}% + {LaTeX2e 2020-02-02 patch level 2 (and 4) has a bug.} + \else + \ltj@@latex@plv=300 + \unless\ifx\series@maybe@drop@one@m@x\@undefined % pl5 + develop + \ltj@@latex@plv=501 + \else\unless\ifx\series@maybe@drop@one@m\@undefined % patch level 5 + \ltj@@latex@plv=500 + \fi\fi + \fi +\fi\fi + %% patching \DeclareTextComposite \def\ltj@chardef@text@cmd#1{% @@ -350,18 +373,6 @@ \newif\if@knjcmd \DeclareRobustCommand\userelfont{\@knjcmdtrue} - -\RequirePackage{everysel} -\let\ltj@@EverySelectfont@Init=\@EverySelectfont@Init -\expandafter\expandafter\expandafter\let -\expandafter\expandafter\csname ltj@@orig@selectfont\endcsname\csname selectfont\space\endcsname -\@EverySelectfont@Init -%\let\ltj@@font@info\@font@info -%\let\ltj@@font@warning\@font@warning -\def\@EverySelectfont@Init{% - \expandafter\let\csname selectfont\space \endcsname \ltj@@orig@selectfont - \ltj@@EverySelectfont@Init -} \def\ltj@selectfont@tate{% \let\k@encoding\ct@encoding \xdef\font@name{\csname\curr@kfontshape/\f@size\endcsname}% @@ -386,7 +397,8 @@ \directlua{luatexja.jfont.pickup_alt_font_a('\f@size')}% }% \fi} -\def\ltj@selectfont@patch{% +\ifnum\ltj@@latex@plv<1500 % <=2020-10-01 +\protected\def\ltj@selectfont@patch{% \ltj@@start@time@measure{selectfont}% \let\tmp@error@fontshape\error@fontshape \let\error@fontshape\error@kfontshape @@ -427,7 +439,78 @@ \global\let\font@name=\ltj@afont@name \ltj@@stop@time@measure{selectfont}% } +\RequirePackage{everysel} +\let\ltj@@EverySelectfont@Init=\@EverySelectfont@Init +\expandafter\expandafter\expandafter\let +\expandafter\expandafter\csname ltj@@orig@selectfont\endcsname\csname selectfont\space\endcsname +\@EverySelectfont@Init% for LaTeX2e <=2020-10-01 +\def\@EverySelectfont@Init{% + \expandafter\let\csname selectfont\space \endcsname \ltj@@orig@selectfont + \ltj@@EverySelectfont@Init +} \EverySelectfont{\ltj@selectfont@patch} +\else % LaTeX2e >=2021-05-01 +\AddToHook{selectfont}[luatexja]{% + \ltj@@start@time@measure{selectfont}% + \ifx\delayed@k@adjustment\@empty + \else + \let\k@shape@saved\k@shape + \let\k@series@saved\k@series + \delayed@k@adjustment + \begingroup\let\f@encoding\k@encoding\let\f@family\k@family + \maybe@load@fontshape\endgroup + \ifcsname \k@encoding/\k@family/\k@series/\k@shape \endcsname + \else + \let\k@shape\k@shape@saved + \let\k@series\k@series@saved + \let\delayed@merge@kanji@shape\merge@kanji@shape + \let\delayed@merge@kanji@series\merge@kanji@series + \delayed@k@adjustment + \let\delayed@merge@kanji@shape\merge@kanji@shape@without@substitution + \let\delayed@merge@kanji@series\merge@kanji@series@without@substitution + \fi + \let\delayed@k@adjustment\@empty + \fi + \let\tmp@error@fontshape\error@fontshape + \let\error@fontshape\error@kfontshape + \ltj@@is@kyenc{\k@encoding}\ifin@% + \let\cy@encoding\k@encoding + \ensure@KanjiEncodingPair{t}% + \edef\ct@encoding{\csname t@enc@\k@encoding\endcsname}% + \else + \ltj@@is@ktenc{\k@encoding}\ifin@% + \let\ct@encoding\k@encoding + \ensure@KanjiEncodingPair{y}% + \edef\cy@encoding{\csname y@enc@\k@encoding\endcsname}% + \else + \@latex@error{KANJI Encoding scheme `\k@encoding' unknown}\@eha + \fi + \fi + \global\let\ltj@afont@name=\font@name + \ltj@selectfont@tate\ltj@selectfont@yoko +% + \edef\tmp@item{{\k@encoding}}\expandafter\def\expandafter\k@encoding\tmp@item + \kenc@update + \global\let\font@name=\ltj@afont@name + \let\error@fontshape\tmp@error@fontshape + \if@knjcmd \@knjcmdfalse + \expandafter\ifx + \csname rel@\k@encoding/\k@family/\k@series/\k@shape\endcsname\relax + \expandafter\ifx + \csname rel@\k@encoding/\k@family/\k@series/all\endcsname\relax + \else + \csname rel@\k@encoding/\k@family/\k@series/all\endcsname\selectfont + % 警告: 再び \selectfont を呼んでいる.無限ループの可能性あり + \fi + \else + \csname rel@\k@encoding/\k@family/\k@series/\k@shape\endcsname\selectfont + % 警告: 再び \selectfont を呼んでいる.無限ループの可能性あり + \fi + \fi + \global\let\font@name=\ltj@afont@name + \ltj@@stop@time@measure{selectfont}% +} +\fi \bgroup \def\ltj@@dir@patch#1#2#3{% @@ -632,26 +715,6 @@ \fi\fi } -\newcount\ltj@@latex@plv \ltj@@latex@plv=-1 -\ifltj@ltfilehook@avail % 2020-10-01 - \@ifl@t@r\fmtversion{2020-10-02}{\ltj@@latex@plv=1300}% - {\ifnum\patch@level>2 \ltj@@latex@plv=1300\else \ltj@@latex@plv=1000\fi} -\else\ifdefined\@rmfamilyhook % 2020-02-02 - \ifx\@forced@seriestrue\@undefined % 2020-02-02 pl0--2 - \@latex@error - {Please update LaTeX2e!^^J\space\space - At least LaTeX2e 2020-02-02 patch level 3 is required}% - {LaTeX2e 2020-02-02 patch level 2 (and 4) has a bug.} - \else - \ltj@@latex@plv=300 - \unless\ifx\series@maybe@drop@one@m@x\@undefined % pl5 + develop - \ltj@@latex@plv=501 - \else\unless\ifx\series@maybe@drop@one@m\@undefined % patch level 5 - \ltj@@latex@plv=500 - \fi\fi - \fi -\fi\fi - %%%%%% \ifnum\ltj@@latex@plv>0 %%%% LaTeX >= 2020-02-02 @@ -664,6 +727,13 @@ {#1}% \@nil } +\def\merge@kanji@shape#1{% + \expandafter\expandafter\expandafter + \merge@kanji@shape@ + \csname shape@\k@shape @#1\endcsname + {#1}% + \@nil +} \ifnum\ltj@@latex@plv>500 % !!! pl5 + develop \def\set@target@series@kanji#1{% @@ -682,6 +752,7 @@ } \fi\fi +\ifnum\ltj@@latex@plv<1500% <=2020-10-01 \def\merge@kanji@series@#1#2#3\@nil{% \def\reserved@a{#3}% \ifx\reserved@a\@empty @@ -703,13 +774,75 @@ \fi \fi } -\def\merge@kanji@shape#1{% +\def\merge@kanji@shape@#1#2#3\@nil{% + \def\reserved@a{#3}% + \ifx\reserved@a\@empty + \if@shape@roman@kanji + \set@safe@kanji@shape{#2}{}% + \else + \edef\k@shape{#2}% + \fi + \else + \begingroup\let\f@encoding\k@encoding\let\f@family\k@family + \maybe@load@fontshape\endgroup + \edef\reserved@a{\k@encoding /\k@family /\k@series/#1}% + \ifcsname \reserved@a\endcsname + \edef\k@shape{#1}% + \else + \ifcsname \k@encoding /\k@family /\k@series/#2\endcsname + \edef\k@shape{#2}% + {\let\curr@fontshape\curr@kfontshape\@font@shape@subst@warning}% + \else + \if@shape@roman@kanji + \set@safe@kanji@shape{#3}% + {{\let\curr@fontshape\curr@kfontshape\@font@shape@subst@warning}}% + \else + \edef\k@shape{#3}% + {\let\curr@fontshape\curr@kfontshape\@font@shape@subst@warning}% + \fi + \fi + \fi + \fi +} +\else % >=2021-05-01 +\def\merge@kanji@series@#1#2#3\@nil{% + \def\reserved@a{#3}% + \ifx\reserved@a\@empty + \set@target@series@kanji{#2}% + \else + \begingroup\let\f@encoding\k@encoding\let\f@family\k@family + \maybe@load@fontshape\endgroup + \edef\reserved@a{\k@encoding /\k@family /#1/\k@shape}% + \ifcsname \reserved@a \endcsname + \set@target@series@kanji{#1}% + \else + \ifcsname \k@encoding /\k@family /#2/\k@shape \endcsname + \set@target@series@kanji{#2}% + {\let\curr@fontshape\curr@kfontshape\@font@shape@subst@warning}% + \else + \set@target@series@kanji{#3}% + {\let\curr@fontshape\curr@kfontshape\@font@shape@subst@warning}% + \fi + \fi + \fi +} +\def\merge@kanji@series@without@substitution#1{% \expandafter\expandafter\expandafter - \merge@kanji@shape@ - \csname shape@\k@shape @#1\endcsname + \merge@kanji@series@without@substitution@ + \csname series@\k@series @#1\endcsname {#1}% \@nil } +\def\merge@kanji@series@without@substitution@#1#2#3\@nil{% + \def\reserved@a{#3}% + \ifx\reserved@a\@empty + \set@target@series@kanji{#2}% + \else + \set@target@series@kanji{#1}% + \fi +} +\let\delayed@merge@kanji@series\merge@kanji@series@without@substitution + \def\merge@kanji@shape@#1#2#3\@nil{% \def\reserved@a{#3}% \ifx\reserved@a\@empty @@ -719,8 +852,6 @@ \edef\k@shape{#2}% \fi \else - \begingroup\let\f@encoding\k@encoding\let\f@family\k@family - \maybe@load@fontshape\endgroup \edef\reserved@a{\k@encoding /\k@family /\k@series/#1}% \ifcsname \reserved@a\endcsname \edef\k@shape{#1}% @@ -740,7 +871,25 @@ \fi \fi } -\ifnum\ltj@@latex@plv=300 % !!! pl3, 4 +\def\merge@kanji@shape@without@substitution#1{% + \expandafter\expandafter\expandafter + \merge@kanji@shape@without@substitution@ + \csname shape@\k@shape @#1\endcsname + {#1}% + \@nil +} +\def\merge@kanji@shape@without@substitution@#1#2#3\@nil{% + \def\reserved@a{#3}% + \ifx\reserved@a\@empty + \edef\k@shape{#2}% + \else + \edef\k@shape{#1}% + \fi +} +\let\delayed@merge@kanji@shape\merge@kanji@shape@without@substitution +\fi + +\ifnum\ltj@@latex@plv=300 % 2020-02-02 pl3, 4 \DeclareRobustCommand\romanseries[1]{\merge@font@series{#1}} \DeclareRobustCommand\kanjiseries[1]{\merge@kanji@series{#1}} \DeclareRobustCommand\fontseries[1]{% @@ -749,7 +898,7 @@ \DeclareRobustCommand\kanjiseriesforce[1]{\edef\k@series{#1}} \DeclareRobustCommand\fontseriesforce[1]{% \edef\f@series{#1}\edef\k@series{#1}} -\else % !!! pl 5 +\else\ifnum\ltj@@latex@plv<1500% >=2020-02-02 pl5 and <=2020-10-01 \DeclareRobustCommand\romanseries[1]{\@forced@seriesfalse\merge@font@series{#1}} \DeclareRobustCommand\kanjiseries[1]{\@forced@seriesfalse\merge@kanji@series{#1}} \DeclareRobustCommand\fontseries[1]{% @@ -758,17 +907,57 @@ \DeclareRobustCommand\kanjiseriesforce[1]{\@forced@seriestrue\merge@kanji@series{#1}} \DeclareRobustCommand\fontseriesforce[1]{% \@forced@seriestrue\merge@font@series{#1}\merge@kanji@series{#1}} +\else% >=2021-05-01 + \DeclareRobustCommand\romanseries[1]{\@forced@seriesfalse + \expandafter\def\expandafter\delayed@f@adjustment\expandafter + {\delayed@f@adjustment\delayed@merge@font@series{#1}}} + \DeclareRobustCommand\kanjiseries[1]{\@forced@seriesfalse + \expandafter\def\expandafter\delayed@k@adjustment\expandafter + {\delayed@k@adjustment\delayed@merge@kanji@series{#1}}} + \DeclareRobustCommand\fontseries[1]{\kanjiseries{#1}\romanseries{#1}} + \DeclareRobustCommand\romanseriesforce[1]{\@forced@seriestrue + \expandafter\def\expandafter\delayed@f@adjustment\expandafter + {\delayed@f@adjustment\edef\f@series{#1}}} + \DeclareRobustCommand\kanjiseriesforce[1]{\@forced@seriestrue + \expandafter\def\expandafter\delayed@k@adjustment\expandafter + {\delayed@k@adjustment\edef\k@series{#1}}} + \DeclareRobustCommand\fontseriesforce[1]{\kanjiseriesforce{#1}\romanseriesforce{#1}}% + \let\delayed@k@adjustment\@empty +\fi\fi +\ifnum\ltj@@latex@plv<1500% <=2020-10-01 + \DeclareRobustCommand\romanshape[1]{\merge@font@shape{#1}} + \DeclareRobustCommand\kanjishape[1]{\merge@kanji@shape{#1}} + \DeclareRobustCommand\fontshape[1]{% + \@shape@roman@kanjitrue + \merge@font@shape{#1}\merge@kanji@shape{#1}% + \@shape@roman@kanjifalse + } + \DeclareRobustCommand\romanshapeforce[1]{\edef\f@shape{#1}} + \DeclareRobustCommand\kanjishapeforce[1]{\edef\k@shape{#1}} + \DeclareRobustCommand\fontshapeforce[1]{\set@safe@kanji@shape{#1}{}\romanshapeforce{#1}} +\else% >=2021-05-01 + \DeclareRobustCommand\romanshape[1]{% + \expandafter\def\expandafter\delayed@f@adjustment\expandafter + {\delayed@f@adjustment\delayed@merge@font@shape{#1}}} + \DeclareRobustCommand\kanjishape[1]{% + \expandafter\def\expandafter\delayed@k@adjustment\expandafter + {\delayed@k@adjustment\delayed@merge@kanji@shape{#1}}} + \DeclareRobustCommand\fontshape[1]{% + \romanshape{#1}% + \expandafter\def\expandafter\delayed@k@adjustment\expandafter + {\delayed@k@adjustment\@shape@roman@kanjitrue + \delayed@merge@kanji@shape{#1}\@shape@roman@kanjifalse}} + \DeclareRobustCommand\romanshapeforce[1]{% + \expandafter\def\expandafter\delayed@f@adjustment\expandafter + {\delayed@f@adjustment\edef\f@shape{#1}}} + \DeclareRobustCommand\kanjishapeforce[1]{% + \expandafter\def\expandafter\delayed@k@adjustment\expandafter + {\delayed@k@adjustment\edef\k@shape{#1}}} + \DeclareRobustCommand\fontshapeforce[1]{% + \romanshapeforce{#1}% + \expandafter\def\expandafter\delayed@k@adjustment\expandafter + {\delayed@k@adjustment\set@safe@kanji@shape{#1}{}}} \fi -\DeclareRobustCommand\romanshape[1]{\merge@font@shape{#1}} -\DeclareRobustCommand\kanjishape[1]{\merge@kanji@shape{#1}} -\DeclareRobustCommand\fontshape[1]{% - \@shape@roman@kanjitrue - \merge@font@shape{#1}\merge@kanji@shape{#1}% - \@shape@roman@kanjifalse -} -\DeclareRobustCommand\romanshapeforce[1]{\edef\f@shape{#1}} -\DeclareRobustCommand\kanjishapeforce[1]{\edef\k@shape{#1}} -\DeclareRobustCommand\fontshapeforce[1]{\set@safe@kanji@shape{#1}{}\romanshapeforce{#1}} \ifnum\ltj@@latex@plv>1000 %%%% LaTeX >= 2020-10-01 PL3 \DeclareRobustCommand\usekanji[4]{% -- cgit v1.2.3