• R/O
  • HTTP
  • SSH
  • HTTPS

luatexja: Commit

ソースコードの管理場所


Commit MetaInfo

Revisionfce58171f9b6a4efc22a260d9542e07c7325482e (tree)
Time2018-08-04 07:04:08
AuthorHironori Kitagawa <h_kitagawa2001@yaho...>
CommiterHironori Kitagawa

Log Message

Merge branch 'kitagawa_test' into kitagawa_lineprofile

Change Summary

Incremental Difference

--- a/doc/luatexja.dtx
+++ b/doc/luatexja.dtx
@@ -640,7 +640,7 @@ and \emph{Japanese fonts} for fonts used in \textbf{JAchar}.
640640 \item \Pkg{adobemapping} (Adobe cmap and pdfmapping files)
641641 \item \Pkg{etoolbox}, \Pkg{everysel} (if you want to use \LuaTeX-ja with \LaTeXe)
642642 \item \Pkg{ltxcmds}, \Pkg{pdftexcmds}, \Pkg{filehook}, \Pkg{atbegshi}
643-\item \Pkg{fontspec} v2.4 (or later)
643+\item \Pkg{fontspec} v2.5c (or later)
644644 %<en>\item \emph{IPAex fonts} (\url{http://ipafont.ipa.go.jp/})
645645 %<ja>\item \emph{IPAexフォント(\url{http://ipafont.ipa.go.jp/})}
646646 \end{itemize}
--- a/src/addons/luatexja-fontspec-26h.sty
+++ b/src/addons/luatexja-fontspec-26h.sty
@@ -3,7 +3,7 @@
33 %
44
55 \NeedsTeXFormat{LaTeX2e}
6-\ProvidesPackage{luatexja-fontspec-26h}[2018/07/31 fontspec support of LuaTeX-ja]
6+\ProvidesPackage{luatexja-fontspec-26h}[2018/08/02 fontspec support of LuaTeX-ja]
77 \RequirePackage{l3keys2e,luatexja}
88 \ExplSyntaxOn
99
@@ -93,8 +93,32 @@
9393 \DeclareKanjiFamily {JT3} {#2} {#3}
9494 }
9595
96+%% save and restore global variable
9697 \tl_new:N \g__ltj_fontspec_kanji_nfss_family_tl
9798 \tl_new:N \g__ltj_fontspec_orig_nfss_family_tl
99+\seq_new:N \g__ltj_fontspec_kanji_bf_series_seq
100+\seq_new:N \g__ltj_fontspec_orig_bf_series_seq
101+\clist_new:N \g__ltj_fontspec_kanji_default_fontopts_clist
102+\clist_new:N \g__ltj_fontspec_orig_default_fontopts_clist
103+
104+\cs_new:Nn \__ltj_set_global_variable_for_kanji: {
105+ \tl_gset_eq:NN \g__ltj_fontspec_orig_nfss_family_tl \g__fontspec_nfss_family_tl
106+ \tl_gset_eq:NN \g__fontspec_nfss_family_tl \g__ltj_fontspec_kanji_nfss_family_tl
107+ \seq_gset_eq:NN \g__ltj_fontspec_orig_bf_series_seq \g__fontspec_bf_series_seq
108+ \seq_gset_eq:NN \g__fontspec_bf_series_seq \g__ltj_fontspec_kanji_bf_series_seq
109+ %\seq_gclear:N \g__fontspec_bf_series_seq
110+ \clist_set_eq:NN \g__ltj_fontspec_orig_default_fontopts_clist \g__fontspec_default_fontopts_clist
111+ \clist_set_eq:NN \g__fontspec_default_fontopts_clist \g__ltj_fontspec_kanji_default_fontopts_clist
112+}
113+
114+\cs_new:Nn \__ltj_restore_global_variable: {
115+ \tl_gset_eq:NN \g__ltj_fontspec_kanji_nfss_family_tl \g__fontspec_nfss_family_tl
116+ \tl_gset_eq:NN \g__fontspec_nfss_family_tl \g__ltj_fontspec_orig_nfss_family_tl
117+ \seq_gset_eq:NN \g__ltj_fontspec_kanji_bf_series_seq \g__fontspec_bf_series_seq
118+ \seq_gset_eq:NN \g__fontspec_bf_series_seq \g__ltj_fontspec_orig_bf_series_seq
119+ \clist_set_eq:NN \g__ltj_fontspec_kanji_default_fontopts_clist \g__fontspec_default_fontopts_clist
120+ \clist_set_eq:NN \g__fontspec_default_fontopts_clist \g__ltj_fontspec_orig_default_fontopts_clist
121+}
98122
99123 \cs_set_eq:NN \__ltj_orig_fontspec_select_font_family:nn \__fontspec_select_font_family:nn
100124 \cs_new_protected:Nn \ltj_fontspec_select_font_family:nn {
@@ -144,7 +168,7 @@
144168 \clist_set:Nx \g__fontspec_default_fontopts_clist {
145169 YokoFeatures = { JFM=ujis }, TateFeatures = { JFM=ujisv },
146170 Scale=\Cjascale, Kerning=Off, Script=CJK,
147- \g__ltj_fontspec_default_fontopts_clist
171+ \g__ltj_fontspec_kanji_default_fontopts_clist
148172 }
149173 \prop_set_eq:NN \g__fontspec_fontopts_prop \g__ltj_fontspec_fontopts_prop
150174 \cs_set_eq:NN \__fontspec_make_font_shapes:Nnnnn \ltj_fontspec_make_font_shapes:Nnnnn
@@ -208,15 +232,11 @@
208232 }
209233
210234 \cs_new:Nn \ltj_fontspec_set_family:Nnn {
211- %\typeout{A>>[\g__fontspec_nfss_family_tl][\g__ltj_fontspec_kanji_nfss_family_tl]}
212- \tl_gset_eq:NN \g__ltj_fontspec_orig_nfss_family_tl \g__fontspec_nfss_family_tl
213- \tl_gset_eq:NN \g__fontspec_nfss_family_tl \g__ltj_fontspec_kanji_nfss_family_tl
235+ \__ltj_set_global_variable_for_kanji:
214236 \cs_set_eq:NN \__fontspec_select_font_family:nn \ltj_fontspec_select_font_family:nn
215237 \__ltj_orig_fontspec_set_family:Nnn #1 {#2} {#3}
216238 \cs_set_eq:NN \__fontspec_select_font_family:nn \__ltj_orig_fontspec_select_font_family:nn
217- \tl_gset_eq:NN \g__ltj_fontspec_kanji_nfss_family_tl \g__fontspec_nfss_family_tl
218- \tl_gset_eq:NN \g__fontspec_nfss_family_tl \g__ltj_fontspec_orig_nfss_family_tl
219- %\typeout{B>>[\g__fontspec_nfss_family_tl][\g__ltj_fontspec_kanji_nfss_family_tl]}
239+ \__ltj_restore_global_variable:
220240 }
221241 \cs_set_eq:NN \__ltj_orig_fontspec_set_family:Nnn \fontspec_set_family:Nnn
222242 \cs_set_eq:NN \__ltj_orig_fontspec_make_font_shapes:Nnnnn \__fontspec_make_font_shapes:Nnnnn
@@ -273,8 +293,8 @@
273293 {#4, \l_ltj_fontspec_altfont_leftover_clist }
274294 {#5}
275295 \DeclareAlternateKanjiFont
276- { #6 }{ \l_fontspec_family_tl }{#2}{#3}%
277- { #6 }{ \l_fontspec_family_tl }{#2}
296+ { #6 }{ \g__fontspec_nfss_family_tl }{#2}{#3}%
297+ { #6 }{ \g__fontspec_nfss_family_tl }{#2}
278298 { #3 _alt \int_use:N \g_ltj_fontspec_altnumber_int }
279299 { \l_ltj_fontspec_altrange_tl }
280300 \int_gincr:N \g_ltj_fontspec_altnumber_int
@@ -295,14 +315,14 @@
295315
296316 \DeclareDocumentCommand \setmainjfont { O{} m O{} } {
297317 \ltj_fontspec_set_family:Nnn \mcdefault {#1,#3}{#2}
298- \DeclareSymbolFont{mincho}{JY3}{\l_fontspec_family_tl}{\mddefault}{n}
299- \SetSymbolFont{mincho}{bold}{JY3}{\l_fontspec_family_tl}{\bfdefault}{n}
318+ \DeclareSymbolFont{mincho}{JY3}{\mcdefault}{\mddefault}{n}
319+ \SetSymbolFont{mincho}{bold}{JY3}{\mcdefault}{\bfdefault}{n}
300320 \normalfont
301321 }
302322
303323 \DeclareDocumentCommand \setsansjfont { O{} m O{} } {
304324 \ltj_fontspec_set_family:Nnn \gtdefault {#1,#3}{#2}
305- \DeclareMathAlphabet{\mathgt}{JY3}{\l_fontspec_family_tl}{\mddefault}{n}
325+ \DeclareMathAlphabet{\mathgt}{JY3}{\gtdefault}{\mddefault}{n}
306326 \normalfont
307327 }
308328
@@ -311,12 +331,21 @@
311331 \newfontfamily #1 [#2,#4] {#3}
312332 \cs_set_eq:NN \fontspec_set_family:Nnn \__ltj_orig_fontspec_set_family:Nnn
313333 }
334+\DeclareDocumentCommand \renewjfontfamily { m O{} m O{} } {
335+ \cs_set_eq:NN \fontspec_set_family:Nnn \ltj_fontspec_set_family:Nnn
336+ \renewfontfamily #1 [#2,#4] {#3}
337+ \cs_set_eq:NN \fontspec_set_family:Nnn \__ltj_orig_fontspec_set_family:Nnn
338+}
339+\DeclareDocumentCommand \setjfontfamily { m O{} m O{} } {
340+ \cs_set_eq:NN \fontspec_set_family:Nnn \ltj_fontspec_set_family:Nnn
341+ \setfontfamily #1 [#2,#4] {#3}
342+ \cs_set_eq:NN \fontspec_set_family:Nnn \__ltj_orig_fontspec_set_family:Nnn
343+}
314344
315345 \DeclareDocumentCommand \newjfontface { m O{} m O{} } {
316346 \newjfontfamily #1 [ BoldFont={},ItalicFont={},SmallCapsFont={},#2,#4 ] {#3}
317347 }
318348
319-\clist_new:N \g__ltj_fontspec_default_fontopts_clist
320349 \prop_new:N \g__ltj_fontspec_fontopts_prop
321350 \DeclareDocumentCommand \defaultjfontfeatures { t+ o m }
322351 {
@@ -327,11 +356,9 @@
327356 }
328357 \cs_new:Nn \__ltj_fontspec_set_default_features:nn
329358 {
330- \clist_set_eq:NN \l__ltj_fontspec_tmp_clist \g__fontspec_default_fontopts_clist
331- \clist_set_eq:NN \g__fontspec_default_fontopts_clist \g__ltj_fontspec_default_fontopts_clist
359+ \__ltj_set_global_variable_for_kanji:
332360 \__fontspec_set_default_features:nn {#1} {#2}
333- \clist_set_eq:NN \g__ltj_fontspec_default_fontopts_clist \g__fontspec_default_fontopts_clist
334- \clist_set_eq:NN \g__fontspec_default_fontopts_clist \l__ltj_fontspec_tmp_clist
361+ \__ltj_restore_global_variable:
335362 }
336363 \cs_new:Nn \__ltj_fontspec_set_font_default_features:nnn
337364 {
@@ -345,18 +372,14 @@
345372 \DeclareDocumentCommand \addjfontfeatures {m} {
346373 \ltj_fontspec_if_fontspec_font:TF
347374 {
348- %\typeout{C>>[\g__fontspec_nfss_family_tl][\g__ltj_fontspec_kanji_nfss_family_tl]}
349- \tl_gset_eq:NN \g__ltj_fontspec_orig_nfss_family_tl \g__fontspec_nfss_family_tl
350- \tl_gset_eq:NN \g__fontspec_nfss_family_tl \g__ltj_fontspec_kanji_nfss_family_tl
375+ \__ltj_set_global_variable_for_kanji:
351376 \group_begin:
352377 \tl_set_eq:NN \f@family \k@family
353378 \cs_set_eq:NN \__fontspec_select_font_family:nn \ltj_fontspec_select_font_family:nn
354379 \addfontfeatures {#1}
355380 \group_end:
356381 \kanjifamily\g__fontspec_nfss_family_tl\selectfont
357- \tl_gset_eq:NN \g__ltj_fontspec_kanji_nfss_family_tl \g__fontspec_nfss_family_tl
358- \tl_gset_eq:NN \g__fontspec_nfss_family_tl \g__ltj_fontspec_orig_nfss_family_tl
359- %\typeout{D>>[\g__fontspec_nfss_family_tl][\g__ltj_fontspec_kanji_nfss_family_tl]}
382+ \__ltj_restore_global_variable:
360383 }{
361384 \msg_warning:nn {luatexja-fontspec} {addjfontfeatures-ignored}
362385 }
--- a/src/luatexja.sty
+++ b/src/luatexja.sty
@@ -37,7 +37,7 @@
3737 \ProvidesPackage{luatexja}[2018/07/28 Japanese Typesetting with Lua(La)TeX]
3838 \fi %</LaTeX>
3939 %%%% VERSION
40-\def\LuaTeXjaversion{20180728.0}
40+\def\LuaTeXjaversion{20180803.0}
4141
4242 \directlua{require('ltj-unicode-ccfix.lua')}% catcode of ideographs
4343
--- a/src/patches/lltjp-fontspec-immediate.sty
+++ b/src/patches/lltjp-fontspec-immediate.sty
@@ -13,8 +13,66 @@
1313 \def \g__fontspec_nfss_enc_tl { \l__fontspec_nfss_enc_tl }
1414 \fi
1515
16-\@ifpackagelater{fontspec}{2017/01/01}{
1716 %%%%%%%% 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
1876 \DeclareDocumentCommand \setmainfont { O{} m O{} }
1977 {
2078 \fontspec_set_family:Nnn \g__fontspec_rmfamily_family {#1,#3} {#2}
Binary files a/test/test20a-mfont-fontspec.pdf and b/test/test20a-mfont-fontspec.pdf differ
--- a/test/test20a-mfont-fontspec.tex
+++ b/test/test20a-mfont-fontspec.tex
@@ -4,7 +4,7 @@
44
55 \makeatletter
66 \let\ltj@orig@DeclareFontShape@=\DeclareFontShape@
7-\def\DeclareFontShape@#1#2#3#4#5#6{%
7+\def\@@@DeclareFontShape@#1#2#3#4#5#6{%
88 \immediate\typeout{DFS |#1|#2|#3|#4|#5|#6|}%
99 \ltj@orig@DeclareFontShape@{#1}{#2}{#3}{#4}{#5}{#6}%
1010 }
@@ -60,6 +60,7 @@
6060 \medskip\piyo\test
6161
6262 \newpage
63+%\typeout{!!!! 5gou kana}
6364 \section{5号かな}
6465 {%
6566 \jfontspec[
@@ -76,6 +77,7 @@
7677 (\ltjjachar"21B5)%"
7778 }
7879
80+\newpage
7981 \section{addfontfeatures}
8082 \piyo\test
8183 \addjfontfeatures{
@@ -125,11 +127,11 @@
125127
126128 どっちかではうまくいくようにしたいが……
127129
128-
130+\typeout{!!! BOLD}
129131 \paragraph{BoldFeaturesとAltFontその1}
130132 \jfontspec
131133 [
132- AltFont = { { Color=0000FF, Range="6000-"9FFF } },
134+ AltFont={{Color=0000FF, Range="6000-"9FFF}},
133135 BoldFont=KozMinPr6N-Bold,
134136 UprightFeatures = {
135137 AltFont = {
Show on old repository browser