ソースコードの管理場所
Revision | 29b7fb601adedbd524fd68727919329981d7910a (tree) |
---|---|
Zeit | 2021-01-20 05:46:52 |
Autor | Hironori Kitagawa <h_kitagawa2001@yaho...> |
Commiter | Hironori Kitagawa |
Use selectfont hook (LaTeX2e >=2021-05-01) if exists
@@ -350,18 +350,6 @@ | ||
350 | 350 | \newif\if@knjcmd |
351 | 351 | \DeclareRobustCommand\userelfont{\@knjcmdtrue} |
352 | 352 | |
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 | -} | |
365 | 353 | \def\ltj@selectfont@tate{% |
366 | 354 | \let\k@encoding\ct@encoding |
367 | 355 | \xdef\font@name{\csname\curr@kfontshape/\f@size\endcsname}% |
@@ -386,7 +374,7 @@ | ||
386 | 374 | \directlua{luatexja.jfont.pickup_alt_font_a('\f@size')}% |
387 | 375 | }% |
388 | 376 | \fi} |
389 | -\def\ltj@selectfont@patch{% | |
377 | +\protected\def\ltj@selectfont@patch{% | |
390 | 378 | \ltj@@start@time@measure{selectfont}% |
391 | 379 | \let\tmp@error@fontshape\error@fontshape |
392 | 380 | \let\error@fontshape\error@kfontshape |
@@ -427,7 +415,24 @@ | ||
427 | 415 | \global\let\font@name=\ltj@afont@name |
428 | 416 | \ltj@@stop@time@measure{selectfont}% |
429 | 417 | } |
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 | |
431 | 436 | |
432 | 437 | \bgroup |
433 | 438 | \def\ltj@@dir@patch#1#2#3{% |