diff options
author | Karl Berry <karl@freefriends.org> | 2018-08-03 21:17:14 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-08-03 21:17:14 +0000 |
commit | c04a48d9eddfdd72dca244889f41be93c8ba1b53 (patch) | |
tree | 407702f99b583f45217f3c5c8c94cd987ab5749f /Master/texmf-dist | |
parent | 5010c435d5c9e266b90f68227f41610b19b88465 (diff) |
luatexja (3aug18)
git-svn-id: svn://tug.org/texlive/trunk@48341 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
15 files changed, 572 insertions, 68 deletions
diff --git a/Master/texmf-dist/doc/luatex/luatexja/README b/Master/texmf-dist/doc/luatex/luatexja/README index c6e723f5f66..717a7d0df5a 100644 --- a/Master/texmf-dist/doc/luatex/luatexja/README +++ b/Master/texmf-dist/doc/luatex/luatexja/README @@ -1,4 +1,4 @@ -The LuaTeX-ja Package 20180728.0 +The LuaTeX-ja Package 20180803.0 -------------------------------- Copyright (c) 2011--2018 The LuaTeX-ja project License: modified BSD (see COPYING) @@ -40,9 +40,9 @@ Installation 2. If you must/want to install manually: a. Download the source archive from CTAN, - or tagged as 20180728.0 in the Git repository by + or tagged as 20180803.0 in the Git repository by <http://git.osdn.jp/view?p=luatex-ja/luatexja.git - ;a=snapshot;h=refs/tags/20180728.0;sf=tgz> + ;a=snapshot;h=refs/tags/20180803.0;sf=tgz> b. Extract the archive and process following three files by LuaLaTeX to generate classes for Japanese typesetting: @@ -87,4 +87,4 @@ Notes * src/*.{ins.dtx} and src/ltj-kinsoku_make.tex are not needed in regular use. -Last commit date: Sat Jul 28 08:33:45 2018 +0900 +Last commit date: Fri Aug 3 13:24:03 2018 +0900 diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf b/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf Binary files differindex 6312e8552fa..81a1fdf43fc 100644 --- a/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf +++ b/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf b/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf Binary files differindex 4536a414f55..3b81dd9b308 100644 --- a/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf +++ b/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx b/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx index 36fcbd80c3e..465ef208443 100644 --- a/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx +++ b/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx @@ -72,7 +72,12 @@ \usepackage{luatexja-adjust}%\ltjdisableadjust \advance\leftmargini-1\zw\advance\leftmarginii-1\zw %</ja> - +%<en>\long\def\fakefn#1#2{\par\noindent{\footnotesize\hbox to1.8em{\hss#1}#2\par}} +%<*ja> +\long\def\fakefn#1#2{% + \par{\footnotesize\advance\leftskip 3\zw\parindent1\zw\noindent + \llap{#1\hskip.3\zw}#2\par}} +%</ja> %%%%%%%% listings %%%%%%%% IVS @@ -640,7 +645,7 @@ and \emph{Japanese fonts} for fonts used in \textbf{JAchar}. \item \Pkg{adobemapping} (Adobe cmap and pdfmapping files) \item \Pkg{etoolbox}, \Pkg{everysel} (if you want to use \LuaTeX-ja with \LaTeXe) \item \Pkg{ltxcmds}, \Pkg{pdftexcmds}, \Pkg{filehook}, \Pkg{atbegshi} -\item \Pkg{fontspec} v2.4 (or later) +\item \Pkg{fontspec} v2.5c (or later) %<en>\item \emph{IPAex fonts} (\url{http://ipafont.ipa.go.jp/}) %<ja>\item \emph{IPAexフォント(\url{http://ipafont.ipa.go.jp/})} \end{itemize} @@ -1429,16 +1434,21 @@ TrueType・OpenTypeフォントを容易に扱うためのパッケージであ %</ja> %<*en> -In the \Pkg{luatexja-fontspec} package, the following seven~commands are defined as -counterparts of original commands in the \Pkg{fontspec} package: +In the \Pkg{luatexja-fontspec} package, several commands are defined as +counterparts of original commands in the \Pkg{fontspec} package +(see \autoref{tab:ltj_fntspc}): %</en> %<*ja> -\Pkg{luatexja-fontspec}パッケージでは,以下の7つのコマンドを\Pkg{fontspec} -パッケージの元のコマンドに対応するものとして定義している: +\Pkg{luatexja-fontspec}パッケージでは,\autoref{tab:ltj_fntspc}の +「和文」行に示した命令を\Pkg{fontspec}パッケージの元のコマンド(「欧文」行) +に対応するものとして定義している: %</ja> %<*en> -\begin{center}\small -\begin{tabular}{ccccc} +\begin{table} +\caption{Commands of \Pkg{luatexja-fontspec}}\label{tab:ltj_fntspc} +\medskip +{\centering\small +\begin{tabular}{cllll} \toprule Japanese fonts &\cs{jfontspec}&\cs{setmainjfont}&\cs{setsansjfont}&\cs{setmonojfont}$^*$\\ @@ -1446,18 +1456,33 @@ alphabetic fonts &\cs{fontspec}&\cs{setmainfont}&\cs{setsansfont}&\cs{setmonofont}\\ \midrule Japanese fonts -&\cs{newjfontfamily}&\cs{newjfontface} -&\cs{defaultjfontfeatures}&\cs{addjfontfeatures}\\ +&\cs{newjfontfamily}&\cs{renewjfontfamily}$^{**}$&\cs{setjfontfamily}$^{**}$\\ alphabetic fonts -&\cs{newfontfamily}&\cs{newfontface} -&\cs{defaultfontfeatures}&\cs{addfontfeatures}\\ +&\cs{newfontfamily}&\cs{renewfontfamily}$^{**}$&\cs{setfontfamily}$^{**}$\\ +\midrule +Japanese fonts +&\cs{newjfontface}&\cs{defaultjfontfeatures}&\cs{addjfontfeatures}\\ +alphabetic fonts +&\cs{newfontface}&\cs{defaultfontfeatures}&\cs{addfontfeatures}\\ \bottomrule -\end{tabular} -\end{center} +\end{tabular}\par} +\medskip +\fakefn{$^*$}{% + \cs{setmonojfont} is defined if and only if \texttt{match} option is specified.} +\fakefn{$^{**}$}{% + \cs{renewfontfamily}~and~\cs{setfontfamily} are new commands + in \Pkg{fontspec}~v2.6h (2018/7/30). + Hence, \Pkg{luatexja-fontspec} define \cs{renewjfontfamily}~and~\cs{setjfontfamily} + only when \Pkg{fontspec}~v2.6h (or later) is used. +} +\end{table} %</en> %<*ja> -\begin{center}\small -\begin{tabular}{ccccc} +\begin{table} +\caption{\Pkg{luatexja-fontspec}で定義される命令}\label{tab:ltj_fntspc} +\medskip +{\centering\small +\begin{tabular}{cllll} \toprule 和文 &\cs{jfontspec}&\cs{setmainjfont}&\cs{setsansjfont}&\cs{setmonojfont}$^*$\\ @@ -1465,14 +1490,28 @@ alphabetic fonts &\cs{fontspec}&\cs{setmainfont}&\cs{setsansfont}&\cs{setmonofont}\\ \midrule 和文 -&\cs{newjfontfamily}&\cs{newjfontface} -&\cs{defaultjfontfeatures}&\cs{addjfontfeatures}\\ +&\cs{newjfontfamily}&\cs{renewjfontfamily}$^{**}$&\cs{setjfontfamily}$^{**}$\\ 欧文 -&\cs{newfontfamily}&\cs{newfontface} -&\cs{defaultfontfeatures}&\cs{addfontfeatures}\\ +&\cs{newfontfamily}&\cs{renewfontfamily}$^{**}$&\cs{setfontfamily}$^{**}$\\ +\midrule +和文 +&\cs{newjfontface}&\cs{defaultjfontfeatures}&\cs{addjfontfeatures}\\ +欧文 +&\cs{newfontface}&\cs{defaultfontfeatures}&\cs{addfontfeatures}\\ \bottomrule -\end{tabular} -\end{center} +\end{tabular}\par} + +\medskip +\fakefn{$^*$}{\cs{setmonojfont} は \texttt{match} オプションが +指定された時のみ定義される.} +\fakefn{$^{**}$}{% + \cs{renewfontfamily} と \cs{setfontfamily} は + \Pkg{fontspec}~v2.6h (2018/7/30)で新たに追加された命令である. + そのため,\Pkg{luatexja-fontspec}が \cs{renewjfontfamily} と \cs{setjfontfamily} を + 定義するのはv2.6h以降の\Pkg{fontspec}を使用した時のみになっている. +} + +\end{table} %</ja> %<en> The package option of \Pkg{luatexja-fontspec} are the followings: @@ -6378,7 +6417,7 @@ for example, the meaning of \cs{TU\cs{textquotedblleft}} is \cs{ltjalchar8220\lt \begin{table}[t] \centering\small - \caption{strut}\label{tab:strutbox} + \caption{strut}\label{tab:strutbox}\medskip \begin{tabular}{llcccl} \toprule \textbf{box}&\textbf{direction}&\textbf{width}&\textbf{height}&\textbf{depth} @@ -6795,11 +6834,11 @@ with priority&% \\ \bottomrule \end{tabular}\par} -\smallskip +\medskip -Note: the value of +\fakefn{}{The value of \Param{kanjiskip} is 0\,pt${}^{+1/5\,\mathrm{em}}_{-1/5\,\mathrm{em}}$ in this figure, -for making the difference obvious. +for making the difference obvious.} %<ja>\caption{行長調整}\label{fig:adj} %<en>\caption{Line adjustment}\label{fig:adj} \end{figure} diff --git a/Master/texmf-dist/source/luatex/luatexja/ltjsclasses.dtx b/Master/texmf-dist/source/luatex/luatexja/ltjsclasses.dtx index 3d27b48dde1..8709f418693 100644 --- a/Master/texmf-dist/source/luatex/luatexja/ltjsclasses.dtx +++ b/Master/texmf-dist/source/luatex/luatexja/ltjsclasses.dtx @@ -44,7 +44,7 @@ %<*driver> \ProvidesFile{ltjsclasses.dtx} %</driver> - [2018/07/24 ltjsclasses ] + [2018/07/30 ltjsclasses ] %<*driver> \IfFileExists{luatex85.sty}{\RequirePackage{luatex85}}{} \documentclass{ltjsarticle} @@ -623,6 +623,8 @@ % % [2016-11-24 LTJ] \texttt{autodetect-engine} はLua\TeX-jaでは意味がないので警告を表示させます. % +% [2018-07-30 LTJ] \texttt{uplatex} 指定時のエラーが正しく表示されなかったので修正しました. +% % \begin{macrocode} \newif\ifmingoth \mingothfalse @@ -631,11 +633,11 @@ \newif\ifptexjis \ptexjisfalse \DeclareOption{winjis}{% - \ClassWarningNoLine{\jsc@clsname}{The \jsc@clsname\space class does not support `winjis' option}} + \ClassWarningNoLine{\jsc@clsname}{this class does not support `winjis' option}} \DeclareOption{uplatex}{% - \ClassErrorNoLine{\jsc@clsname}{The \jsc@clsname\space class does not support `uplatex' option}} + \ClassError{\jsc@clsname}{this class does not support `uplatex' option}} \DeclareOption{autodetect-engine}{% - \ClassWarningNoLine{\jsc@clsname}{The \jsc@clsname\space class does not support `autodetect-engine' option}} + \ClassWarningNoLine{\jsc@clsname}{this class does not support `autodetect-engine' option}} \DeclareOption{mingoth}{\mingothtrue} \DeclareOption{ptexjis}{\ptexjistrue} \DeclareOption{jis}{\jisfonttrue} diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec-26h.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec-26h.sty new file mode 100644 index 00000000000..6c1ffdd64d2 --- /dev/null +++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec-26h.sty @@ -0,0 +1,396 @@ +% +% luatexja-fontspec-26h.sty +% + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{luatexja-fontspec-26h}[2018/08/02 fontspec support of LuaTeX-ja] +\RequirePackage{l3keys2e,luatexja} +\ExplSyntaxOn + +%%%%%%%% Change Japanese font family by \rmfamily or not +\cs_new:Npn \ltj_fontspec_match_cmd { + \renewcommand\jttdefault{\gtdefault} + \@ltj@match@familytrue + \DeclareDocumentCommand \setmonojfont { O{} m } { + \ltj_fontspec_set_family:Nnn \jttdefault {##1}{##2} + \normalfont + } +} +\bool_if:NT \ltj_fontspec_match_bool \ltj_fontspec_match_cmd + +%%%%%%%% Messages +\msg_new:nnn {luatexja-fontspec} {addjfontfeatures-ignored} +{ + \string\addjfontfeature (s)~ ignored;\\ + it~ cannot~ be~ used~ with~ a~ font~ that~ wasn't~ selected~ by~ luatexja-fontspec. +} + +\msg_new:nnn {luatexja-fontspec} {altfont-ignored-by-norange} +{ + ignored~ sublist~ `#1'~ in~ AltFont~ (no~ range~ is~ specified). +} + +\msg_new:nnn {luatexja-fontspec} {altfont-ignored-by-rangeonly} +{ + ignored~ sublist~ `#1'~ in~ AltFont~ (only~ range~ is~ specified). +} + +\cs_generate_variant:Nn \prg_new_conditional:Nnn {Nnx} + +%%%%%%%% Internal control sequences +%% Each CS is ltj_fontspec version that corresponds to original CS of fontspec. +\cs_new:Nn \ltj_fontspec_define_option:nn { + \__fontspec_keys_define_code:nnn {fontspec} {#1} {#2} +} +\cs_new:Nn \ltj_fontspec_define_preparse_external:nn { + \__fontspec_keys_define_code:nnn {fontspec-preparse-external} {#1} {#2} +} +\cs_new:Nn \ltj_fontspec_define_altfont_option:nn { + \__fontspec_keys_define_code:nnn {fontspec-ltjaltfont} {#1} {#2} +} + +%% Alternate Fonts +%% Spec: AltFont = { +%% ... +%% { Range = <range>, <font features> }, +%% { Range = <range>, Font = <font name>, <font features> }, +%% { Range = <range>, Font = <font name> }, +%% ... +%% } +\tl_new:N \l_ltj_fontspec_altname_tl +\tl_new:N \l_ltj_fontspec_altrange_tl +\clist_new:N \l_ltj_fontspec_altfont_clist +\clist_new:N \l_ltj_fontspec_altfont_leftover_clist +\int_new:N \g_ltj_fontspec_altnumber_int + +\ltj_fontspec_define_altfont_option:nn {Range} { + \tl_set:Nn \l_ltj_fontspec_altrange_tl {#1} +} +\ltj_fontspec_define_altfont_option:nn {Font} { + \fontspec_complete_fontname:Nn \l_ltj_fontspec_altname_tl {#1} +} +\__fontspec_keys_define_code:nnn {fontspec-ltjaltfont-reparse} {AltFont} { + \clist_put_right:Nn \l_ltj_fontspec_altfont_clist { #1 } +} +\__fontspec_keys_define_code:nnn {fontspec-ltjaltfont-reparse} {YokoFeatures} { + \clist_put_right:Nn \l_ltj_fontspec_fontfeat_yoko_clist { #1 } +} +\__fontspec_keys_define_code:nnn {fontspec-ltjaltfont-reparse} {TateFeatures} { + \clist_put_right:Nn \l_ltj_fontspec_fontfeat_tate_clist { #1 } +} +\__fontspec_keys_define_code:nnn {fontspec-ltjaltfont-reparse} {TateFont} { + \tl_if_empty:nF {#1} { + \fontspec_complete_fontname:Nn \l_ltj_fontspec_fontname_tate_tl {#1} + } +} +%% +\clist_new:N \l_ltj_fontspec_fontfeat_yoko_clist +\clist_new:N \l_ltj_fontspec_fontfeat_tate_clist +\tl_new:N \l_ltj_fontspec_fontname_tate_tl + +\cs_new:Npn \ltj_fontspec_DeclareFontFamily #1 #2 #3 { + \DeclareKanjiFamily {JY3} {#2} {#3} + \DeclareKanjiFamily {JT3} {#2} {#3} +} + +%% save and restore global variable +\tl_new:N \g__ltj_fontspec_kanji_nfss_family_tl +\tl_new:N \g__ltj_fontspec_orig_nfss_family_tl +\seq_new:N \g__ltj_fontspec_kanji_bf_series_seq +\seq_new:N \g__ltj_fontspec_orig_bf_series_seq +\clist_new:N \g__ltj_fontspec_kanji_default_fontopts_clist +\clist_new:N \g__ltj_fontspec_orig_default_fontopts_clist + +\cs_new:Nn \__ltj_set_global_variable_for_kanji: { + \tl_gset_eq:NN \g__ltj_fontspec_orig_nfss_family_tl \g__fontspec_nfss_family_tl + \tl_gset_eq:NN \g__fontspec_nfss_family_tl \g__ltj_fontspec_kanji_nfss_family_tl + \seq_gset_eq:NN \g__ltj_fontspec_orig_bf_series_seq \g__fontspec_bf_series_seq + \seq_gset_eq:NN \g__fontspec_bf_series_seq \g__ltj_fontspec_kanji_bf_series_seq + %\seq_gclear:N \g__fontspec_bf_series_seq + \clist_set_eq:NN \g__ltj_fontspec_orig_default_fontopts_clist \g__fontspec_default_fontopts_clist + \clist_set_eq:NN \g__fontspec_default_fontopts_clist \g__ltj_fontspec_kanji_default_fontopts_clist +} + +\cs_new:Nn \__ltj_restore_global_variable: { + \tl_gset_eq:NN \g__ltj_fontspec_kanji_nfss_family_tl \g__fontspec_nfss_family_tl + \tl_gset_eq:NN \g__fontspec_nfss_family_tl \g__ltj_fontspec_orig_nfss_family_tl + \seq_gset_eq:NN \g__ltj_fontspec_kanji_bf_series_seq \g__fontspec_bf_series_seq + \seq_gset_eq:NN \g__fontspec_bf_series_seq \g__ltj_fontspec_orig_bf_series_seq + \clist_set_eq:NN \g__ltj_fontspec_kanji_default_fontopts_clist \g__fontspec_default_fontopts_clist + \clist_set_eq:NN \g__fontspec_default_fontopts_clist \g__ltj_fontspec_orig_default_fontopts_clist +} + +\cs_set_eq:NN \__ltj_orig_fontspec_select_font_family:nn \__fontspec_select_font_family:nn +\cs_new_protected:Nn \ltj_fontspec_select_font_family:nn { + \group_begin: + \ltj_fontspec_define_option:nn {NoEmbed} {} + \ltj_fontspec_define_option:nn {AltFont} { + \clist_put_right:Nn \l_ltj_fontspec_altfont_clist { ##1 } + } + \ltj_fontspec_define_option:nn {CID} { + \__fontspec_update_featstr:n {cid=##1} + } + \ltj_fontspec_define_option:nn {Kanjiskip} { + \str_if_eq_x:nnTF {false} { \str_lower_case:n { ##1 } }{ + \__fontspec_update_featstr:n {-ltjksp} + } { + \__fontspec_update_featstr:n {+ltjksp} + } + } + \ltj_fontspec_define_option:nn {JFM} { + \__fontspec_update_featstr:n {jfm=##1} + } + % vary by shape + \ltj_fontspec_define_option:nn {YokoFeatures} { + \clist_put_right:Nn \l_ltj_fontspec_fontfeat_yoko_clist { ##1 } + } + \ltj_fontspec_define_option:nn {TateFeatures} { + \clist_put_right:Nn \l_ltj_fontspec_fontfeat_tate_clist { ##1 } + } + \ltj_fontspec_define_option:nn {TateFont} + { + \tl_if_empty:nF {##1} { + \fontspec_complete_fontname:Nn \l_ltj_fontspec_fontname_tate_tl {##1} + } + } + \ltj_fontspec_define_option:nn {JFM-var} { + \__fontspec_update_featstr:n {jfmvar=##1} + } + \ltj_fontspec_define_preparse_external:nn {NoEmbed} { + \cs_set:Npn \__fontspec_fontname_wrap:n ##1 {psft:##1} + } + + %% Omit the warning message + %% "OpenType feature 'Kerning=Off' (-kern) not available ..." + \keys_define:nn {fontspec-opentype} { + Kerning/Off.code:n=\__fontspec_update_featstr:n {-kern} + } + \clist_set:Nx \g__fontspec_default_fontopts_clist { + YokoFeatures = { JFM=ujis }, TateFeatures = { JFM=ujisv }, + Scale=\Cjascale, Kerning=Off, Script=CJK, + \g__ltj_fontspec_kanji_default_fontopts_clist + } + \prop_set_eq:NN \g__fontspec_fontopts_prop \g__ltj_fontspec_fontopts_prop + \cs_set_eq:NN \__fontspec_make_font_shapes:Nnnnn \ltj_fontspec_make_font_shapes:Nnnnn + \cs_set_eq:NN \DeclareFontFamily \ltj_fontspec_DeclareFontFamily + \tl_set:Nn \g_fontspec_encoding_tl {JY3} + \__ltj_orig_fontspec_select_font_family:nn{#1}{#2} + + \cs_gset:Npx \__ltj_fontspec_aftergroup { + \exp_not:N \tl_set:Nn \exp_not:N \l_fontspec_family_tl { \l_fontspec_family_tl } + } + \aftergroup \__ltj_fontspec_aftergroup + \group_end: +} + +%% declare_shape + +\cs_new:Nn \ltj_fontspec_declare_shape_yoko:nnnn { + \ltj_fontspec_declare_shape_aux:nnnnnn {#1} {#2} {#3} {#4} { JY3 } { \l_ltj_fontspec_fontfeat_yoko_clist } +} +\cs_new:Nn \ltj_fontspec_declare_shape_tate:nnnn { + \ltj_fontspec_declare_shape_aux:nnnnnn {#1} {#2} {#3} {#4} { JT3 } { \l_ltj_fontspec_fontfeat_tate_clist } +} +\cs_new:Nn \ltj_fontspec_declare_shape:nnnn { + \ltj_fontspec_declare_shape_yoko:nnnn {#1} {#2} {#3} {#4} + \ltj_fontspec_declare_shape_tate:nnnn {#1} {#2} {#3} {#4} +} +\cs_generate_variant:Nn \ltj_fontspec_declare_shape:nnnn {nnxx} +\cs_generate_variant:Nn \ltj_fontspec_declare_shape_yoko:nnnn {nnxx} +\cs_generate_variant:Nn \ltj_fontspec_declare_shape_tate:nnnn {nnxx} + +\cs_new:Nn \ltj_fontspec_declare_shape_aux:nnnnnn + { + \tl_clear:N \l__fontspec_nfss_tl + \tl_clear:N \l__fontspec_nfss_sc_tl + \tl_set_eq:NN \l__fontspec_saved_fontname_tl \l_fontspec_fontname_tl + + \tl_set:Nn \g_fontspec_encoding_tl {#5} + \tl_set:Nn \g__fontspec_nfss_enc_tl {#5} + \exp_args:Nx \clist_map_inline:nn {#4} + { + \tl_clear:N \l__fontspec_size_tl + \tl_set_eq:NN \l__fontspec_sizedfont_tl \l__fontspec_saved_fontname_tl % in case not spec'ed + + \keys_set_known:nxN {fontspec-sizing} { \exp_after:wN \use:n ##1 } + \l__fontspec_sizing_leftover_clist + \tl_if_empty:NT \l__fontspec_size_tl { \__fontspec_error:n {no-size-info} } + + \str_if_eq:nnTF { #5 } { JY3 } { + % "normal" + \__fontspec_load_fontname:n {\l__fontspec_sizedfont_tl} + } { + \tl_if_empty:NTF \l_ltj_fontspec_fontname_tate_tl + { \__fontspec_load_fontname:n {\l__fontspec_sizedfont_tl} } + { \__fontspec_load_fontname:n {\l_ltj_fontspec_fontname_tate_tl} } + } + \__fontspec_setup_nfss:Nnnn \l__fontspec_nfss_tl {#3} {#6} {} + } + \bool_set_true:N \l__fontspec_nosc_bool + \__fontspec_declare_shapes_normal:nn {#1} {#2} + \__fontspec_declare_shape_slanted:nn {#1} {#2} + } + +\cs_new:Nn \ltj_fontspec_set_family:Nnn { + \__ltj_set_global_variable_for_kanji: + \cs_set_eq:NN \__fontspec_select_font_family:nn \ltj_fontspec_select_font_family:nn + \__ltj_orig_fontspec_set_family:Nnn #1 {#2} {#3} + \cs_set_eq:NN \__fontspec_select_font_family:nn \__ltj_orig_fontspec_select_font_family:nn + \__ltj_restore_global_variable: +} +\cs_set_eq:NN \__ltj_orig_fontspec_set_family:Nnn \fontspec_set_family:Nnn +\cs_set_eq:NN \__ltj_orig_fontspec_make_font_shapes:Nnnnn \__fontspec_make_font_shapes:Nnnnn +\cs_set_eq:NN \__ltj_fontspec_orig_DeclareFontShape \DeclareFontShape + +\cs_new:Nn \ltj_fontspec_make_font_shapes:Nnnnn { + \group_begin: + %% 基底フォント + \cs_set_eq:NN \__fontspec_font_set:Nnn \use_none:nnn + \cs_set_eq:NN \__fontspec_font_if_null:NT \use_none:nn + \cs_set_eq:NN \__fontspec_declare_shape:nnxx \ltj_fontspec_declare_shape:nnxx + \__ltj_orig_fontspec_make_font_shapes:Nnnnn {#1} {#2} {#3} {#4} {#5} + %% + \ltj_fontspec_make_font_shapes_alt:Nnnnnn {#1}{#2}{#3} + {#4, \l_ltj_fontspec_fontfeat_yoko_clist}{#5} {JY3 } + \ltj_fontspec_make_font_shapes_alt:Nnnnnn {#1}{#2}{#3} + {#4, \l_ltj_fontspec_fontfeat_tate_clist}{#5} {JT3} + \group_end: + } + +%%% Altfont 内部処理部 +\cs_new:Nn \ltj_fontspec_make_font_shapes_alt:Nnnnnn { + \group_begin: + \str_if_eq:nnTF { #6 } { JY3 } { + \cs_set_eq:NN \__fontspec_declare_shape:nnxx \ltj_fontspec_declare_shape_yoko:nnxx + }{ + \cs_set_eq:NN \__fontspec_declare_shape:nnxx \ltj_fontspec_declare_shape_tate:nnxx + } + \keys_set_known:nn {fontspec-ltjaltfont-reparse} { #4 } + \clist_if_empty:NF \l_ltj_fontspec_altfont_clist { + \int_gzero:N \g_ltj_fontspec_altnumber_int + \clist_map_inline:Nn \l_ltj_fontspec_altfont_clist { + \tl_clear:N \l_ltj_fontspec_altrange_tl + \tl_set:Nn \l_ltj_fontspec_altname_tl { #1 } + \tl_set:Nn \l_tmpa_tl { #1 } + + \keys_set_known:nxN {fontspec-ltjaltfont} { \exp_after:wN \use:n ##1 } + \l_ltj_fontspec_altfont_leftover_clist + \keys_set_known:nn {fontspec-ltjaltfont-reparse} { \exp_after:wN \use:n ##1 } + + \tl_if_empty:NT \l_ltj_fontspec_altrange_tl { + \msg_warning:nnn {luatexja-fontspec} {altfont-ignored-by-norange} { ##1 } + } { + \bool_if:nTF { + \tl_if_eq_p:NN \l_ltj_fontspec_altname_tl \l_tmpa_tl + && + \tl_if_empty_p:N \l_ltj_fontspec_altfont_leftover_clist + } { + \msg_warning:nnn {luatexja-fontspec} {altfont-ignored-by-rangeonly} { ##1 } + } { + \__ltj_orig_fontspec_make_font_shapes:Nnnnn + { \l_ltj_fontspec_altname_tl } {#2} + {#3 _ alt \int_use:N \g_ltj_fontspec_altnumber_int } + {#4, \l_ltj_fontspec_altfont_leftover_clist } + {#5} + \DeclareAlternateKanjiFont + { #6 }{ \g__fontspec_nfss_family_tl }{#2}{#3}% + { #6 }{ \g__fontspec_nfss_family_tl }{#2} + { #3 _alt \int_use:N \g_ltj_fontspec_altnumber_int } + { \l_ltj_fontspec_altrange_tl } + \int_gincr:N \g_ltj_fontspec_altnumber_int + } + } + } + } + \group_end: +} + + +%%%%%%%% User commands +\DeclareDocumentCommand \jfontspec { O{} m O{} } { + \ltj_fontspec_set_family:Nnn \k@family {#1,#3}{#2} + \selectfont + \ignorespaces +} + +\DeclareDocumentCommand \setmainjfont { O{} m O{} } { + \ltj_fontspec_set_family:Nnn \mcdefault {#1,#3}{#2} + \DeclareSymbolFont{mincho}{JY3}{\mcdefault}{\mddefault}{n} + \SetSymbolFont{mincho}{bold}{JY3}{\mcdefault}{\bfdefault}{n} + \normalfont +} + +\DeclareDocumentCommand \setsansjfont { O{} m O{} } { + \ltj_fontspec_set_family:Nnn \gtdefault {#1,#3}{#2} + \DeclareMathAlphabet{\mathgt}{JY3}{\gtdefault}{\mddefault}{n} + \normalfont +} + +\DeclareDocumentCommand \newjfontfamily { m O{} m O{} } { + \cs_set_eq:NN \fontspec_set_family:Nnn \ltj_fontspec_set_family:Nnn + \newfontfamily #1 [#2,#4] {#3} + \cs_set_eq:NN \fontspec_set_family:Nnn \__ltj_orig_fontspec_set_family:Nnn +} +\DeclareDocumentCommand \renewjfontfamily { m O{} m O{} } { + \cs_set_eq:NN \fontspec_set_family:Nnn \ltj_fontspec_set_family:Nnn + \renewfontfamily #1 [#2,#4] {#3} + \cs_set_eq:NN \fontspec_set_family:Nnn \__ltj_orig_fontspec_set_family:Nnn +} +\DeclareDocumentCommand \setjfontfamily { m O{} m O{} } { + \cs_set_eq:NN \fontspec_set_family:Nnn \ltj_fontspec_set_family:Nnn + \setfontfamily #1 [#2,#4] {#3} + \cs_set_eq:NN \fontspec_set_family:Nnn \__ltj_orig_fontspec_set_family:Nnn +} + +\DeclareDocumentCommand \newjfontface { m O{} m O{} } { + \newjfontfamily #1 [ BoldFont={},ItalicFont={},SmallCapsFont={},#2,#4 ] {#3} +} + +\prop_new:N \g__ltj_fontspec_fontopts_prop +\DeclareDocumentCommand \defaultjfontfeatures { t+ o m } + { + \IfNoValueTF {#2} + { \__ltj_fontspec_set_default_features:nn {#1} {#3} } + { \__ltj_fontspec_set_font_default_features:nnn {#1} {#2} {#3} } + \ignorespaces + } +\cs_new:Nn \__ltj_fontspec_set_default_features:nn + { + \__ltj_set_global_variable_for_kanji: + \__fontspec_set_default_features:nn {#1} {#2} + \__ltj_restore_global_variable: + } +\cs_new:Nn \__ltj_fontspec_set_font_default_features:nnn + { + \prop_set_eq:NN \l__ltj_fontspec_tmp_prop \g__fontspec_fontopts_prop + \prop_set_eq:NN \g__fontspec_fontopts_prop \g__ltj_fontspec_fontopts_prop + \__fontspec_set_font_default_features:nnn {#1} {#2} {#3} + \prop_set_eq:NN \g__ltj_fontspec_fontopts_prop \g__fontspec_fontopts_prop + \prop_set_eq:NN \g__fontspec_fontopts_prop \l__ltj_fontspec_tmp_prop + } + +\DeclareDocumentCommand \addjfontfeatures {m} { + \ltj_fontspec_if_fontspec_font:TF + { + \__ltj_set_global_variable_for_kanji: + \group_begin: + \tl_set_eq:NN \f@family \k@family + \cs_set_eq:NN \__fontspec_select_font_family:nn \ltj_fontspec_select_font_family:nn + \addfontfeatures {#1} + \group_end: + \kanjifamily\g__fontspec_nfss_family_tl\selectfont + \__ltj_restore_global_variable: + }{ + \msg_warning:nn {luatexja-fontspec} {addjfontfeatures-ignored} + } + \ignorespaces +} + +\cs_set_eq:NN \addjfontfeature \addjfontfeatures + +\prg_new_conditional:Nnn \ltj_fontspec_if_fontspec_font: {TF,T,F} +{ + \cs_if_exist:cTF {g__fontspec_fontinfo_ \k@family _prop} \prg_return_true: \prg_return_false: +} + +\endinput diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec.sty index 34ef824f38e..8a686ea4e6d 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec.sty @@ -3,7 +3,7 @@ % \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{luatexja-fontspec}[2017/12/31 fontspec support of LuaTeX-ja] +\ProvidesPackage{luatexja-fontspec}[2018/07/31 fontspec support of LuaTeX-ja] \RequirePackage{l3keys2e,luatexja} \ExplSyntaxOn @@ -30,10 +30,9 @@ \ProcessKeysOptions{ luatexja-fontspec } \RequirePackage{fontspec}[2017/01/01]% v2.5c -\RequirePackage{luatexja-fontspec-25c} -%\@ifpackagelater{fontspec}{2017/01/01}% -% {\RequirePackage{luatexja-fontspec-25c}}% v2.5c -% {\RequirePackage{luatexja-fontspec-24}}% --v2.5a +\@ifpackagelater{fontspec}{2018/07/29}% + {\RequirePackage{luatexja-fontspec-26h}}% v2.6h + {\RequirePackage{luatexja-fontspec-25c}}% v2.5c \ExplSyntaxOff %%%%%%%% Now we completely ignore kanjifont definition file. diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-preset.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-preset.sty index a6babd03338..b2eabb12fb4 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-preset.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-preset.sty @@ -1,5 +1,5 @@ % luatexja-preset.sty -\ProvidesPackage{luatexja-preset}[2018/06/15 Japanese font presets] +\ProvidesPackage{luatexja-preset}[2018/08/01 Japanese font presets] \RequirePackage{expl3,l3keys2e} \RequirePackage{luatexja} @@ -562,6 +562,10 @@ \seq_if_in:NnTF \g_ltjpreset_presets_seq { #2 } { \bool_if:cTF { c_ #1 _bool } { \msg_warning:nnn { luatexja-preset }{ exist-preset-overwrite } { #2 } + \keys_define:nn { luatexja-preset } { + #2 .meta:n = { #3, __custom = true, __noembed = false, __office = false, }, + #2 .value_forbidden:n = true, #2 .groups:n = { preset }, + } } { \msg_error:nnn { luatexja-preset }{ exist-preset-nooverwrite } { #2 } } @@ -579,6 +583,7 @@ \cs_set:Npn \ltjapplypreset #1 { \keys_set_groups:nnn { luatexja-preset } { preset } { #1 } + % \prop_map_inline:Nn \g_ltjpreset_font_prop {\typeout{ [##1] = "##2" } } \ltjpreset_extract_fonts: \ltjpreset_check_deluxe_existence: \ltjpreset_do_fontset: diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjsarticle.cls b/Master/texmf-dist/tex/luatex/luatexja/ltjsarticle.cls index e9408fe7609..d844d1260dd 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltjsarticle.cls +++ b/Master/texmf-dist/tex/luatex/luatexja/ltjsarticle.cls @@ -38,7 +38,7 @@ %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{ltjsarticle} - [2018/07/24 ltjsclasses ] + [2018/07/30 ltjsclasses ] \def\jsc@clsname{ltjsarticle} \RequirePackage{luatexja} \newif\if@restonecol @@ -204,11 +204,11 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}% \newif\ifptexjis \ptexjisfalse \DeclareOption{winjis}{% - \ClassWarningNoLine{\jsc@clsname}{The \jsc@clsname\space class does not support `winjis' option}} + \ClassWarningNoLine{\jsc@clsname}{this class does not support `winjis' option}} \DeclareOption{uplatex}{% - \ClassErrorNoLine{\jsc@clsname}{The \jsc@clsname\space class does not support `uplatex' option}} + \ClassError{\jsc@clsname}{this class does not support `uplatex' option}} \DeclareOption{autodetect-engine}{% - \ClassWarningNoLine{\jsc@clsname}{The \jsc@clsname\space class does not support `autodetect-engine' option}} + \ClassWarningNoLine{\jsc@clsname}{this class does not support `autodetect-engine' option}} \DeclareOption{mingoth}{\mingothtrue} \DeclareOption{ptexjis}{\ptexjistrue} \DeclareOption{jis}{\jisfonttrue} diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjsbook.cls b/Master/texmf-dist/tex/luatex/luatexja/ltjsbook.cls index 7c215e2e09f..60112800f80 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltjsbook.cls +++ b/Master/texmf-dist/tex/luatex/luatexja/ltjsbook.cls @@ -38,7 +38,7 @@ %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{ltjsbook} - [2018/07/24 ltjsclasses ] + [2018/07/30 ltjsclasses ] \def\jsc@clsname{ltjsbook} \RequirePackage{luatexja} \newif\if@restonecol @@ -209,11 +209,11 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}% \newif\ifptexjis \ptexjisfalse \DeclareOption{winjis}{% - \ClassWarningNoLine{\jsc@clsname}{The \jsc@clsname\space class does not support `winjis' option}} + \ClassWarningNoLine{\jsc@clsname}{this class does not support `winjis' option}} \DeclareOption{uplatex}{% - \ClassErrorNoLine{\jsc@clsname}{The \jsc@clsname\space class does not support `uplatex' option}} + \ClassError{\jsc@clsname}{this class does not support `uplatex' option}} \DeclareOption{autodetect-engine}{% - \ClassWarningNoLine{\jsc@clsname}{The \jsc@clsname\space class does not support `autodetect-engine' option}} + \ClassWarningNoLine{\jsc@clsname}{this class does not support `autodetect-engine' option}} \DeclareOption{mingoth}{\mingothtrue} \DeclareOption{ptexjis}{\ptexjistrue} \DeclareOption{jis}{\jisfonttrue} diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjskiyou.cls b/Master/texmf-dist/tex/luatex/luatexja/ltjskiyou.cls index 611d3b78561..e3ca08f93b6 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltjskiyou.cls +++ b/Master/texmf-dist/tex/luatex/luatexja/ltjskiyou.cls @@ -38,7 +38,7 @@ %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{ltjskiyou} - [2018/07/24 ltjsclasses ] + [2018/07/30 ltjsclasses ] \def\jsc@clsname{ltjskiyou} \RequirePackage{luatexja} \newif\if@restonecol @@ -203,11 +203,11 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}% \newif\ifptexjis \ptexjisfalse \DeclareOption{winjis}{% - \ClassWarningNoLine{\jsc@clsname}{The \jsc@clsname\space class does not support `winjis' option}} + \ClassWarningNoLine{\jsc@clsname}{this class does not support `winjis' option}} \DeclareOption{uplatex}{% - \ClassErrorNoLine{\jsc@clsname}{The \jsc@clsname\space class does not support `uplatex' option}} + \ClassError{\jsc@clsname}{this class does not support `uplatex' option}} \DeclareOption{autodetect-engine}{% - \ClassWarningNoLine{\jsc@clsname}{The \jsc@clsname\space class does not support `autodetect-engine' option}} + \ClassWarningNoLine{\jsc@clsname}{this class does not support `autodetect-engine' option}} \DeclareOption{mingoth}{\mingothtrue} \DeclareOption{ptexjis}{\ptexjistrue} \DeclareOption{jis}{\jisfonttrue} diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjspf.cls b/Master/texmf-dist/tex/luatex/luatexja/ltjspf.cls index 7d05ace2578..1e5210afa2e 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltjspf.cls +++ b/Master/texmf-dist/tex/luatex/luatexja/ltjspf.cls @@ -38,7 +38,7 @@ %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{ltjspf} - [2018/07/24 ltjsclasses ] + [2018/07/30 ltjsclasses ] \def\jsc@clsname{ltjspf} \RequirePackage{luatexja} \newif\if@restonecol @@ -203,11 +203,11 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}% \newif\ifptexjis \ptexjisfalse \DeclareOption{winjis}{% - \ClassWarningNoLine{\jsc@clsname}{The \jsc@clsname\space class does not support `winjis' option}} + \ClassWarningNoLine{\jsc@clsname}{this class does not support `winjis' option}} \DeclareOption{uplatex}{% - \ClassErrorNoLine{\jsc@clsname}{The \jsc@clsname\space class does not support `uplatex' option}} + \ClassError{\jsc@clsname}{this class does not support `uplatex' option}} \DeclareOption{autodetect-engine}{% - \ClassWarningNoLine{\jsc@clsname}{The \jsc@clsname\space class does not support `autodetect-engine' option}} + \ClassWarningNoLine{\jsc@clsname}{this class does not support `autodetect-engine' option}} \DeclareOption{mingoth}{\mingothtrue} \DeclareOption{ptexjis}{\ptexjistrue} \DeclareOption{jis}{\jisfonttrue} diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjsreport.cls b/Master/texmf-dist/tex/luatex/luatexja/ltjsreport.cls index 6287c0d808f..70f8dd0b89f 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltjsreport.cls +++ b/Master/texmf-dist/tex/luatex/luatexja/ltjsreport.cls @@ -38,7 +38,7 @@ %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{ltjsreport} - [2018/07/24 ltjsclasses ] + [2018/07/30 ltjsclasses ] \def\jsc@clsname{ltjsreport} \RequirePackage{luatexja} \newif\if@restonecol @@ -208,11 +208,11 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}% \newif\ifptexjis \ptexjisfalse \DeclareOption{winjis}{% - \ClassWarningNoLine{\jsc@clsname}{The \jsc@clsname\space class does not support `winjis' option}} + \ClassWarningNoLine{\jsc@clsname}{this class does not support `winjis' option}} \DeclareOption{uplatex}{% - \ClassErrorNoLine{\jsc@clsname}{The \jsc@clsname\space class does not support `uplatex' option}} + \ClassError{\jsc@clsname}{this class does not support `uplatex' option}} \DeclareOption{autodetect-engine}{% - \ClassWarningNoLine{\jsc@clsname}{The \jsc@clsname\space class does not support `autodetect-engine' option}} + \ClassWarningNoLine{\jsc@clsname}{this class does not support `autodetect-engine' option}} \DeclareOption{mingoth}{\mingothtrue} \DeclareOption{ptexjis}{\ptexjistrue} \DeclareOption{jis}{\jisfonttrue} diff --git a/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty b/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty index 8f0a663a6ae..d3c77f3708c 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty @@ -37,7 +37,7 @@ \ProvidesPackage{luatexja}[2018/07/28 Japanese Typesetting with Lua(La)TeX] \fi %</LaTeX> %%%% VERSION -\def\LuaTeXjaversion{20180728.0} +\def\LuaTeXjaversion{20180803.0} \directlua{require('ltj-unicode-ccfix.lua')}% catcode of ideographs diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-fontspec-immediate.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-fontspec-immediate.sty index 22209731d32..a0ee7b6dba4 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-fontspec-immediate.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-fontspec-immediate.sty @@ -8,22 +8,85 @@ \RequirePackage{fontspec,luatexja} \ExplSyntaxOn -\@ifpackagelater{fontspec}{2017/01/01}{ +% <= 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}{2018/07/29}{ %% 2.6h or later +\cs_set:Nn \__fontspec_main_setmainfont:nn + { + \fontspec_set_family:Nnn \l__fontspec_rmfamily_family_tl {#1} {#2} + \tl_set_eq:NN \rmdefault \l__fontspec_rmfamily_family_tl + \use:x + { + \exp_not:n { \DeclareRobustCommand \rmfamily } + { + \exp_not:N \fontencoding { \g__fontspec_nfss_enc_tl } + \exp_not:N \fontfamily { \l__fontspec_rmfamily_family_tl } + \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_x:nnT {\familydefault} {\rmdefault} + { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl } + \__fontspec_setmainfont_hook:nn {#1} {#2} + \normalfont + } +\cs_set:Nn \__fontspec_main_setsansfont:nn + { + \fontspec_set_family:Nnn \l__fontspec_sffamily_family_tl {#1} {#2} + \tl_set_eq:NN \sfdefault \l__fontspec_sffamily_family_tl + \use:x + { + \exp_not:n { \DeclareRobustCommand \sffamily } + { + \exp_not:N \fontencoding { \g__fontspec_nfss_enc_tl } + \exp_not:N \fontfamily { \l__fontspec_sffamily_family_tl } + \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_x:nnT {\familydefault} {\sfdefault} + { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl } + \__fontspec_setsansfont_hook:nn {#1} {#2} + \normalfont + } +\cs_set:Nn \__fontspec_main_setmonofont:nn + { + \fontspec_set_family:Nnn \l__fontspec_ttfamily_family_tl {#1} {#2} + \tl_set_eq:NN \ttdefault \l__fontspec_ttfamily_family_tl + \use:x + { + \exp_not:n { \DeclareRobustCommand \ttfamily } + { + \exp_not:N \fontencoding { \g__fontspec_nfss_enc_tl } + \exp_not:N \fontfamily { \l__fontspec_ttfamily_family_tl } + \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_x:nnT {\familydefault} {\ttdefault} + { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl } + \__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 { \l__fontspec_nfss_enc_tl } + \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_x:nnT {\familydefault} {\rmdefault} - { \tl_set_eq:NN \encodingdefault \l__fontspec_nfss_enc_tl } + { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl } \normalfont \ignorespaces } @@ -33,14 +96,14 @@ \tl_set_eq:NN \sfdefault \g__fontspec_sffamily_family \use:x { \exp_not:n { \DeclareRobustCommand \sffamily } { - \exp_not:N \fontencoding { \l__fontspec_nfss_enc_tl } + \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_x:nnT {\familydefault} {\sfdefault} - { \tl_set_eq:NN \encodingdefault \l__fontspec_nfss_enc_tl } + { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl } \normalfont \ignorespaces } @@ -50,14 +113,14 @@ \tl_set_eq:NN \ttdefault \g__fontspec_ttfamily_family \use:x { \exp_not:n { \DeclareRobustCommand \ttfamily } { - \exp_not:N \fontencoding { \l__fontspec_nfss_enc_tl } + \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_x:nnT {\familydefault} {\ttdefault} - { \tl_set_eq:NN \encodingdefault \l__fontspec_nfss_enc_tl } + { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl } \normalfont \ignorespaces } |