summaryrefslogtreecommitdiff
path: root/macros/luatex/generic/luatexja/src/patches/lltjp-microtype.sty
diff options
context:
space:
mode:
Diffstat (limited to 'macros/luatex/generic/luatexja/src/patches/lltjp-microtype.sty')
-rw-r--r--macros/luatex/generic/luatexja/src/patches/lltjp-microtype.sty42
1 files changed, 23 insertions, 19 deletions
diff --git a/macros/luatex/generic/luatexja/src/patches/lltjp-microtype.sty b/macros/luatex/generic/luatexja/src/patches/lltjp-microtype.sty
index db2fac8481..5663551bea 100644
--- a/macros/luatex/generic/luatexja/src/patches/lltjp-microtype.sty
+++ b/macros/luatex/generic/luatexja/src/patches/lltjp-microtype.sty
@@ -1,33 +1,37 @@
%
-% lltjp-microtype.sty 2019-08-12
+% lltjp-microtype.sty
%
% (Work in Progress)
%
\NeedsTeXFormat{LaTeX2e}
-
\RequirePackage{etoolbox}
\makeatletter
-\def\MT@register@font{%
- \xdef\MT@font@list{\expandonce{\MT@font@list\MT@font},}% !!!
-}
-\def\MT@register@subst@font{\MT@exp@one@n\MT@in@clist\font@name\MT@font@list
- \ifMT@inlist@\else
- \xdef\MT@font@list{\expandonce{\MT@font@list\font@name},}% !!!
- \fi}
+\PackageWarningNoLine{luatexja}%
+ {LuaTeX-ja's patch against the microtype package \MessageBreak
+ (lltjp-microtype.sty, 2019-11-08) may not work}
+\patchcmd\MT@register@font
+ {\xdef\MT@font@list{\MT@font@list\MT@font,}}%
+ {\directlua{luatexja.jfont.is_kenc('\luatexluaescapestring{\f@encoding}')}%
+ \unless\ifin@
+ \xdef\MT@font@list{\MT@font@list\MT@font,}
+ \fi
+ }{}{}
+\patchcmd\MT@register@subst@font
+ {\xdef\MT@font@list{\MT@font@list\font@name,}}%
+ {\directlua{luatexja.jfont.is_kenc('\luatexluaescapestring{\f@encoding}')}%
+ \unless\ifin@
+ \xdef\MT@font@list{\MT@font@list\font@name,}
+ \fi}{}{}
\let\ltj@MT@tracking@\MT@tracking@
-\def\MT@tracking@{%
- \MT@exp@one@n\MT@in@clist\MT@font\MT@tr@font@list
- \ifMT@inlist@\else
- \MT@maybe@do{tr}%
- \ifMT@do\else
- \xdef\MT@tr@font@list{\expandonce{\MT@tr@font@list\MT@font,}}% !!!
- \fi
- \fi
-}
+\patchcmd\MT@tracking@
+ {\xdef\MT@tr@font@list{\MT@tr@font@list\MT@font,}}%
+ {\directlua{luatexja.jfont.is_kenc('\luatexluaescapestring{\f@encoding}')}%
+ \unless\ifin@
+ \xdef\MT@tr@font@list{\MT@tr@font@list\MT@font,}
+ \fi}{}{}
\ifx\MT@tracking\ltj@MT@tracking@\let\MT@tracking\MT@tracking@\fi
-
%\endinput
\begingroup
\catcode`\/=\z@