From 708141c8e6a8521d7e1c2f32719877869d6d5a0f Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 3 Jan 2021 22:32:11 +0000 Subject: luatexja (3jan21) git-svn-id: svn://tug.org/texlive/trunk@57316 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/luatex/luatexja/addons/luatexja-ruby.sty | 10 ++++++++-- Master/texmf-dist/tex/luatex/luatexja/ltj-latex.sty | 10 +++++++--- Master/texmf-dist/tex/luatex/luatexja/ltj-otf.lua | 7 +++---- Master/texmf-dist/tex/luatex/luatexja/ltj-ruby.lua | 4 ++-- .../texmf-dist/tex/luatex/luatexja/luatexja-core.sty | 6 +++--- Master/texmf-dist/tex/luatex/luatexja/luatexja.sty | 4 ++-- .../tex/luatex/luatexja/patches/lltjfont.sty | 18 ++++++++++++++++-- .../tex/luatex/luatexja/patches/lltjp-geometry.sty | 9 ++++++--- .../tex/luatex/luatexja/patches/lltjp-listings.sty | 4 ++-- 9 files changed, 49 insertions(+), 23 deletions(-) (limited to 'Master/texmf-dist/tex/luatex') diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ruby.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ruby.sty index 90dfece2b9c..0dacf32bf8d 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ruby.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ruby.sty @@ -4,7 +4,7 @@ % LaTeX only! \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{luatexja-ruby}[2020-12-24 v0.5] +\ProvidesPackage{luatexja-ruby}[2020-12-25 v0.51] \RequirePackage{luatexja} %%------------------ @@ -63,6 +63,10 @@ %% attr は sp 単位だが,ユーザーは親文字全角単位で指定 \ltj@@rkeydef{intergap} +%% epsilon: モノルビ * n にする際に,ルビの方がどれだけ親文字より長い +%% 状況を許容するか.親文字全角単位.計算誤差を想定. +\ltj@@rkeydef{epsilon} + \ltj@@rkeydef{kenten}%% 圏点文字 \ltj@@rkeydef{fontcmd}%% フォント \define@boolkey[ltj]{ruby}{rubysmash}[true]{} @@ -98,6 +102,7 @@ \catcode`\_=11 \gdef\ltj@@ruby@create@table#1{% #1: ルビ全角 \string{ + eps = \ltj@safe@dimen{\ltj@@rubyip@epsilon\zw}, before_jfmgk = 0, after_jfmgk = 0, rubyzw = \ltj@safe@dimen{#1}, maxmargin = \ltj@safe@dimen{\ltj@@rubyip@maxmargin\zw}, @@ -244,7 +249,8 @@ stretchbol={0}{1}{1}, stretcheol={1}{1}{0}, maxmargin=0.5, size=0.5, intergap=0, rubysmash=false, kenten=\textbullet, fontcmd=\relax, ybaseheight=0.88, tbaseheight=0.5, - intrude_jfmgk, intrude_kanjiskip, intrude_xkanjiskip + intrude_jfmgk, intrude_kanjiskip, intrude_xkanjiskip, + epsilon=0.0001, } \endinput diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-latex.sty b/Master/texmf-dist/tex/luatex/luatexja/ltj-latex.sty index 506adea2e79..213f2f71094 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltj-latex.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-latex.sty @@ -12,7 +12,7 @@ \def\luatexjalatexLoaded{\endinput} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{ltj-latex}[2020-10-09 LaTeX support of LuaTeX-ja] +\ProvidesPackage{ltj-latex}[2020-12-29 LaTeX support of LuaTeX-ja] % cleanup at end of the document %\let\ltj@@orig@end=\@@end @@ -27,8 +27,12 @@ \fi \newif\ifltj@ltfilehook@avail \@ifl@t@r\fmtversion{2020-10-01}{% - \ifnum\patch@level<0\relax \ifnum\patch@level<-6 \ltj@ltfilehook@availtrue\fi - \else\ltj@ltfilehook@availtrue\fi + \@ifl@t@r\fmtversion{2020-10-02}% + {\ltj@ltfilehook@availtrue} + {% + \ifnum\patch@level<0\relax \ifnum\patch@level<-6 \ltj@ltfilehook@availtrue\fi + \else\ltj@ltfilehook@availtrue\fi + }% }{} %%% patch for LaTeX diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-otf.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-otf.lua index 42792769d7c..770749f9ea5 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltj-otf.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-otf.lua @@ -1,7 +1,6 @@ -- -- ltj-otf.lua -- -require 'unicode' require 'lualibs' luatexja.load_module 'base'; local ltjb = luatexja.base @@ -120,9 +119,9 @@ local function append_jglyph(char) setfield(p, 'value', char); node_write(p) end -local utf +local myutf do - utf = function (ucs) + myutf = function (ucs) if ltjd_get_dir_count()==dir_tate then ucs = ltju.replace_vert_variant( tex_get_attr((ltjd_get_dir_count()==dir_tate) and attr_curtfnt or attr_curjfnt), @@ -235,7 +234,7 @@ local disable_ivs = enable_ivs luatexja.otf = { append_jglyph = append_jglyph, enable_ivs = enable_ivs, disable_ivs = disable_ivs, - cid = cid, utf = utf, + cid = cid, utf = myutf, } diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-ruby.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-ruby.lua index 34cdc8c7fc7..9824ff155ac 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltj-ruby.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-ruby.lua @@ -278,9 +278,9 @@ function luatexja.ruby.texiface(rst, rtlr, rtlp) 'the body (' .. #rtlr .. ' != ' .. #rtlp .. ').', '') else - local f = true + local f, eps = true, rst.eps for i = 1,#rtlr do - if getfield(rtlr[i], 'width') > getfield(rtlp[i], 'width') then + if getfield(rtlr[i], 'width') > getfield(rtlp[i], 'width') + eps then f = false; break end end diff --git a/Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty b/Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty index 3ad56574322..e1baefbf198 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty @@ -65,7 +65,7 @@ \expandafter\let\csname ifltj@in@latex\expandafter\endcsname \csname iftrue\endcsname \NeedsTeXFormat{LaTeX2e} - \ProvidesPackage{luatexja-core}[2020-12-22 Core of LuaTeX-ja] + \ProvidesPackage{luatexja-core}[2021-01-02 Core of LuaTeX-ja] \fi % %% Load prerequisite packages. @@ -526,9 +526,9 @@ \csname ltj@kcat5\endcsname="7FFFFFFF %" \csname ltj@kcat6\endcsname="7FFFFFFF }%" -\protected\def\ltjjachar{\afterassignment\ltj@@jachar\ltj@tempcnta} +\protected\def\ltjjachar{\leavevmode\afterassignment\ltj@@jachar\ltj@tempcnta} \def\ltj@@jachar{{\directlua{tex.globaldefs=0}\ltj@alljachar\ltj@@origchar\ltj@tempcnta}} -\protected\def\ltjalchar{\afterassignment\ltj@@alchar\ltj@tempcnta} +\protected\def\ltjalchar{\leavevmode\afterassignment\ltj@@alchar\ltj@tempcnta} \def\ltj@@alchar{{\directlua{tex.globaldefs=0}\ltj@allalchar\ltj@@origchar\ltj@tempcnta}} %%%%%%%% \ltjsetmathletter, \ltjunsetmathletter diff --git a/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty b/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty index 4d749c40efc..34486345922 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}[2020-12-24 Japanese Typesetting with Lua(La)TeX] + \ProvidesPackage{luatexja}[2021-01-03 Japanese Typesetting with Lua(La)TeX] \DeclareOption{disablejfam}{\ltj@disablejfamtrue} \DeclareOption*{} \ProcessOptions\relax \fi % %%%% VERSION -\def\LuaTeXjaversion{20201224.0} +\def\LuaTeXjaversion{20210103.0} \directlua{require('ltj-unicode-ccfix.lua')}% catcode of ideographs diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty index bad7e6c7bcd..287a3968f5d 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty @@ -3,7 +3,7 @@ % \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{lltjfont}[2020-10-05 Patch to NFSS2 for LuaTeX-ja] +\ProvidesPackage{lltjfont}[2020-12-29 Patch to NFSS2 for LuaTeX-ja] %% patching \DeclareTextComposite \def\ltj@chardef@text@cmd#1{% @@ -634,7 +634,8 @@ \newcount\ltj@@latex@plv \ltj@@latex@plv=-1 \ifltj@ltfilehook@avail % 2020-10-01 - \ltj@@latex@plv=1000 + \@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 @@ -768,12 +769,25 @@ \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]{% + \kanjiencoding{#1}\edef\k@family{#2}% + \set@target@series@kanji{#3}\edef\k@shape{#4}% + \selectfont\ignorespaces} +\DeclareRobustCommand\useroman[4]{% + \romanencoding{#1}\edef\f@family{#2}% + \set@target@series{#3}\edef\f@shape{#4}% + \selectfont\ignorespaces} +\else +%%%% 2020-10-01 <= LaTeX < 2020-10-01 PL3 \DeclareRobustCommand\usekanji[4]{% \kanjiencoding{#1}\edef\k@family{#2}\edef\k@series{#3}\edef\k@shape{#4}% \selectfont\ignorespaces} \DeclareRobustCommand\useroman[4]{% \romanencoding{#1}\edef\f@family{#2}\edef\f@series{#3}\edef\f@shape{#4}% \selectfont\ignorespaces} +\fi %%%% LaTeX >= 2020-02-02 END \else %%%% LaTeX 2019-10-01 diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-geometry.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-geometry.sty index 161029bd051..0be092eaaa3 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-geometry.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-geometry.sty @@ -3,7 +3,7 @@ % \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{lltjp-geometry}[2020-09-18 Patch to geometry for LuaTeX-ja with vertical writing mode] +\ProvidesPackage{lltjp-geometry}[2020-12-29 Patch to geometry for LuaTeX-ja with vertical writing mode] \RequirePackage{expl3} \ifdefined\if@ltj@@geometry@tate\expandafter\endinput\fi \newif\if@ltj@@geometry@tate @@ -33,8 +33,11 @@ \unless\ifdefined\ltj@ExecuteAfterPackage \expandafter\newif\csname ifltj@ltfilehook@avail\endcsname \@ifl@t@r\fmtversion{2020-10-01}{% - \ifnum\patch@level<0\relax \ifnum\patch@level<-6 \ltj@ltfilehook@availtrue\fi - \else\ltj@ltfilehook@availtrue\fi + \@ifl@t@r\fmtversion{2020-10-02}{\ltj@ltfilehook@availtrue} + {% + \ifnum\patch@level<0\relax \ifnum\patch@level<-6 \ltj@ltfilehook@availtrue\fi + \else\ltj@ltfilehook@availtrue\fi + }% }{} \ifltj@ltfilehook@avail \def\@@ltj@ExecuteAfterPackage#1{\AddToHook{package/after/#1}} diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-listings.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-listings.sty index ee3c3aa14ba..173b1ed94bb 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-listings.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-listings.sty @@ -43,7 +43,7 @@ \directlua{ local cat_str = luatexbase.catcodetables['string'] local cat_lp = luatexbase.catcodetables['latex-package'] - local ubyte = unicode.utf8.byte + local ubyte = utf.byte local spccmd = string.char(0x5C) .. 'ltj@lst@hss@normal' luatexja.listings = {} function luatexja.listings.althss(t) @@ -229,7 +229,7 @@ }} \directlua{ - local utfchar, getcount = unicode.utf8.char, tex.getcount + local utfchar, getcount = utf.char, tex.getcount luatexja.listings.insert_cb = function() if not luatexja.listings.patched then luatexja.listings.patched = 1 -- cgit v1.2.3