• R/O
  • HTTP
  • SSH
  • HTTPS

luatexja: Commit

ソースコードの管理場所


Commit MetaInfo

Revision29b7fb601adedbd524fd68727919329981d7910a (tree)
Zeit2021-01-20 05:46:52
AutorHironori Kitagawa <h_kitagawa2001@yaho...>
CommiterHironori Kitagawa

Log Message

Use selectfont hook (LaTeX2e >=2021-05-01) if exists

Ändern Zusammenfassung

Diff

--- a/src/patches/lltjfont.sty
+++ b/src/patches/lltjfont.sty
@@ -350,18 +350,6 @@
350350 \newif\if@knjcmd
351351 \DeclareRobustCommand\userelfont{\@knjcmdtrue}
352352
353-
354-\RequirePackage{everysel}
355-\let\ltj@@EverySelectfont@Init=\@EverySelectfont@Init
356-\expandafter\expandafter\expandafter\let
357-\expandafter\expandafter\csname ltj@@orig@selectfont\endcsname\csname selectfont\space\endcsname
358-\@EverySelectfont@Init
359-%\let\ltj@@font@info\@font@info
360-%\let\ltj@@font@warning\@font@warning
361-\def\@EverySelectfont@Init{%
362- \expandafter\let\csname selectfont\space \endcsname \ltj@@orig@selectfont
363- \ltj@@EverySelectfont@Init
364-}
365353 \def\ltj@selectfont@tate{%
366354 \let\k@encoding\ct@encoding
367355 \xdef\font@name{\csname\curr@kfontshape/\f@size\endcsname}%
@@ -386,7 +374,7 @@
386374 \directlua{luatexja.jfont.pickup_alt_font_a('\f@size')}%
387375 }%
388376 \fi}
389-\def\ltj@selectfont@patch{%
377+\protected\def\ltj@selectfont@patch{%
390378 \ltj@@start@time@measure{selectfont}%
391379 \let\tmp@error@fontshape\error@fontshape
392380 \let\error@fontshape\error@kfontshape
@@ -427,7 +415,24 @@
427415 \global\let\font@name=\ltj@afont@name
428416 \ltj@@stop@time@measure{selectfont}%
429417 }
430-\EverySelectfont{\ltj@selectfont@patch}
418+\def\@@ltj@old@selectfont@patch{%
419+ \RequirePackage{everysel}
420+ \let\ltj@@EverySelectfont@Init=\@EverySelectfont@Init
421+ \expandafter\expandafter\expandafter\let
422+ \expandafter\expandafter\csname ltj@@orig@selectfont\endcsname\csname selectfont\space\endcsname
423+ \@EverySelectfont@Init% for LaTeX2e <=2020-10-01
424+ \def\@EverySelectfont@Init{%
425+ \expandafter\let\csname selectfont\space \endcsname \ltj@@orig@selectfont
426+ \ltj@@EverySelectfont@Init
427+ }
428+ \EverySelectfont{\ltj@selectfont@patch}
429+}
430+\ifltj@ltfilehook@avail
431+ \IfHookExistsTF{selectfont}{\AddToHook{selectfont}[luatexja]{\ltj@selectfont@patch}}% LaTeX2e 2021-05-01
432+ {\@@ltj@old@selectfont@patch}% LaTeX2e 2020-10-01
433+\else\@@ltj@old@selectfont@patch % LaTeX2e <=2020-02-02
434+\fi
435+\let\@@ltj@old@selectfont@patch\undefined
431436
432437 \bgroup
433438 \def\ltj@@dir@patch#1#2#3{%
Show on old repository browser