• R/O
  • HTTP
  • SSH
  • HTTPS

luatexja: Commit

ソースコードの管理場所


Commit MetaInfo

Revision409f82ab3c64eb14106c4d1cd6052a58fb2d3ff8 (tree)
Time2018-08-24 05:19:36
AuthorHironori Kitagawa <h_kitagawa2001@yaho...>
CommiterHironori Kitagawa

Log Message

simplified patch for fontspec package

Change Summary

Incremental Difference

--- a/src/ltj-latex.sty
+++ b/src/ltj-latex.sty
@@ -61,8 +61,7 @@
6161 %%% patch for packages
6262 \ltj@pkgpatch@im{listings}
6363 \ltj@pkgpatch{xunicode} %% at \begin{document}
64-\ltj@pkgpatch{fontspec} %% at \begin{document}
65-\ltj@pkgpatch@im{fontspec}[lltjp-fontspec-immediate]
64+\ltj@pkgpatch@im{fontspec}
6665 \ltj@pkgpatch{footmisc} %% at \begin{document}
6766 \ltj@pkgpatch{tascmac}
6867 \ltj@AtBeginDocument{\@ifpackageloaded{ascmac}{%
--- a/src/patches/lltjp-fontspec-immediate.sty
+++ /dev/null
@@ -1,131 +0,0 @@
1-%
2-% lltjp-fontspec-immediate.sty
3-%
4-
5-\NeedsTeXFormat{LaTeX2e}
6-%%% \ProvidesPackage{lltjp-fontspec-immediate}[2017/08/07 Patch to fontspec for LuaTeX-ja]
7-
8-\RequirePackage{fontspec,luatexja}
9-\ExplSyntaxOn
10-
11-% <= v2.6g uses \l__fontspec_nfss_enc_tl instead of \g__fontspec_nfss_enc_tl
12-\ifdefined \g__fontspec_nfss_enc_tl \else
13- \def \g__fontspec_nfss_enc_tl { \l__fontspec_nfss_enc_tl }
14-\fi
15-
16-%%%%%%%% fontspec v2.5c overwrites \rmfamily etc. in \setmainfont
17-\@ifpackagelater{fontspec}{2018/07/29}{ %% 2.6h or later
18-\cs_set:Nn \__fontspec_main_setmainfont:nn
19- {
20- \fontspec_set_family:Nnn \l__fontspec_rmfamily_family_tl {#1} {#2}
21- \tl_set_eq:NN \rmdefault \l__fontspec_rmfamily_family_tl
22- \use:x
23- {
24- \exp_not:n { \DeclareRobustCommand \rmfamily }
25- {
26- \exp_not:N \fontencoding { \g__fontspec_nfss_enc_tl }
27- \exp_not:N \fontfamily { \l__fontspec_rmfamily_family_tl }
28- \exp_not:N\if@ltj@match@family\exp_not:N\kanjifamily\exp_not:N\mcdefault\exp_not:N\fi%%%
29- \exp_not:N \selectfont
30- }
31- }
32- \str_if_eq_x:nnT {\familydefault} {\rmdefault}
33- { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl }
34- \__fontspec_setmainfont_hook:nn {#1} {#2}
35- \normalfont
36- }
37-\cs_set:Nn \__fontspec_main_setsansfont:nn
38- {
39- \fontspec_set_family:Nnn \l__fontspec_sffamily_family_tl {#1} {#2}
40- \tl_set_eq:NN \sfdefault \l__fontspec_sffamily_family_tl
41- \use:x
42- {
43- \exp_not:n { \DeclareRobustCommand \sffamily }
44- {
45- \exp_not:N \fontencoding { \g__fontspec_nfss_enc_tl }
46- \exp_not:N \fontfamily { \l__fontspec_sffamily_family_tl }
47- \exp_not:N\if@ltj@match@family\exp_not:N\kanjifamily\exp_not:N\gtdefault\exp_not:N\fi%%%
48- \exp_not:N \selectfont
49- }
50- }
51- \str_if_eq_x:nnT {\familydefault} {\sfdefault}
52- { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl }
53- \__fontspec_setsansfont_hook:nn {#1} {#2}
54- \normalfont
55- }
56-\cs_set:Nn \__fontspec_main_setmonofont:nn
57- {
58- \fontspec_set_family:Nnn \l__fontspec_ttfamily_family_tl {#1} {#2}
59- \tl_set_eq:NN \ttdefault \l__fontspec_ttfamily_family_tl
60- \use:x
61- {
62- \exp_not:n { \DeclareRobustCommand \ttfamily }
63- {
64- \exp_not:N \fontencoding { \g__fontspec_nfss_enc_tl }
65- \exp_not:N \fontfamily { \l__fontspec_ttfamily_family_tl }
66- \exp_not:N\if@ltj@match@family\exp_not:N\kanjifamily\exp_not:N\jttdefault\exp_not:N\fi%%%
67- \exp_not:N \selectfont
68- }
69- }
70- \str_if_eq_x:nnT {\familydefault} {\ttdefault}
71- { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl }
72- \__fontspec_setmonofont_hook:nn {#1} {#2}
73- \normalfont
74- }
75-}{ %% <= 2.6g
76-\DeclareDocumentCommand \setmainfont { O{} m O{} }
77- {
78- \fontspec_set_family:Nnn \g__fontspec_rmfamily_family {#1,#3} {#2}
79- \tl_set_eq:NN \rmdefault \g__fontspec_rmfamily_family
80- \use:x { \exp_not:n { \DeclareRobustCommand \rmfamily }
81- {
82- \exp_not:N \fontencoding { \g__fontspec_nfss_enc_tl }
83- \exp_not:N \fontfamily { \g__fontspec_rmfamily_family }
84- \exp_not:N\if@ltj@match@family\exp_not:N\kanjifamily\exp_not:N\mcdefault\exp_not:N\fi%%%
85- \exp_not:N \selectfont
86- }
87- }
88- \str_if_eq_x:nnT {\familydefault} {\rmdefault}
89- { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl }
90- \normalfont
91- \ignorespaces
92- }
93-\DeclareDocumentCommand \setsansfont { O{} m O{} }
94- {
95- \fontspec_set_family:Nnn \g__fontspec_sffamily_family {#1,#3} {#2}
96- \tl_set_eq:NN \sfdefault \g__fontspec_sffamily_family
97- \use:x { \exp_not:n { \DeclareRobustCommand \sffamily }
98- {
99- \exp_not:N \fontencoding { \g__fontspec_nfss_enc_tl }
100- \exp_not:N \fontfamily { \g__fontspec_sffamily_family }
101- \exp_not:N\if@ltj@match@family\exp_not:N\kanjifamily\exp_not:N\gtdefault\exp_not:N\fi%%%
102- \exp_not:N \selectfont
103- }
104- }
105- \str_if_eq_x:nnT {\familydefault} {\sfdefault}
106- { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl }
107- \normalfont
108- \ignorespaces
109- }
110-\DeclareDocumentCommand \setmonofont { O{} m O{} }
111- {
112- \fontspec_set_family:Nnn \g__fontspec_ttfamily_family {#1,#3} {#2}
113- \tl_set_eq:NN \ttdefault \g__fontspec_ttfamily_family
114- \use:x { \exp_not:n { \DeclareRobustCommand \ttfamily }
115- {
116- \exp_not:N \fontencoding { \g__fontspec_nfss_enc_tl }
117- \exp_not:N \fontfamily { \g__fontspec_ttfamily_family }
118- \exp_not:N\if@ltj@match@family\exp_not:N\kanjifamily\exp_not:N\jttdefault\exp_not:N\fi%%%
119- \exp_not:N \selectfont
120- }
121- }
122- \str_if_eq_x:nnT {\familydefault} {\ttdefault}
123- { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl }
124- \normalfont
125- \ignorespaces
126- }
127-}
128-\ExplSyntaxOff
129-\expandafter\patchcmd\csname TU\string\textasteriskcentered\endcsname{\char}{\ltjalchar}{}{}
130-\endinput
131-
--- a/src/patches/lltjp-fontspec.sty
+++ b/src/patches/lltjp-fontspec.sty
@@ -3,26 +3,136 @@
33 %
44
55 \NeedsTeXFormat{LaTeX2e}
6-\ProvidesPackage{lltjp-fontspec}[2017/08/07 Patch to fontspec for LuaTeX-ja]
6+%\ProvidesPackage{lltjp-fontspec}[2017/08/24 Patch to fontspec for LuaTeX-ja]
77
88 \RequirePackage{fontspec,luatexja}
99 \ExplSyntaxOn
1010
11-\@ifpackagelater{fontspec}{2017/01/01}{
12- \cs_set:Nn \fontspec_visible_space:
11+% <= v2.6g uses \l__fontspec_nfss_enc_tl instead of \g__fontspec_nfss_enc_tl
12+\ifdefined \g__fontspec_nfss_enc_tl \else
13+ \def \g__fontspec_nfss_enc_tl { \l__fontspec_nfss_enc_tl }
14+\fi
15+
16+%%%%%%%% fontspec v2.5c overwrites \rmfamily etc. in \setmainfont
17+\@ifpackagelater{fontspec}{2018/07/29}{ %% 2.6h or later
18+\cs_set:Nn \__fontspec_main_setmainfont:nn
19+ {
20+ \fontspec_set_family:Nnn \l__fontspec_rmfamily_family_tl {#1} {#2}
21+ \tl_set_eq:NN \rmdefault \l__fontspec_rmfamily_family_tl
22+ \use:x
23+ {
24+ \exp_not:n { \DeclareRobustCommand \rmfamily }
25+ {
26+ \exp_not:N \fontencoding { \g__fontspec_nfss_enc_tl }
27+ \exp_not:N \fontfamily { \l__fontspec_rmfamily_family_tl }
28+ \exp_not:N\if@ltj@match@family\exp_not:N\kanjifamily\exp_not:N\mcdefault\exp_not:N\fi%%%
29+ \exp_not:N \selectfont
30+ }
31+ }
32+ \str_if_eq_x:nnT {\familydefault} {\rmdefault}
33+ { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl }
34+ \__fontspec_setmainfont_hook:nn {#1} {#2}
35+ \normalfont
36+ }
37+\cs_set:Nn \__fontspec_main_setsansfont:nn
38+ {
39+ \fontspec_set_family:Nnn \l__fontspec_sffamily_family_tl {#1} {#2}
40+ \tl_set_eq:NN \sfdefault \l__fontspec_sffamily_family_tl
41+ \use:x
42+ {
43+ \exp_not:n { \DeclareRobustCommand \sffamily }
44+ {
45+ \exp_not:N \fontencoding { \g__fontspec_nfss_enc_tl }
46+ \exp_not:N \fontfamily { \l__fontspec_sffamily_family_tl }
47+ \exp_not:N\if@ltj@match@family\exp_not:N\kanjifamily\exp_not:N\gtdefault\exp_not:N\fi%%%
48+ \exp_not:N \selectfont
49+ }
50+ }
51+ \str_if_eq_x:nnT {\familydefault} {\sfdefault}
52+ { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl }
53+ \__fontspec_setsansfont_hook:nn {#1} {#2}
54+ \normalfont
55+ }
56+\cs_set:Nn \__fontspec_main_setmonofont:nn
57+ {
58+ \fontspec_set_family:Nnn \l__fontspec_ttfamily_family_tl {#1} {#2}
59+ \tl_set_eq:NN \ttdefault \l__fontspec_ttfamily_family_tl
60+ \use:x
61+ {
62+ \exp_not:n { \DeclareRobustCommand \ttfamily }
63+ {
64+ \exp_not:N \fontencoding { \g__fontspec_nfss_enc_tl }
65+ \exp_not:N \fontfamily { \l__fontspec_ttfamily_family_tl }
66+ \exp_not:N\if@ltj@match@family\exp_not:N\kanjifamily\exp_not:N\jttdefault\exp_not:N\fi%%%
67+ \exp_not:N \selectfont
68+ }
69+ }
70+ \str_if_eq_x:nnT {\familydefault} {\ttdefault}
71+ { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl }
72+ \__fontspec_setmonofont_hook:nn {#1} {#2}
73+ \normalfont
74+ }
75+}{ %% <= 2.6g
76+\DeclareDocumentCommand \setmainfont { O{} m O{} }
77+ {
78+ \fontspec_set_family:Nnn \g__fontspec_rmfamily_family {#1,#3} {#2}
79+ \tl_set_eq:NN \rmdefault \g__fontspec_rmfamily_family
80+ \use:x { \exp_not:n { \DeclareRobustCommand \rmfamily }
81+ {
82+ \exp_not:N \fontencoding { \g__fontspec_nfss_enc_tl }
83+ \exp_not:N \fontfamily { \g__fontspec_rmfamily_family }
84+ \exp_not:N\if@ltj@match@family\exp_not:N\kanjifamily\exp_not:N\mcdefault\exp_not:N\fi%%%
85+ \exp_not:N \selectfont
86+ }
87+ }
88+ \str_if_eq_x:nnT {\familydefault} {\rmdefault}
89+ { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl }
90+ \normalfont
91+ \ignorespaces
92+ }
93+\DeclareDocumentCommand \setsansfont { O{} m O{} }
94+ {
95+ \fontspec_set_family:Nnn \g__fontspec_sffamily_family {#1,#3} {#2}
96+ \tl_set_eq:NN \sfdefault \g__fontspec_sffamily_family
97+ \use:x { \exp_not:n { \DeclareRobustCommand \sffamily }
1398 {
14- \__fontspec_primitive_font_glyph_if_exist:NnTF \font {"2423}
15- { \ltjalchar"2423\scan_stop: }
16- { \fontspec_visible_space_fallback: }
99+ \exp_not:N \fontencoding { \g__fontspec_nfss_enc_tl }
100+ \exp_not:N \fontfamily { \g__fontspec_sffamily_family }
101+ \exp_not:N\if@ltj@match@family\exp_not:N\kanjifamily\exp_not:N\gtdefault\exp_not:N\fi%%%
102+ \exp_not:N \selectfont
17103 }
18-}{
19- \cs_set:Nn \fontspec_visible_space:
104+ }
105+ \str_if_eq_x:nnT {\familydefault} {\sfdefault}
106+ { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl }
107+ \normalfont
108+ \ignorespaces
109+ }
110+\DeclareDocumentCommand \setmonofont { O{} m O{} }
111+ {
112+ \fontspec_set_family:Nnn \g__fontspec_ttfamily_family {#1,#3} {#2}
113+ \tl_set_eq:NN \ttdefault \g__fontspec_ttfamily_family
114+ \use:x { \exp_not:n { \DeclareRobustCommand \ttfamily }
20115 {
21- \font_glyph_if_exist:NnTF \font {"2423}
22- { \ltjalchar"2423\scan_stop: }
23- { \fontspec_visible_space_fallback: }
116+ \exp_not:N \fontencoding { \g__fontspec_nfss_enc_tl }
117+ \exp_not:N \fontfamily { \g__fontspec_ttfamily_family }
118+ \exp_not:N\if@ltj@match@family\exp_not:N\kanjifamily\exp_not:N\jttdefault\exp_not:N\fi%%%
119+ \exp_not:N \selectfont
24120 }
121+ }
122+ \str_if_eq_x:nnT {\familydefault} {\ttdefault}
123+ { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl }
124+ \normalfont
125+ \ignorespaces
126+ }
25127 }
128+
129+\cs_set:Nn \fontspec_visible_space:
130+ {
131+ \__fontspec_primitive_font_glyph_if_exist:NnTF \font {"2423}
132+ { \ltjalchar"2423\scan_stop: }
133+ { \fontspec_visible_space_fallback: }
134+ }
135+
26136 \def\verb
27137 {
28138 \relax\ifmmode\hbox\else\leavevmode\fi % same as lltjcore
@@ -32,11 +142,11 @@
32142 \@ifstar\__fontspecsverb\@verb
33143 }
34144
35-
36-%%%%%%%% shapes in \em
37145 \cs_set:Npn \emshape { \gtfamily \itshape }
38146 \cs_set:Npn \eminnershape { \mcfamily \upshape }
39147
40148 \ExplSyntaxOff
41149 \expandafter\patchcmd\csname TU\string\textasteriskcentered\endcsname{\char}{\ltjalchar}{}{}
150+
42151 \endinput
152+
Show on old repository browser