{\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
}
}{
\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 {
}
%%%%%%%% 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
\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}