From: Hironori Kitagawa Date: Mon, 13 Jan 2020 04:17:14 +0000 (+0900) Subject: lltjp-fontspec: adapt fontspec 2.7e, and removed codes for <2.7c X-Git-Tag: 20200127.0~9^2~5 X-Git-Url: http://git.osdn.jp/view?a=commitdiff_plain;h=ede084c8402fec8e508616b466cde1b7d9597f52;p=luatex-ja%2Fluatexja.git lltjp-fontspec: adapt fontspec 2.7e, and removed codes for <2.7c --- diff --git a/README b/README index 78dbf5e..416da00 100644 --- a/README +++ b/README @@ -1,6 +1,6 @@ The LuaTeX-ja Package $VER$ -------------------------------- -Copyright (c) 2011--2019 The LuaTeX-ja project +Copyright (c) 2011--2020 The LuaTeX-ja project License: modified BSD (see COPYING) LuaTeX-ja is a macro package for typesetting Japanese documents with LuaTeX. diff --git a/src/patches/lltjdefs.sty b/src/patches/lltjdefs.sty index 537c024..f6d4e3e 100644 --- a/src/patches/lltjdefs.sty +++ b/src/patches/lltjdefs.sty @@ -32,7 +32,13 @@ \newcommand\kanjiencodingdefault{JY3} \newcommand\kanjifamilydefault{\mcdefault} \newcommand\kanjiseriesdefault{\mddefault} -\newcommand\kanjishapedefault{\updefault} +\ifdefined\shapedefault + %% LaTeX 2020-02-02 + \newcommand\kanjishapedefault{\shapedefault} +\else + %% LaTeX 2019-10-01 + \newcommand\kanjishapedefault{\updefault} +\fi \DeclareKanjiFamily{JY3}{mc}{} \DeclareFontShape{JY3}{mc}{m}{n}{<-> s*[\ifdefined\Cjascale\Cjascale\else 0.962216\fi] \ltj@stdmcfont:jfm=\ltj@stdyokojfm}{} @@ -93,7 +99,7 @@ \def\@ltj@hook@family#1#2{ % #1: csname #2: contents \ifcsname @#1hook\endcsname % LaTeX 2020-02-02 \csappto{@#1hook}{#2}% - \else + \else % LaTeX 2019-10-01 \ifcsname #1 \endcsname \expandafter\patchcmd\csname #1 \endcsname{\selectfont}{#2\selectfont}{}{}% \else diff --git a/src/patches/lltjp-fontspec.sty b/src/patches/lltjp-fontspec.sty index 9f63075..13e8786 100644 --- a/src/patches/lltjp-fontspec.sty +++ b/src/patches/lltjp-fontspec.sty @@ -1,5 +1,5 @@ % -% lltjp-fontspec.sty 2019-10-21 +% lltjp-fontspec.sty 2020-01-13 % \NeedsTeXFormat{LaTeX2e} @@ -7,13 +7,31 @@ \RequirePackage{fontspec} \ExplSyntaxOn -% <= v2.6g uses \l__fontspec_nfss_enc_tl instead of \g__fontspec_nfss_enc_tl -\ifdefined \g__fontspec_nfss_enc_tl \else - \def \g__fontspec_nfss_enc_tl { \l__fontspec_nfss_enc_tl } -\fi - %%%%%%%% fontspec v2.5c overwrites \rmfamily etc. in \setmainfont -\@ifpackagelater{fontspec}{2019/10/19}{ %% 2.7d or later +\@ifpackagelater{fontspec}{2020/01/09}{ %% 2.7e or later + \tl_replace_all:cnn { rmfamily~ } { \fontfamily }{ \romanfamily } + \tl_replace_all:cnn { sffamily~ } { \fontfamily }{ \romanfamily } + \tl_replace_all:cnn { ttfamily~ } { \fontfamily }{ \romanfamily } + \typeout{LATEX~ 2019-10-01!} + \cs_if_exist:NF \@rmfamilyhook { + \tl_replace_all:cnn { rmfamily~ } { \selectfont } { + \if@ltj@match@family + \prepare@family@series@update@kanji{mc}\mcdefault + \fi\selectfont + } + \tl_replace_all:cnn { sffamily~ } { \selectfont } { + \if@ltj@match@family + \prepare@family@series@update@kanji{gt}\gtdefault + \fi\selectfont + } + \tl_replace_all:cnn { ttfamily~ } { \selectfont } { + \if@ltj@match@family + \prepare@family@series@update@kanji{jtt}\jttdefault + \fi\selectfont + } + } +%% end of 2.7e (or later) +}{\@ifpackagelater{fontspec}{2019/10/19}{ %% 2.7d \cs_set:Nn \__fontspec_main_setmainfont:nn { \fontspec_set_family:Nnn \l__fontspec_rmfamily_family_tl {#1} {#2} @@ -71,7 +89,8 @@ \__fontspec_setmonofont_hook:nn {#1} {#2} \normalfont } -}{\@ifpackagelater{fontspec}{2018/07/29}{ %% 2.6h <= and <= 2.7c +%% end of 2.7d +}{%% 2.7c \cs_set:Nn \__fontspec_main_setmainfont:nn { \fontspec_set_family:Nnn \l__fontspec_rmfamily_family_tl {#1} {#2} @@ -129,58 +148,7 @@ \__fontspec_setmonofont_hook:nn {#1} {#2} \normalfont } -}{ %% <= 2.6g -\DeclareDocumentCommand \setmainfont { O{} m O{} } - { - \fontspec_set_family:Nnn \g__fontspec_rmfamily_family {#1,#3} {#2} - \tl_set_eq:NN \rmdefault \g__fontspec_rmfamily_family - \use:x { \exp_not:n { \DeclareRobustCommand \rmfamily } - { - \exp_not:N \fontencoding { \g__fontspec_nfss_enc_tl } - \exp_not:N \fontfamily { \g__fontspec_rmfamily_family } - \exp_not:N\if@ltj@match@family\exp_not:N\kanjifamily\exp_not:N\mcdefault\exp_not:N\fi%%% - \exp_not:N \selectfont - } - } - \str_if_eq:eeT {\familydefault} {\rmdefault} - { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl } - \normalfont - \ignorespaces - } -\DeclareDocumentCommand \setsansfont { O{} m O{} } - { - \fontspec_set_family:Nnn \g__fontspec_sffamily_family {#1,#3} {#2} - \tl_set_eq:NN \sfdefault \g__fontspec_sffamily_family - \use:x { \exp_not:n { \DeclareRobustCommand \sffamily } - { - \exp_not:N \fontencoding { \g__fontspec_nfss_enc_tl } - \exp_not:N \fontfamily { \g__fontspec_sffamily_family } - \exp_not:N\if@ltj@match@family\exp_not:N\kanjifamily\exp_not:N\gtdefault\exp_not:N\fi%%% - \exp_not:N \selectfont - } - } - \str_if_eq:eeT {\familydefault} {\sfdefault} - { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl } - \normalfont - \ignorespaces - } -\DeclareDocumentCommand \setmonofont { O{} m O{} } - { - \fontspec_set_family:Nnn \g__fontspec_ttfamily_family {#1,#3} {#2} - \tl_set_eq:NN \ttdefault \g__fontspec_ttfamily_family - \use:x { \exp_not:n { \DeclareRobustCommand \ttfamily } - { - \exp_not:N \fontencoding { \g__fontspec_nfss_enc_tl } - \exp_not:N \fontfamily { \g__fontspec_ttfamily_family } - \exp_not:N\if@ltj@match@family\exp_not:N\kanjifamily\exp_not:N\jttdefault\exp_not:N\fi%%% - \exp_not:N \selectfont - } - } - \str_if_eq:eeT {\familydefault} {\ttdefault} - { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl } - \normalfont - \ignorespaces - } +%% end of 2.7d }} \cs_set:Nn \fontspec_visible_space: @@ -190,19 +158,6 @@ { \fontspec_visible_space_fallback: } } -\AtBeginDocument{ - \cs_if_exist:NF \verbvisiblespace { - % >= LaTeX2e <2018-12-01> does not need the following patch - \def\verb - { - \relax\ifmmode\hbox\else\leavevmode\fi % same as lltjcore - \bgroup - \verb@eol@error \let\do\@makeother \dospecials - \verbatim@font\@noligs - \@ifstar\__fontspecsverb\@verb - } - } -} \cs_set:Npn \emshape { \gtfamily \itshape } \cs_set:Npn \eminnershape { \mcfamily \upshape }