diff options
Diffstat (limited to 'Master/texmf-dist/tex')
4 files changed, 246 insertions, 70 deletions
diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty b/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty index bec92bbe616..19f343fc5f4 100644 --- a/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty +++ b/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty @@ -22,6 +22,7 @@ %% fontspec-enc.dtx (with options: `fontspec,luatex') %% fontspec-math.dtx (with options: `fontspec,luatex') %% fontspec-closing.dtx (with options: `fontspec,luatex') +%% fontspec-xfss.dtx (with options: `fontspec,luatex') %% fontspec-patches.dtx (with options: `fontspec,luatex') %% ------------------------------------------------ %% The FONTSPEC package for XeLaTeX/LuaLaTeX @@ -31,7 +32,7 @@ \RequirePackage{expl3} \RequirePackage{xparse} \ProvidesExplPackage{fontspec-luatex}% - {2017/01/24}{2.5d}{Font selection for XeLaTeX and LuaLaTeX} + {2017/02/12}{2.6}{Font selection for XeLaTeX and LuaLaTeX} \bool_new:N \l__fontspec_firsttime_bool \bool_new:N \l__fontspec_nobf_bool \bool_new:N \l__fontspec_noit_bool @@ -56,12 +57,15 @@ \bool_new:N \l__fontspec_never_check_bool \bool_new:N \l__fontspec_defining_encoding_bool \bool_new:N \l__fontspec_script_exist_bool +\bool_new:N \g__fontspec_em_normalise_slant_bool \int_new:N \l__fontspec_script_int \int_new:N \l__fontspec_language_int \int_new:N \l__fontspec_strnum_int \int_new:N \l__fontspec_tmp_int \int_new:N \l__fontspec_em_int \int_new:N \l__fontspec_emdef_int +\int_new:N \l__fontspec_strong_int +\int_new:N \l__fontspec_strongdef_int \fp_new:N \l__fontspec_tmpa_fp \fp_new:N \l__fontspec_tmpb_fp \dim_new:N \l__fontspec_tmpa_dim @@ -102,6 +106,7 @@ \tl_new:N \l_fontspec_script_tl \tl_new:N \l__fontspec_lang_name_tl \tl_new:N \l_fontspec_lang_tl +\tl_new:N \l__fontspec_mapping_tl \tl_new:N \g__fontspec_hexcol_tl \tl_new:N \g__fontspec_opacity_tl \tl_set:Nn \g__fontspec_hexcol_tl {000000} @@ -642,20 +647,24 @@ { \keys_if_exist:nnF { fontspec / options } {#1} { \__fontspec_define_opentype_feature_group:n {#1} } + \keys_if_choice_exist:nnnT {fontspec} {#1} {#2} { \__fontspec_warning:nxx {feature-option-overwrite} {#1} {#2} } - \__fontspec_define_opentype_feature:nnn {#1}{#2}{#3} + + \exp_args:Nnnx \__fontspec_define_opentype_feature:nnnnn {#1}{#2}{ \__fontspec_strip_plus_minus:n {#3} }{#3}{} } + +\cs_new:Nn \__fontspec_strip_plus_minus:n { \__fontspec_strip_plus_minus_aux:Nq #1 \q_nil } +\cs_new:Npn \__fontspec_strip_plus_minus_aux:Nq #1#2 \q_nil + { \str_case:nnF {#1} { {+} {#2} {-} {#2} } {#1#2} } + \cs_set_eq:NN \newICUfeature \newopentypefeature % deprecated \DeclareDocumentCommand \aliasfontfeature {mm} { \bool_set_false:N \l__fontspec_alias_bool - \clist_map_inline:nn - { fontspec, fontspec-opentype, fontspec-aat, fontspec-preparse, fontspec-preparse-external, - fontspec-preparse-nested, fontspec-renderer } + \clist_map_inline:Nn \g__fontspec_all_keyval_modules_clist { - \keys_if_exist:nnT {##1} {#1} { \bool_set_true:N \l__fontspec_alias_bool @@ -673,16 +682,16 @@ \clist_map_inline:Nn \g__fontspec_all_keyval_modules_clist { - - \keys_if_exist:nnT {##1} {#1} + \keys_if_exist:nnT { ##1 / #1 } {#2} { \bool_set_true:N \l__fontspec_alias_bool - \keys_define:nn { ##1 / #1 } { #3 .meta:n = {#2} } + \keys_define:nn { ##1 / #1 } + { #3 .code:n = { \keys_set:nn {##1} { #1 = {#2} } } } } } \bool_if:NF \l__fontspec_alias_bool - { \__fontspec_warning:nx {rename-feature-not-exist} {#1} } + { \__fontspec_warning:nx {rename-feature-not-exist} {#1/#2} } } \DeclareDocumentCommand \newfontscript {mm} { @@ -1069,7 +1078,8 @@ } \cs_set:Nn \__fontspec_construct_font_call:nnnnnn { - " \__fontspec_fontname_wrap:n { #1 #2 #3 } #4 #5 + " \__fontspec_fontname_wrap:n { #1 #2 } #3 + #4 #5 \str_if_eq_x:nnF {#6}{} {:#6} " } \cs_set:Nn \__fontspec_construct_font_call:nn @@ -1088,7 +1098,7 @@ } \cs_new:Nn \__fontspec_font_is_file: { - \cs_set:Npn \__fontspec_fontname_wrap:n ##1 { file:\l__fontspec_font_path_tl ##1 } + \cs_set:Npn \__fontspec_fontname_wrap:n ##1 { [ \l__fontspec_font_path_tl ##1 ] } } \cs_new:Nn \__fontspec_set_scriptlang: { @@ -1126,7 +1136,10 @@ \__fontspec_keys_set_known:nxN {fontspec-renderer} {\l__fontspec_fontfeat_clist,#2} \l__fontspec_keys_leftover_clist \__fontspec_keys_set_known:nxN {fontspec} {\l__fontspec_keys_leftover_clist} \l__fontspec_keys_leftover_clist - \keys_set:nx {fontspec-opentype} {\l__fontspec_keys_leftover_clist} + \keys_set:nV {fontspec-opentype} \l__fontspec_keys_leftover_clist + + \tl_if_empty:NF \l__fontspec_mapping_tl + { \__fontspec_update_featstr:n { mapping = \l__fontspec_mapping_tl } } \str_if_eq_x:nnF { \l__fontspec_hexcol_tl \l__fontspec_opacity_tl } { \g__fontspec_hexcol_tl \g__fontspec_opacity_tl } @@ -1515,7 +1528,10 @@ \__fontspec_feat_prop_add:nn {#3} {#1\,=\,#2} \keys_define:nn {fontspec-opentype} { - #1/#2 .code:n = { \__fontspec_make_OT_feature:nnn {#3} {#4} {#5} } + #1/#2 .code:n = + { + \__fontspec_make_OT_feature:nnn {#3} {#4} {#5} + } } } \cs_new:Nn \__fontspec_feat_off:n {#1Off} @@ -1556,9 +1572,9 @@ } } \cs_generate_variant:Nn \__fontspec_make_OT_feature:nnn {xxx} -\cs_new:Nn \__fontspec_swap_plus_minus:n { \__fontspec_swap_plus_minus_aux:NNNNN #1 } -\cs_new:Nn \__fontspec_swap_plus_minus_aux:NNNNN - { \str_case:nn {#1} { {+} {-#2#3#4#5} {-} {+#2#3#4#5} } } +\cs_new:Nn \__fontspec_swap_plus_minus:n { \__fontspec_swap_plus_minus_aux:Nq #1 \q_nil } +\cs_new:Npn \__fontspec_swap_plus_minus_aux:Nq #1#2 \q_nil + { \str_case:nn {#1} { {+} {-#2} {-} {+#2} } } \prg_new_conditional:Nnn \__fontspec_check_script:n {TF} { \bool_if:NTF \l__fontspec_never_check_bool @@ -2121,7 +2137,7 @@ \int_to_hex:n { \l__fontspec_tmp_int } } } -\__fontspec_keys_define_code:nnn {fontspec} {Mapping} +\__fontspec_keys_define_code:nnn {fontspec-opentype} {Mapping} { \str_if_eq:nnTF {#1} {tex-text} { @@ -2207,7 +2223,11 @@ }, AutoFakeBold .default:n = {1.5} } -\__fontspec_keys_define_code:nnn {fontspec} {RawFeature} +\__fontspec_keys_define_code:nnn {fontspec-opentype} {RawFeature} + { + \__fontspec_update_featstr:n {#1} + } +\__fontspec_keys_define_code:nnn {fontspec-aat} {RawFeature} { \__fontspec_update_featstr:n {#1} } @@ -2258,8 +2278,9 @@ \__fontspec_define_opentype_onoffreset:nnnnn {Numbers} {Lowercase} {onum} {onum} {+lnum,-lnum} \__fontspec_define_opentype_onoffreset:nnnnn {Numbers} {Uppercase} {lnum} {lnum} {+onum,-onum} \__fontspec_define_opentype_onoffreset:nnnnn {Numbers} {SlashedZero} {zero} {zero} {} -\aliasfontfeatureoption {Numbers} {Lowercase} {OldStyle} -\aliasfontfeatureoption {Numbers} {Uppercase} {Lining} +\aliasfontfeatureoption {Numbers} {Monospaced} {Tabular} +\aliasfontfeatureoption {Numbers} {Lowercase} {OldStyle} +\aliasfontfeatureoption {Numbers} {Uppercase} {Lining} \__fontspec_define_opentype_onoffreset:nnnnn {Numbers} {Arabic} {anum} {anum} {} \__fontspec_define_opentype_feature_group:n {VerticalPosition} \__fontspec_define_opentype_feature:nnnnn {VerticalPosition} {ResetAll} {} {} @@ -3308,14 +3329,24 @@ } \cs_new_protected:Npn \emfontdeclare #1 { - \prop_clear:N \g__fontspec_em_prop - \int_zero:N \l__fontspec_emdef_int + \prop_clear:N \g__fontspec_em_prop + \int_zero:N \l__fontspec_emdef_int + \bool_set_true:N \g__fontspec_em_normalise_slant_bool + + \tl_if_in:nnT {#1} {\slshape} + { + \tl_if_in:nnT {#1} {\itshape} + { + \bool_set_false:N \g__fontspec_em_normalise_slant_bool + } + } + \group_begin: \normalfont \clist_map_inline:nn {\emreset,#1} { ##1 - \prop_gput_if_new:NxV \g__fontspec_em_prop { \f@series/\f@shape } { \l__fontspec_emdef_int } + \prop_gput_if_new:NxV \g__fontspec_em_prop { \f@shape } { \l__fontspec_emdef_int } \prop_gput:Nxn \g__fontspec_em_prop { switch-\int_use:N \l__fontspec_emdef_int } { ##1 } \int_incr:N \l__fontspec_emdef_int } @@ -3324,9 +3355,17 @@ \DeclareRobustCommand \em { \@nomath\em + \tl_set:Nx \l__fontspec_emshape_query_tl { \f@shape } - \prop_get:NxNT \g__fontspec_em_prop { \f@series/\f@shape } \l__fontspec_em_tmp_tl - { \int_set:Nn \l__fontspec_em_int { \l__fontspec_em_tmp_tl } } + \bool_if:NT \g__fontspec_em_normalise_slant_bool + { + \tl_replace_all:Nnn \l__fontspec_emshape_query_tl {/sl} {/it} + } + + \prop_get:NxNT \g__fontspec_em_prop { \l__fontspec_emshape_query_tl } \l__fontspec_em_tmp_tl + { + \int_set:Nn \l__fontspec_em_int { \l__fontspec_em_tmp_tl } + } \int_incr:N \l__fontspec_em_int @@ -3342,9 +3381,53 @@ \cs_set:Npn \emreset { \upshape } \cs_set:Npn \emshape { \itshape } \cs_set:Npn \eminnershape { \upshape } +\cs_new_protected:Npn \strongfontdeclare #1 + { + \prop_clear:N \g__fontspec_strong_prop + \int_zero:N \l__fontspec_strongdef_int + + \group_begin: + \normalfont + \clist_map_inline:nn {\strongreset,#1} + { + ##1 + \prop_gput_if_new:NxV \g__fontspec_strong_prop { \f@series } { \l__fontspec_strongdef_int } + \prop_gput:Nxn \g__fontspec_strong_prop { switch-\int_use:N \l__fontspec_strongdef_int } { ##1 } + \int_incr:N \l__fontspec_strongdef_int + } + \group_end: + } +\DeclareRobustCommand \strongenv + { + \@nomath\strongenv + + \prop_get:NxNT \g__fontspec_strong_prop { \f@series } \l__fontspec_strong_tmp_tl + { + \int_set:Nn \l__fontspec_strong_int { \l__fontspec_strong_tmp_tl } + } + + \int_incr:N \l__fontspec_strong_int + + \prop_get:NxNTF \g__fontspec_strong_prop { switch-\int_use:N \l__fontspec_strong_int } \l__fontspec_strong_switch_tl + { \l__fontspec_strong_switch_tl } + { + \int_zero:N \l__fontspec_strong_int + \strongreset + } + + } +\DeclareTextFontCommand{\strong}{\strongenv} +\cs_set:Npn \strongreset {} +\cs_set:Npn \reset@font + { + \normalfont + \int_zero:N \l__fontspec_em_int + \int_zero:N \l__fontspec_strong_int + } +\cs_new:Nn \fontspec_set_em_level:n { \int_set:Nn \l__fontspec_em_int {#1} } +\cs_new:Nn \fontspec_set_strong_level:n { \int_set:Nn \l__fontspec_strong_int {#1} } +\strongfontdeclare{ \bfseries } \emfontdeclare{ \emshape, \eminnershape } -\cs_set:Npn \reset@font { \normalfont \int_zero:N \l__fontspec_em_int } -\cs_new:Nn \fontspec_set_em_level:n { \int_set:Nn \l__fontspec_em_int {#1} } \DeclareRobustCommand{\-} { \discretionary @@ -3446,7 +3529,7 @@ { \addfontfeature{Numbers=Lining} #1 } } %% ------------------------------------------------ -%% Copyright 2004--2017 Will Robertson <wspr81@gmail.com> +%% Copyright 2004--2017 Will Robertson <will.robertson@latex-project.org> %% Copyright 2009--2013 Khaled Hosny <khaledhosny@eglug.org> %% %% Distributable under the LaTeX Project Public License, version 1.3c or higher. diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty b/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty index e5f6bb5454e..5162253dd0b 100644 --- a/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty +++ b/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty @@ -22,6 +22,7 @@ %% fontspec-enc.dtx (with options: `fontspec,xetexx') %% fontspec-math.dtx (with options: `fontspec,xetexx') %% fontspec-closing.dtx (with options: `fontspec,xetexx') +%% fontspec-xfss.dtx (with options: `fontspec,xetexx') %% fontspec-patches.dtx (with options: `fontspec,xetexx') %% ------------------------------------------------ %% The FONTSPEC package for XeLaTeX/LuaLaTeX @@ -31,7 +32,7 @@ \RequirePackage{expl3} \RequirePackage{xparse} \ProvidesExplPackage{fontspec-xetex}% - {2017/01/24}{2.5d}{Font selection for XeLaTeX and LuaLaTeX} + {2017/02/12}{2.6}{Font selection for XeLaTeX and LuaLaTeX} \bool_new:N \l__fontspec_firsttime_bool \bool_new:N \l__fontspec_nobf_bool \bool_new:N \l__fontspec_noit_bool @@ -56,12 +57,15 @@ \bool_new:N \l__fontspec_never_check_bool \bool_new:N \l__fontspec_defining_encoding_bool \bool_new:N \l__fontspec_script_exist_bool +\bool_new:N \g__fontspec_em_normalise_slant_bool \int_new:N \l__fontspec_script_int \int_new:N \l__fontspec_language_int \int_new:N \l__fontspec_strnum_int \int_new:N \l__fontspec_tmp_int \int_new:N \l__fontspec_em_int \int_new:N \l__fontspec_emdef_int +\int_new:N \l__fontspec_strong_int +\int_new:N \l__fontspec_strongdef_int \fp_new:N \l__fontspec_tmpa_fp \fp_new:N \l__fontspec_tmpb_fp \dim_new:N \l__fontspec_tmpa_dim @@ -102,6 +106,7 @@ \tl_new:N \l_fontspec_script_tl \tl_new:N \l__fontspec_lang_name_tl \tl_new:N \l_fontspec_lang_tl +\tl_new:N \l__fontspec_mapping_tl \tl_new:N \g__fontspec_hexcol_tl \tl_new:N \g__fontspec_opacity_tl \tl_set:Nn \g__fontspec_hexcol_tl {000000} @@ -639,20 +644,24 @@ { \keys_if_exist:nnF { fontspec / options } {#1} { \__fontspec_define_opentype_feature_group:n {#1} } + \keys_if_choice_exist:nnnT {fontspec} {#1} {#2} { \__fontspec_warning:nxx {feature-option-overwrite} {#1} {#2} } - \__fontspec_define_opentype_feature:nnn {#1}{#2}{#3} + + \exp_args:Nnnx \__fontspec_define_opentype_feature:nnnnn {#1}{#2}{ \__fontspec_strip_plus_minus:n {#3} }{#3}{} } + +\cs_new:Nn \__fontspec_strip_plus_minus:n { \__fontspec_strip_plus_minus_aux:Nq #1 \q_nil } +\cs_new:Npn \__fontspec_strip_plus_minus_aux:Nq #1#2 \q_nil + { \str_case:nnF {#1} { {+} {#2} {-} {#2} } {#1#2} } + \cs_set_eq:NN \newICUfeature \newopentypefeature % deprecated \DeclareDocumentCommand \aliasfontfeature {mm} { \bool_set_false:N \l__fontspec_alias_bool - \clist_map_inline:nn - { fontspec, fontspec-opentype, fontspec-aat, fontspec-preparse, fontspec-preparse-external, - fontspec-preparse-nested, fontspec-renderer } + \clist_map_inline:Nn \g__fontspec_all_keyval_modules_clist { - \keys_if_exist:nnT {##1} {#1} { \bool_set_true:N \l__fontspec_alias_bool @@ -670,16 +679,16 @@ \clist_map_inline:Nn \g__fontspec_all_keyval_modules_clist { - - \keys_if_exist:nnT {##1} {#1} + \keys_if_exist:nnT { ##1 / #1 } {#2} { \bool_set_true:N \l__fontspec_alias_bool - \keys_define:nn { ##1 / #1 } { #3 .meta:n = {#2} } + \keys_define:nn { ##1 / #1 } + { #3 .code:n = { \keys_set:nn {##1} { #1 = {#2} } } } } } \bool_if:NF \l__fontspec_alias_bool - { \__fontspec_warning:nx {rename-feature-not-exist} {#1} } + { \__fontspec_warning:nx {rename-feature-not-exist} {#1/#2} } } \DeclareDocumentCommand \newfontscript {mm} { @@ -1065,7 +1074,8 @@ } \cs_set:Nn \__fontspec_construct_font_call:nnnnnn { - " \__fontspec_fontname_wrap:n { #1 #2 #3 } #4 #5 + " \__fontspec_fontname_wrap:n { #1 #2 #3 } + #4 #5 \str_if_eq_x:nnF {#6}{} {:#6} " } \cs_set:Nn \__fontspec_construct_font_call:nn @@ -1124,13 +1134,18 @@ \__fontspec_keys_set_known:nxN {fontspec} {\l__fontspec_keys_leftover_clist} \l__fontspec_keys_leftover_clist \bool_if:NTF \l__fontspec_ot_bool { - \keys_set:nx {fontspec-opentype} {\l__fontspec_keys_leftover_clist} + % \tracingall + \keys_set:nV {fontspec-opentype} \l__fontspec_keys_leftover_clist + % \EROROR } { \bool_if:NT \l__fontspec_atsui_bool - { \keys_set:nx {fontspec-aat} {\l__fontspec_keys_leftover_clist} } + { \keys_set:nV {fontspec-aat} \l__fontspec_keys_leftover_clist } } + \tl_if_empty:NF \l__fontspec_mapping_tl + { \__fontspec_update_featstr:n { mapping = \l__fontspec_mapping_tl } } + \str_if_eq_x:nnF { \l__fontspec_hexcol_tl \l__fontspec_opacity_tl } { \g__fontspec_hexcol_tl \g__fontspec_opacity_tl } { \__fontspec_update_featstr:n { color = \l__fontspec_hexcol_tl\l__fontspec_opacity_tl } } @@ -1546,7 +1561,10 @@ \__fontspec_feat_prop_add:nn {#3} {#1\,=\,#2} \keys_define:nn {fontspec-opentype} { - #1/#2 .code:n = { \__fontspec_make_OT_feature:nnn {#3} {#4} {#5} } + #1/#2 .code:n = + { + \__fontspec_make_OT_feature:nnn {#3} {#4} {#5} + } } } \cs_new:Nn \__fontspec_feat_off:n {#1Off} @@ -1587,9 +1605,9 @@ } } \cs_generate_variant:Nn \__fontspec_make_OT_feature:nnn {xxx} -\cs_new:Nn \__fontspec_swap_plus_minus:n { \__fontspec_swap_plus_minus_aux:NNNNN #1 } -\cs_new:Nn \__fontspec_swap_plus_minus_aux:NNNNN - { \str_case:nn {#1} { {+} {-#2#3#4#5} {-} {+#2#3#4#5} } } +\cs_new:Nn \__fontspec_swap_plus_minus:n { \__fontspec_swap_plus_minus_aux:Nq #1 \q_nil } +\cs_new:Npn \__fontspec_swap_plus_minus_aux:Nq #1#2 \q_nil + { \str_case:nn {#1} { {+} {-#2} {-} {+#2} } } \prg_new_conditional:Nnn \__fontspec_check_script:n {TF} { \bool_if:NTF \l__fontspec_never_check_bool @@ -2240,10 +2258,14 @@ \int_to_hex:n { \l__fontspec_tmp_int } } } -\__fontspec_keys_define_code:nnn {fontspec} {Mapping} - { - \__fontspec_update_featstr:n { mapping = #1 } - } +\__fontspec_keys_define_code:nnn {fontspec-aat} {Mapping} + { + \tl_set:Nn \l__fontspec_mapping_tl { #1 } + } +\__fontspec_keys_define_code:nnn {fontspec-opentype} {Mapping} + { + \tl_set:Nn \l__fontspec_mapping_tl { #1 } + } \__fontspec_keys_define_code:nnn {fontspec} {Weight} { \__fontspec_update_featstr:n{weight=#1} @@ -2338,7 +2360,11 @@ }, AutoFakeBold .default:n = {1.5} } -\__fontspec_keys_define_code:nnn {fontspec} {RawFeature} +\__fontspec_keys_define_code:nnn {fontspec-opentype} {RawFeature} + { + \__fontspec_update_featstr:n {#1} + } +\__fontspec_keys_define_code:nnn {fontspec-aat} {RawFeature} { \__fontspec_update_featstr:n {#1} } @@ -2360,7 +2386,11 @@ \__fontspec_define_opentype_onoffreset:nnnnn {Ligatures} {Discretionary} {dlig} {dlig} {} \__fontspec_define_opentype_onoffreset:nnnnn {Ligatures} {Contextual} {clig} {clig} {} \__fontspec_define_opentype_onoffreset:nnnnn {Ligatures} {Historic} {hlig} {hlig} {} -\__fontspec_define_opentype_onreset:nnnnn {Ligatures} {TeX} {} { mapping = tex-text } {} +\keys_define:nn {fontspec-opentype} + { + Ligatures / TeX .code:n = { \tl_set:Nn \l__fontspec_mapping_tl {tex-text} }, + Ligatures / TeXReset .code:n = { \tl_clear:N \l__fontspec_mapping_tl }, + } \__fontspec_define_opentype_feature_group:n {Letters} \__fontspec_define_opentype_feature:nnnnn {Letters} {ResetAll} {} {} { @@ -2389,8 +2419,9 @@ \__fontspec_define_opentype_onoffreset:nnnnn {Numbers} {Lowercase} {onum} {onum} {+lnum,-lnum} \__fontspec_define_opentype_onoffreset:nnnnn {Numbers} {Uppercase} {lnum} {lnum} {+onum,-onum} \__fontspec_define_opentype_onoffreset:nnnnn {Numbers} {SlashedZero} {zero} {zero} {} -\aliasfontfeatureoption {Numbers} {Lowercase} {OldStyle} -\aliasfontfeatureoption {Numbers} {Uppercase} {Lining} +\aliasfontfeatureoption {Numbers} {Monospaced} {Tabular} +\aliasfontfeatureoption {Numbers} {Lowercase} {OldStyle} +\aliasfontfeatureoption {Numbers} {Uppercase} {Lining} \__fontspec_define_opentype_feature_group:n {VerticalPosition} \__fontspec_define_opentype_feature:nnnnn {VerticalPosition} {ResetAll} {} {} { @@ -3179,7 +3210,7 @@ { Ligatures / TeX .code:n = { - \__fontspec_update_featstr:n { mapping = tex-text } + \tl_set:Nn \l__fontspec_mapping_tl { tex-text } } } \__fontspec_define_aat_feature_group:n {Letters} @@ -3574,14 +3605,24 @@ } \cs_new_protected:Npn \emfontdeclare #1 { - \prop_clear:N \g__fontspec_em_prop - \int_zero:N \l__fontspec_emdef_int + \prop_clear:N \g__fontspec_em_prop + \int_zero:N \l__fontspec_emdef_int + \bool_set_true:N \g__fontspec_em_normalise_slant_bool + + \tl_if_in:nnT {#1} {\slshape} + { + \tl_if_in:nnT {#1} {\itshape} + { + \bool_set_false:N \g__fontspec_em_normalise_slant_bool + } + } + \group_begin: \normalfont \clist_map_inline:nn {\emreset,#1} { ##1 - \prop_gput_if_new:NxV \g__fontspec_em_prop { \f@series/\f@shape } { \l__fontspec_emdef_int } + \prop_gput_if_new:NxV \g__fontspec_em_prop { \f@shape } { \l__fontspec_emdef_int } \prop_gput:Nxn \g__fontspec_em_prop { switch-\int_use:N \l__fontspec_emdef_int } { ##1 } \int_incr:N \l__fontspec_emdef_int } @@ -3590,9 +3631,17 @@ \DeclareRobustCommand \em { \@nomath\em + \tl_set:Nx \l__fontspec_emshape_query_tl { \f@shape } - \prop_get:NxNT \g__fontspec_em_prop { \f@series/\f@shape } \l__fontspec_em_tmp_tl - { \int_set:Nn \l__fontspec_em_int { \l__fontspec_em_tmp_tl } } + \bool_if:NT \g__fontspec_em_normalise_slant_bool + { + \tl_replace_all:Nnn \l__fontspec_emshape_query_tl {/sl} {/it} + } + + \prop_get:NxNT \g__fontspec_em_prop { \l__fontspec_emshape_query_tl } \l__fontspec_em_tmp_tl + { + \int_set:Nn \l__fontspec_em_int { \l__fontspec_em_tmp_tl } + } \int_incr:N \l__fontspec_em_int @@ -3608,9 +3657,53 @@ \cs_set:Npn \emreset { \upshape } \cs_set:Npn \emshape { \itshape } \cs_set:Npn \eminnershape { \upshape } +\cs_new_protected:Npn \strongfontdeclare #1 + { + \prop_clear:N \g__fontspec_strong_prop + \int_zero:N \l__fontspec_strongdef_int + + \group_begin: + \normalfont + \clist_map_inline:nn {\strongreset,#1} + { + ##1 + \prop_gput_if_new:NxV \g__fontspec_strong_prop { \f@series } { \l__fontspec_strongdef_int } + \prop_gput:Nxn \g__fontspec_strong_prop { switch-\int_use:N \l__fontspec_strongdef_int } { ##1 } + \int_incr:N \l__fontspec_strongdef_int + } + \group_end: + } +\DeclareRobustCommand \strongenv + { + \@nomath\strongenv + + \prop_get:NxNT \g__fontspec_strong_prop { \f@series } \l__fontspec_strong_tmp_tl + { + \int_set:Nn \l__fontspec_strong_int { \l__fontspec_strong_tmp_tl } + } + + \int_incr:N \l__fontspec_strong_int + + \prop_get:NxNTF \g__fontspec_strong_prop { switch-\int_use:N \l__fontspec_strong_int } \l__fontspec_strong_switch_tl + { \l__fontspec_strong_switch_tl } + { + \int_zero:N \l__fontspec_strong_int + \strongreset + } + + } +\DeclareTextFontCommand{\strong}{\strongenv} +\cs_set:Npn \strongreset {} +\cs_set:Npn \reset@font + { + \normalfont + \int_zero:N \l__fontspec_em_int + \int_zero:N \l__fontspec_strong_int + } +\cs_new:Nn \fontspec_set_em_level:n { \int_set:Nn \l__fontspec_em_int {#1} } +\cs_new:Nn \fontspec_set_strong_level:n { \int_set:Nn \l__fontspec_strong_int {#1} } +\strongfontdeclare{ \bfseries } \emfontdeclare{ \emshape, \eminnershape } -\cs_set:Npn \reset@font { \normalfont \int_zero:N \l__fontspec_em_int } -\cs_new:Nn \fontspec_set_em_level:n { \int_set:Nn \l__fontspec_em_int {#1} } \DeclareRobustCommand{\-} { \discretionary @@ -3712,7 +3805,7 @@ { \addfontfeature{Numbers=Lining} #1 } } %% ------------------------------------------------ -%% Copyright 2004--2017 Will Robertson <wspr81@gmail.com> +%% Copyright 2004--2017 Will Robertson <will.robertson@latex-project.org> %% Copyright 2009--2013 Khaled Hosny <khaledhosny@eglug.org> %% %% Distributable under the LaTeX Project Public License, version 1.3c or higher. diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec.lua b/Master/texmf-dist/tex/latex/fontspec/fontspec.lua index 9ab8febf070..771b29a7deb 100644 --- a/Master/texmf-dist/tex/latex/fontspec/fontspec.lua +++ b/Master/texmf-dist/tex/latex/fontspec/fontspec.lua @@ -4,6 +4,7 @@ -- -- The original source files were: -- +-- fontspec.dtx (with options: `lua') -- fontspec-lua.dtx (with options: `lua') -- ------------------------------------------------ -- The FONTSPEC package for XeLaTeX/LuaLaTeX @@ -14,14 +15,13 @@ fontspec = fontspec or {} local fontspec = fontspec fontspec.module = { name = "fontspec", - version = "2.5a", - date = "2016/02/01", - description = "Advanced font selection for LuaLaTeX.", + version = "2.6", + date = "2017/02/12", + description = "Font selection for XeLaTeX and LuaLaTeX", author = "Khaled Hosny, Philipp Gesang, Will Robertson", copyright = "Khaled Hosny, Philipp Gesang, Will Robertson", license = "LPPL" } - local err, warn, info, log = luatexbase.provides_module(fontspec.module) fontspec.log = log or (function (s) luatexbase.module_info("fontspec", s) end) fontspec.warning = warn or (function (s) luatexbase.module_warning("fontspec", s) end) @@ -71,7 +71,7 @@ function fontspec.mathfontdimen(fnt, str) end end -- ------------------------------------------------ --- Copyright 2004--2017 Will Robertson <wspr81@gmail.com> +-- Copyright 2004--2017 Will Robertson <will.robertson@latex-project.org> -- Copyright 2009--2013 Khaled Hosny <khaledhosny@eglug.org> -- -- Distributable under the LaTeX Project Public License, version 1.3c or higher. diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec.sty b/Master/texmf-dist/tex/latex/fontspec/fontspec.sty index 008b2b83f8b..7d29a5e6623 100644 --- a/Master/texmf-dist/tex/latex/fontspec/fontspec.sty +++ b/Master/texmf-dist/tex/latex/fontspec/fontspec.sty @@ -13,7 +13,7 @@ \RequirePackage{expl3} \RequirePackage{xparse} \ProvidesExplPackage{fontspec}% - {2017/01/24}{2.5d}{Font selection for XeLaTeX and LuaLaTeX} + {2017/02/12}{2.6}{Font selection for XeLaTeX and LuaLaTeX} \sys_if_engine_luatex:T { \RequirePackage{luaotfload} \directlua{require("fontspec")} @@ -27,7 +27,7 @@ } \msg_fatal:nn {fontspec} {cannot-use-pdftex} %% ------------------------------------------------ -%% Copyright 2004--2017 Will Robertson <wspr81@gmail.com> +%% Copyright 2004--2017 Will Robertson <will.robertson@latex-project.org> %% Copyright 2009--2013 Khaled Hosny <khaledhosny@eglug.org> %% %% Distributable under the LaTeX Project Public License, version 1.3c or higher. |