リビジョン | ede084c8402fec8e508616b466cde1b7d9597f52 (tree) |
---|---|
日時 | 2020-01-13 13:17:14 |
作者 | Hironori Kitagawa <h_kitagawa2001@yaho...> |
コミッター | Hironori Kitagawa |
lltjp-fontspec: adapt fontspec 2.7e, and removed codes for <2.7c
@@ -1,6 +1,6 @@ | ||
1 | 1 | The LuaTeX-ja Package $VER$ |
2 | 2 | -------------------------------- |
3 | -Copyright (c) 2011--2019 The LuaTeX-ja project | |
3 | +Copyright (c) 2011--2020 The LuaTeX-ja project | |
4 | 4 | License: modified BSD (see COPYING) |
5 | 5 | |
6 | 6 | LuaTeX-ja is a macro package for typesetting Japanese documents with LuaTeX. |
@@ -32,7 +32,13 @@ | ||
32 | 32 | \newcommand\kanjiencodingdefault{JY3} |
33 | 33 | \newcommand\kanjifamilydefault{\mcdefault} |
34 | 34 | \newcommand\kanjiseriesdefault{\mddefault} |
35 | -\newcommand\kanjishapedefault{\updefault} | |
35 | +\ifdefined\shapedefault | |
36 | + %% LaTeX 2020-02-02 | |
37 | + \newcommand\kanjishapedefault{\shapedefault} | |
38 | +\else | |
39 | + %% LaTeX 2019-10-01 | |
40 | + \newcommand\kanjishapedefault{\updefault} | |
41 | +\fi | |
36 | 42 | |
37 | 43 | \DeclareKanjiFamily{JY3}{mc}{} |
38 | 44 | \DeclareFontShape{JY3}{mc}{m}{n}{<-> s*[\ifdefined\Cjascale\Cjascale\else 0.962216\fi] \ltj@stdmcfont:jfm=\ltj@stdyokojfm}{} |
@@ -93,7 +99,7 @@ | ||
93 | 99 | \def\@ltj@hook@family#1#2{ % #1: csname #2: contents |
94 | 100 | \ifcsname @#1hook\endcsname % LaTeX 2020-02-02 |
95 | 101 | \csappto{@#1hook}{#2}% |
96 | - \else | |
102 | + \else % LaTeX 2019-10-01 | |
97 | 103 | \ifcsname #1 \endcsname |
98 | 104 | \expandafter\patchcmd\csname #1 \endcsname{\selectfont}{#2\selectfont}{}{}% |
99 | 105 | \else |
@@ -1,5 +1,5 @@ | ||
1 | 1 | % |
2 | -% lltjp-fontspec.sty 2019-10-21 | |
2 | +% lltjp-fontspec.sty 2020-01-13 | |
3 | 3 | % |
4 | 4 | |
5 | 5 | \NeedsTeXFormat{LaTeX2e} |
@@ -7,13 +7,31 @@ | ||
7 | 7 | \RequirePackage{fontspec} |
8 | 8 | \ExplSyntaxOn |
9 | 9 | |
10 | -% <= v2.6g uses \l__fontspec_nfss_enc_tl instead of \g__fontspec_nfss_enc_tl | |
11 | -\ifdefined \g__fontspec_nfss_enc_tl \else | |
12 | - \def \g__fontspec_nfss_enc_tl { \l__fontspec_nfss_enc_tl } | |
13 | -\fi | |
14 | - | |
15 | 10 | %%%%%%%% fontspec v2.5c overwrites \rmfamily etc. in \setmainfont |
16 | -\@ifpackagelater{fontspec}{2019/10/19}{ %% 2.7d or later | |
11 | +\@ifpackagelater{fontspec}{2020/01/09}{ %% 2.7e or later | |
12 | + \tl_replace_all:cnn { rmfamily~ } { \fontfamily }{ \romanfamily } | |
13 | + \tl_replace_all:cnn { sffamily~ } { \fontfamily }{ \romanfamily } | |
14 | + \tl_replace_all:cnn { ttfamily~ } { \fontfamily }{ \romanfamily } | |
15 | + \typeout{LATEX~ 2019-10-01!} | |
16 | + \cs_if_exist:NF \@rmfamilyhook { | |
17 | + \tl_replace_all:cnn { rmfamily~ } { \selectfont } { | |
18 | + \if@ltj@match@family | |
19 | + \prepare@family@series@update@kanji{mc}\mcdefault | |
20 | + \fi\selectfont | |
21 | + } | |
22 | + \tl_replace_all:cnn { sffamily~ } { \selectfont } { | |
23 | + \if@ltj@match@family | |
24 | + \prepare@family@series@update@kanji{gt}\gtdefault | |
25 | + \fi\selectfont | |
26 | + } | |
27 | + \tl_replace_all:cnn { ttfamily~ } { \selectfont } { | |
28 | + \if@ltj@match@family | |
29 | + \prepare@family@series@update@kanji{jtt}\jttdefault | |
30 | + \fi\selectfont | |
31 | + } | |
32 | + } | |
33 | +%% end of 2.7e (or later) | |
34 | +}{\@ifpackagelater{fontspec}{2019/10/19}{ %% 2.7d | |
17 | 35 | \cs_set:Nn \__fontspec_main_setmainfont:nn |
18 | 36 | { |
19 | 37 | \fontspec_set_family:Nnn \l__fontspec_rmfamily_family_tl {#1} {#2} |
@@ -71,7 +89,8 @@ | ||
71 | 89 | \__fontspec_setmonofont_hook:nn {#1} {#2} |
72 | 90 | \normalfont |
73 | 91 | } |
74 | -}{\@ifpackagelater{fontspec}{2018/07/29}{ %% 2.6h <= and <= 2.7c | |
92 | +%% end of 2.7d | |
93 | +}{%% 2.7c | |
75 | 94 | \cs_set:Nn \__fontspec_main_setmainfont:nn |
76 | 95 | { |
77 | 96 | \fontspec_set_family:Nnn \l__fontspec_rmfamily_family_tl {#1} {#2} |
@@ -129,58 +148,7 @@ | ||
129 | 148 | \__fontspec_setmonofont_hook:nn {#1} {#2} |
130 | 149 | \normalfont |
131 | 150 | } |
132 | -}{ %% <= 2.6g | |
133 | -\DeclareDocumentCommand \setmainfont { O{} m O{} } | |
134 | - { | |
135 | - \fontspec_set_family:Nnn \g__fontspec_rmfamily_family {#1,#3} {#2} | |
136 | - \tl_set_eq:NN \rmdefault \g__fontspec_rmfamily_family | |
137 | - \use:x { \exp_not:n { \DeclareRobustCommand \rmfamily } | |
138 | - { | |
139 | - \exp_not:N \fontencoding { \g__fontspec_nfss_enc_tl } | |
140 | - \exp_not:N \fontfamily { \g__fontspec_rmfamily_family } | |
141 | - \exp_not:N\if@ltj@match@family\exp_not:N\kanjifamily\exp_not:N\mcdefault\exp_not:N\fi%%% | |
142 | - \exp_not:N \selectfont | |
143 | - } | |
144 | - } | |
145 | - \str_if_eq:eeT {\familydefault} {\rmdefault} | |
146 | - { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl } | |
147 | - \normalfont | |
148 | - \ignorespaces | |
149 | - } | |
150 | -\DeclareDocumentCommand \setsansfont { O{} m O{} } | |
151 | - { | |
152 | - \fontspec_set_family:Nnn \g__fontspec_sffamily_family {#1,#3} {#2} | |
153 | - \tl_set_eq:NN \sfdefault \g__fontspec_sffamily_family | |
154 | - \use:x { \exp_not:n { \DeclareRobustCommand \sffamily } | |
155 | - { | |
156 | - \exp_not:N \fontencoding { \g__fontspec_nfss_enc_tl } | |
157 | - \exp_not:N \fontfamily { \g__fontspec_sffamily_family } | |
158 | - \exp_not:N\if@ltj@match@family\exp_not:N\kanjifamily\exp_not:N\gtdefault\exp_not:N\fi%%% | |
159 | - \exp_not:N \selectfont | |
160 | - } | |
161 | - } | |
162 | - \str_if_eq:eeT {\familydefault} {\sfdefault} | |
163 | - { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl } | |
164 | - \normalfont | |
165 | - \ignorespaces | |
166 | - } | |
167 | -\DeclareDocumentCommand \setmonofont { O{} m O{} } | |
168 | - { | |
169 | - \fontspec_set_family:Nnn \g__fontspec_ttfamily_family {#1,#3} {#2} | |
170 | - \tl_set_eq:NN \ttdefault \g__fontspec_ttfamily_family | |
171 | - \use:x { \exp_not:n { \DeclareRobustCommand \ttfamily } | |
172 | - { | |
173 | - \exp_not:N \fontencoding { \g__fontspec_nfss_enc_tl } | |
174 | - \exp_not:N \fontfamily { \g__fontspec_ttfamily_family } | |
175 | - \exp_not:N\if@ltj@match@family\exp_not:N\kanjifamily\exp_not:N\jttdefault\exp_not:N\fi%%% | |
176 | - \exp_not:N \selectfont | |
177 | - } | |
178 | - } | |
179 | - \str_if_eq:eeT {\familydefault} {\ttdefault} | |
180 | - { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl } | |
181 | - \normalfont | |
182 | - \ignorespaces | |
183 | - } | |
151 | +%% end of 2.7d | |
184 | 152 | }} |
185 | 153 | |
186 | 154 | \cs_set:Nn \fontspec_visible_space: |
@@ -190,19 +158,6 @@ | ||
190 | 158 | { \fontspec_visible_space_fallback: } |
191 | 159 | } |
192 | 160 | |
193 | -\AtBeginDocument{ | |
194 | - \cs_if_exist:NF \verbvisiblespace { | |
195 | - % >= LaTeX2e <2018-12-01> does not need the following patch | |
196 | - \def\verb | |
197 | - { | |
198 | - \relax\ifmmode\hbox\else\leavevmode\fi % same as lltjcore | |
199 | - \bgroup | |
200 | - \verb@eol@error \let\do\@makeother \dospecials | |
201 | - \verbatim@font\@noligs | |
202 | - \@ifstar\__fontspecsverb\@verb | |
203 | - } | |
204 | - } | |
205 | -} | |
206 | 161 | \cs_set:Npn \emshape { \gtfamily \itshape } |
207 | 162 | \cs_set:Npn \eminnershape { \mcfamily \upshape } |
208 | 163 |