From: Kazuki Maeda Date: Sat, 21 Jun 2014 04:34:30 +0000 (+0900) Subject: luatexja-fontspec: Syntax change: `\setmainjfont{font}[features]`. X-Git-Tag: 20140621.0~2^2 X-Git-Url: http://git.osdn.net/view?p=luatex-ja%2Fluatexja.git;a=commitdiff_plain;h=e98efd6fd10d3b4bde9458359222bd5c5f783d0c luatexja-fontspec: Syntax change: `\setmainjfont{font}[features]`. --- diff --git a/src/addons/luatexja-fontspec-24.sty b/src/addons/luatexja-fontspec-24.sty index 29f0ed5..4bd81c6 100644 --- a/src/addons/luatexja-fontspec-24.sty +++ b/src/addons/luatexja-fontspec-24.sty @@ -21,7 +21,7 @@ {\not@math@alphabet\ttfamily\mathtt \romanfamily\ttdefault\kanjifamily\jttdefault\selectfont} \DeclareDocumentCommand \setmonojfont { O{} m } { - \__ltj_fontspec_set_family:Nnn \jttdefault {#1}{#2} + \ltj_fontspec_set_family:Nnn \jttdefault {#1}{#2} \normalfont } }{ @@ -130,10 +130,12 @@ \group_end: } -\cs_new:Nn \__ltj_fontspec_set_family:Nnn { - \ltj_fontspec_select:nn{#2}{#3} - \tl_set_eq:NN #1 \l_fontspec_family_tl +\cs_new:Nn \ltj_fontspec_set_family:Nnn { + \cs_set_eq:NN \fontspec_select:nn \ltj_fontspec_select:nn + \__ltj_orig_fontspec_set_family:Nnn #1 {#2} {#3} + \cs_set_eq:NN \fontspec_select:nn \__ltj_orig_fontspec_select:nn } +\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 { @@ -186,36 +188,33 @@ } %%%%%%%% User commands -\DeclareDocumentCommand \jfontspec { O{} m } { - \__ltj_fontspec_set_family:Nnn \k@family {#1}{#2} +\DeclareDocumentCommand \jfontspec { O{} m O{} } { + \ltj_fontspec_set_family:Nnn \k@family {#1,#3}{#2} \selectfont \ignorespaces } -\DeclareDocumentCommand \setmainjfont { O{} m } { - \__ltj_fontspec_set_family:Nnn \mcdefault {#1}{#2} +\DeclareDocumentCommand \setmainjfont { O{} m O{} } { + \ltj_fontspec_set_family:Nnn \mcdefault {#1,#3}{#2} \DeclareSymbolFont{mincho}{JY3}{\l_fontspec_family_tl}{m}{n} \SetSymbolFont{mincho}{bold}{JY3}{\l_fontspec_family_tl}{bx}{n} \normalfont } -\DeclareDocumentCommand \setsansjfont { O{} m } { - \__ltj_fontspec_set_family:Nnn \gtdefault {#1}{#2} +\DeclareDocumentCommand \setsansjfont { O{} m O{} } { + \ltj_fontspec_set_family:Nnn \gtdefault {#1,#3}{#2} \DeclareMathAlphabet{\mathgt}{JY3}{\l_fontspec_family_tl}{m}{n} \normalfont } -\DeclareDocumentCommand \newjfontfamily { m O{} m } { - \ltj_fontspec_select:nn{#2}{#3} - \use:x { - \exp_not:N \DeclareRobustCommand \exp_not:N #1 { - \exp_not:N \kanjifamily {\l_fontspec_family_tl} \exp_not:N \selectfont - } - } +\DeclareDocumentCommand \newjfontfamily { m O{} m O{} } { + \cs_set_eq:NN \fontspec_set_family:Nnn \ltj_fontspec_set_family:Nnn + \newfontfamily #1 [#2] {#3} [#4] + \cs_set_eq:NN \fontspec_set_family:Nnn \__ltj_orig_fontspec_set_family:Nnn } -\DeclareDocumentCommand \newjfontface { m O{} m } { - \newjfontfamily #1 [ BoldFont={},ItalicFont={},SmallCapsFont={},#2 ] {#3} +\DeclareDocumentCommand \newjfontface { m O{} m O{} } { + \newjfontfamily #1 [ BoldFont={},ItalicFont={},SmallCapsFont={},#2,#4 ] {#3} } \clist_new:N \g__ltj_fontspec_default_fontopts_clist @@ -266,7 +265,6 @@ \cs_if_exist:cTF {g__fontspec_ \k@family _prop} \prg_return_true: \prg_return_false: } - %%% CJKShape=JIS2004 \__fontspec_define_feature_option:nnnnn{CJKShape}{JIS2004}{20}{5}{+jp04}