diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty | 84 |
1 files changed, 41 insertions, 43 deletions
diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty b/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty index e456b46917b..264240aec4c 100644 --- a/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty +++ b/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty @@ -41,7 +41,7 @@ \RequirePackage{xparse} \ProvidesExplPackage{fontspec-luatex}% - {2019/01/24}{2.7}{Font selection for XeLaTeX and LuaLaTeX} + {2019/01/25}{2.7a}{Font selection for XeLaTeX and LuaLaTeX} %%^^A%% fontspec-code-load.dtx -- part of FONTSPEC <wspr.io/fontspec> %%^^A%% fontspec-code-vars.dtx -- part of FONTSPEC <wspr.io/fontspec> @@ -498,6 +498,10 @@ { \int_set:Nn #1 { \__dim_eval:w #2 #1 \__dim_eval_end: } } +\cs_set:Npn \__fontspec_lua_function:ne #1#2 { \lua_now:e { fontspec.#1 ("#2") } } +\cs_set:Npn \__fontspec_lua_function:nee #1#2#3 { \lua_now:e { fontspec.#1 ("#2","#3") } } +\cs_set:Npn \__fontspec_lua_function:neee #1#2#3#4 { \lua_now:e { fontspec.#1 ("#2","#3","#4") } } +\cs_set:Npn \__fontspec_lua_function:neeee #1#2#3#4#5 { \lua_now:e { fontspec.#1 ("#2","#3","#4","#5") } } \cs_generate_variant:Nn \int_set:Nn {Nv} \cs_generate_variant:Nn \keys_set:nn {nx} \cs_generate_variant:Nn \keys_set_known:nnN {nx} @@ -1860,7 +1864,7 @@ \cs_if_eq:NNTF #1 \font { \tl_set:Nx \l__fontspec_tmp_tl {\curr@fontshape/\f@size} } { \tl_set:Nx \l__fontspec_tmp_tl {\cs_to_str:N #1} } - \directlua{fontspec.check_ot_script("\l__fontspec_tmp_tl", "#2")} + \lua_now:e { fontspec.check_ot_script("\l__fontspec_tmp_tl", "#2") } \bool_if:NTF \l__fontspec_check_bool { \prg_return_true: @@ -1888,10 +1892,7 @@ \cs_if_eq:NNTF #1 \font { \tl_set:Nx \l__fontspec_tmp_tl {\curr@fontshape/\f@size} } { \tl_set:Nx \l__fontspec_tmp_tl {\cs_to_str:N #1} } - \directlua - { - fontspec.check_ot_lang( "\l__fontspec_tmp_tl", "#2", "#3" ) - } + \__fontspec_lua_function:neee {check_ot_lang} {\l__fontspec_tmp_tl} {#2} {#3} \bool_if:NTF \l__fontspec_check_bool \prg_return_true: \prg_return_false: } } @@ -1915,10 +1916,7 @@ \cs_if_eq:NNTF #1 \font { \tl_set:Nx \l__fontspec_tmp_tl {\curr@fontshape/\f@size} } { \tl_set:Nx \l__fontspec_tmp_tl {\cs_to_str:N #1} } - \directlua - { - fontspec.check_ot_feat("\l__fontspec_tmp_tl", "#2", "#3", "#4") - } + \__fontspec_lua_function:neeee {check_ot_feat} {\l__fontspec_tmp_tl} {#2} {#3} {#4} \bool_if:NTF \l__fontspec_check_bool \prg_return_true: \prg_return_false: } } @@ -2409,7 +2407,7 @@ \tl_put_right:Nn \l__fontspec_postadjust_tl { \__fontspec_primitive_font_set_hyphenchar:Nn \font { \l__fontspec_hyphenchar_tl } } } - { \__fontspec_error:nx {no-glyph}{\l_fontspec_fontname_tl}{#1} } + { \__fontspec_error:nxx {no-glyph}{\l_fontspec_fontname_tl}{#1} } } } @@ -2670,6 +2668,10 @@ \__fontspec_define_opentype_feature:nnnnn {Fractions} {Off} {frac} {-frac} {} \__fontspec_define_opentype_feature:nnnnn {Fractions} {Reset} {} {} {+frac,-frac} \__fontspec_define_opentype_onoffreset:nnnnn {Fractions} {Alternate} {afrc} {afrc} {-frac} +\__fontspec_define_opentype_feature_group:n {LocalForms} +\__fontspec_define_opentype_feature:nnnnn {LocalForms} {On} {locl} {+locl} {} +\__fontspec_define_opentype_feature:nnnnn {LocalForms} {Off} {locl} {-locl} {} +\__fontspec_define_opentype_feature:nnnnn {LocalForms} {Reset} {} {} {+locl,-locl} \__fontspec_define_opentype_feature_group:n {Style} \__fontspec_define_opentype_feature:nnnnn {Style} {ResetAll} {} {} @@ -2839,12 +2841,13 @@ \clist_map_break: } } + \bool_if:NF \l__fontspec_scriptlang_exist_bool { \bool_if:nF { \str_if_eq_p:ee {#1} {CustomDefault} } { \tl_clear:N \l__fontspec_script_name_tl - \__fontspec_warning:nx {no-script} {\l_fontspec_fontname_tl} {#1} + \__fontspec_warning:nxx {no-script} {\l_fontspec_fontname_tl} {#1} } \bool_if:nF @@ -3848,25 +3851,13 @@ %%^^A%% fontspec-code-patches.dtx -- part of FONTSPEC <wspr.io/fontspec> -\DeclareRobustCommand{\-} - { - \discretionary - { - \char\ifnum\hyphenchar\font<\z@ - \xlx@defaulthyphenchar - \else - \hyphenchar\font - \fi - }{}{} - } -\def\xlx@defaulthyphenchar{`\-} -\cs_new:Nn \fontspec_visible_space: +\cs_new_protected:Nn \fontspec_visible_space: { \__fontspec_primitive_font_glyph_if_exist:NnTF \font {"2423} { \char"2423\scan_stop: } { \fontspec_visible_space_fallback: } } -\cs_new:Nn \fontspec_visible_space_fallback: +\cs_new_protected:Nn \fontspec_visible_space_fallback: { { \usefont{\g_fontspec_encoding_tl}{lmtt}{\f@series}{\f@shape} @@ -3880,23 +3871,30 @@ \cs_set_eq:NN^^20\fontspec_visible_space:% }% \group_end: -\def\verb - { - \relax\ifmmode\hbox\else\leavevmode\null\fi - \bgroup - \verb@eol@error \let\do\@makeother \dospecials - \verbatim@font\@noligs - \@ifstar\__fontspecsverb\@verb - } -\def\__fontspecsverb{\fontspec_print_visible_spaces:\@sverb} \AtBeginDocument { - \fontspec_patch_verbatim: - \fontspec_patch_moreverb: - \fontspec_patch_fancyvrb: - \fontspec_patch_listings: + \cs_if_exist:NF \verbvisiblespace + { +\__fontspec_patch_verb: +\__fontspec_patch_verbatim: +\__fontspec_patch_moreverb: +\__fontspec_patch_fancyvrb: +\__fontspec_patch_listings: +} } -\cs_set:Npn \fontspec_patch_verbatim: +\cs_new_protected:Npn \__fontspec_patch_verb: + { +\def\verb +{ +\relax\ifmmode\hbox\else\leavevmode\null\fi +\bgroup +\verb@eol@error \let\do\@makeother \dospecials +\verbatim@font\@noligs +\@ifstar\__fontspecsverb\@verb +} +\def\__fontspecsverb{\fontspec_print_visible_spaces:\@sverb} +} +\cs_new_protected:Npn \__fontspec_patch_verbatim: { \@ifpackageloaded{verbatim} { @@ -3912,7 +3910,7 @@ } } } -\cs_set:Npn \fontspec_patch_moreverb: +\cs_new_protected:Npn \__fontspec_patch_moreverb: { \@ifpackageloaded{moreverb} { @@ -3927,14 +3925,14 @@ } }{} } -\cs_set:Npn \fontspec_patch_fancyvrb: +\cs_new_protected:Npn \__fontspec_patch_fancyvrb: { \@ifpackageloaded{fancyvrb} { \cs_set_eq:NN \FancyVerbSpace \fontspec_visible_space: }{} } -\cs_set:Npn \fontspec_patch_listings: +\cs_new_protected:Npn \__fontspec_patch_listings: { \@ifpackageloaded{listings} { |