diff options
author | Karl Berry <karl@freefriends.org> | 2015-09-25 23:13:30 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-09-25 23:13:30 +0000 |
commit | 5a520fc41536ed6b179bfa9237a24a465b3bc4b2 (patch) | |
tree | 1917fd5596433ba5194a4f9c8a7a995625509471 /Master/texmf-dist/tex/latex/fontspec | |
parent | feeea4e7a34e9ad92bb1e94c5930fc2b5d50228c (diff) |
fontspec (25sep15)
git-svn-id: svn://tug.org/texlive/trunk@38461 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/fontspec')
5 files changed, 85 insertions, 83 deletions
diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty b/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty index 4d0d4aee3a3..12154849c38 100644 --- a/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty +++ b/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty @@ -14,7 +14,7 @@ %% %% \ProvidesPackage{fontspec-luatex} - [2015/07/22 v2.4d Font selection for XeLaTeX and LuaLaTeX] + [2015/09/24 v2.4e Font selection for XeLaTeX and LuaLaTeX] \ExplSyntaxOn @@ -240,28 +240,25 @@ \__fontspec_define_feature_option:nnnnn {#1}{#2}{}{}{#3} } \cs_set_eq:NN \newICUfeature \newopentypefeature % deprecated +\bool_new:N \l__fontspec_alias_bool \DeclareDocumentCommand \aliasfontfeature {mm} { + \bool_set_false:N \l__fontspec_alias_bool + \clist_map_inline:nn { fontspec, fontspec-preparse, fontspec-preparse-external, fontspec-preparse-nested, fontspec-renderer } { + \keys_if_exist:nnT {##1} {#1} { - \clist_map_break:n - { - \__fontspec_alias_font_feature:nnn {##1} {#1} {#2} - \use_none_delimit_by_q_nil:w - } + \bool_set_true:N \l__fontspec_alias_bool + \__fontspec_alias_font_feature:nnn {##1} {#1} {#2} } } - % this executes if no match was found: - \__fontspec_warning:nx {rename-feature-not-exist} {#1} - - % jump to here if a match: - \use_none:n - \q_nil + \bool_if:NF \l__fontspec_alias_bool + { \__fontspec_warning:nx {rename-feature-not-exist} {#1} } } \cs_set:Nn \__fontspec_alias_font_feature:nnn @@ -505,35 +502,36 @@ \tl_set_eq:NN #2 \l_fontspec_family_tl } \cs_set:Nn \__fontspec_fontwrap:n { "#1" } -\cs_if_free:NT \font_set_eq:NN - { - \cs_set_eq:NN \font_set_eq:NN \tex_let:D - \cs_set:Npn \font_set:Nnn #1#2#3 - { - \font #1 = #2 ~at~ #3\scan_stop: - } - \cs_set:Npn \font_gset:Nnn #1#2#3 - { +\cs_set:Npn \__fontspec_primitive_font_set:Nnn #1#2#3 + { + \font #1 = #2 ~at~ #3 \scan_stop: + } + +\cs_set:Npn \__fontspec_primitive_font_gset:Nnn #1#2#3 + { \global \font #1 = #2 ~at~ #3 \scan_stop: - } - \cs_set:Npn \font_suppress_not_found_error: - {\luatexsuppressfontnotfounderror=1} - \prg_set_conditional:Nnn \__fontspec_font_if_null:N {p,TF,T,F} - { + } + +\cs_set:Npn \__fontspec_font_suppress_not_found_error: + { + \int_set_eq:NN \xetex_suppressfontnotfounderror:D \c_one + } + +\prg_set_conditional:Nnn \__fontspec_font_if_null:N {p,TF,T,F} + { \ifx #1 \nullfont \prg_return_true: \else \prg_return_false: \fi - } - } + } \cs_new:Nn \__fontspec_font_set:Nnn { - \font_set:Nnn #1 {\__fontspec_fontwrap:n {#2}} {#3} + \__fontspec_primitive_font_set:Nnn #1 { \__fontspec_fontwrap:n {#2} } {#3} } \cs_new:Nn \__fontspec_font_gset:Nnn { - \font_gset:Nnn #1 {\__fontspec_fontwrap:n {#2}} {#3} + \__fontspec_primitive_font_gset:Nnn #1 { \__fontspec_fontwrap:n {#2} } {#3} } \prg_new_conditional:Nnn \font_glyph_if_exist:Nn {p,TF,T,F} { @@ -546,7 +544,7 @@ \cs_set:Nn \fontspec_select:nn { \group_begin: - \font_suppress_not_found_error: + \__fontspec_font_suppress_not_found_error: \__fontspec_init: \tl_set:Nx \l_fontspec_fontname_tl {#2} @@ -790,8 +788,9 @@ \cs_new:Nn \__fontspec_make_font_shapes:Nnnnn { \group_begin: + \keys_set_known:nxN {fontspec-preparse-external} { #4 } \l__fontspec_leftover_clist \__fontspec_load_fontname:n {#1} - \__fontspec_declare_shape:nnxx {#2} {#3} { \l__fontspec_fontopts_clist, #4 } {#5} + \__fontspec_declare_shape:nnxx {#2} {#3} { \l__fontspec_fontopts_clist, \l__fontspec_leftover_clist } {#5} \group_end: } @@ -1011,10 +1010,10 @@ }{} \tl_set:Nn \l_fontspec_mode_tl {node} - \luatexprehyphenchar =`\- % fixme - \luatexposthyphenchar = 0 % fixme - \luatexpreexhyphenchar = 0 % fixme - \luatexpostexhyphenchar= 0 % fixme + \int_set:Nn \luatex_prehyphenchar:D { `\- } % fixme + \int_zero:N \luatex_posthyphenchar:D % fixme + \int_zero:N \luatex_preexhyphenchar:D % fixme + \int_zero:N \luatex_postexhyphenchar:D % fixme } \cs_set:Nn \fontspec_make_ot_smallcaps:TF { @@ -1177,7 +1176,7 @@ \bool_set_true:N \l__fontspec_nobf_bool \bool_set_true:N \l__fontspec_noit_bool \bool_set_true:N \l__fontspec_external_bool - \cs_gset:Npn \__fontspec_namewrap:n ##1 { [ #1 ##1 ] } + \cs_set:Npn \__fontspec_namewrap:n ##1 { [ #1 ##1 ] } } \aliasfontfeature{ExternalLocation}{Path} \__fontspec_keys_define_code:nnn {fontspec-preparse-external} {Extension} @@ -1369,7 +1368,6 @@ \tl_if_exist:NT \l_fontspec_family_tl { \cs_undefine:c {g__fontspec_ \l_fontspec_family_tl _prop} } } -\cs_generate_variant:Nn \prop_put:Nnn {Nxx} \prop_new:N \l__fontspec_nfssfont_prop \__fontspec_keys_define_code:nnn {fontspec} {FontFace} { @@ -1404,7 +1402,6 @@ } \cs_generate_variant:Nn \__fontspec_add_nfssfont:nnnn {ooo} \cs_generate_variant:Nn \__fontspec_add_nfssfont:nnnn {oooo} -\cs_generate_variant:Nn \tl_if_empty:nTF {x} \__fontspec_keys_define_code:nnn {fontspec} {Scale} { \str_case:nnF {#1} @@ -1514,7 +1511,7 @@ \tl_put_right:Nn \l__fontspec_postadjust_tl { \hyphenchar \font = \c_zero - \luatexprehyphenchar = \l_fontspec_hyphenchar_tl \scan_stop: + \int_set:Nn \luatex_prehyphenchar:D { \l_fontspec_hyphenchar_tl } } } { \__fontspec_error:nx {no-glyph}{#1} } diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec-patches.sty b/Master/texmf-dist/tex/latex/fontspec/fontspec-patches.sty index a7acbf1edf7..dc8ff1fe51d 100644 --- a/Master/texmf-dist/tex/latex/fontspec/fontspec-patches.sty +++ b/Master/texmf-dist/tex/latex/fontspec/fontspec-patches.sty @@ -14,7 +14,7 @@ %% %% \ProvidesPackage{fontspec-patches} - [2015/07/22 v2.4d Font selection for XeLaTeX and LuaLaTeX] + [2015/09/24 v2.4e Font selection for XeLaTeX and LuaLaTeX] \ExplSyntaxOn diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty b/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty index 623441ec477..f1815624afc 100644 --- a/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty +++ b/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty @@ -14,7 +14,7 @@ %% %% \ProvidesPackage{fontspec-xetex} - [2015/07/22 v2.4d Font selection for XeLaTeX and LuaLaTeX] + [2015/09/24 v2.4e Font selection for XeLaTeX and LuaLaTeX] \ExplSyntaxOn @@ -236,28 +236,25 @@ \__fontspec_define_feature_option:nnnnn {#1}{#2}{}{}{#3} } \cs_set_eq:NN \newICUfeature \newopentypefeature % deprecated +\bool_new:N \l__fontspec_alias_bool \DeclareDocumentCommand \aliasfontfeature {mm} { + \bool_set_false:N \l__fontspec_alias_bool + \clist_map_inline:nn { fontspec, fontspec-preparse, fontspec-preparse-external, fontspec-preparse-nested, fontspec-renderer } { + \keys_if_exist:nnT {##1} {#1} { - \clist_map_break:n - { - \__fontspec_alias_font_feature:nnn {##1} {#1} {#2} - \use_none_delimit_by_q_nil:w - } + \bool_set_true:N \l__fontspec_alias_bool + \__fontspec_alias_font_feature:nnn {##1} {#1} {#2} } } - % this executes if no match was found: - \__fontspec_warning:nx {rename-feature-not-exist} {#1} - - % jump to here if a match: - \use_none:n - \q_nil + \bool_if:NF \l__fontspec_alias_bool + { \__fontspec_warning:nx {rename-feature-not-exist} {#1} } } \cs_set:Nn \__fontspec_alias_font_feature:nnn @@ -501,35 +498,36 @@ \tl_set_eq:NN #2 \l_fontspec_family_tl } \cs_set:Nn \__fontspec_fontwrap:n { "#1" } -\cs_if_free:NT \font_set_eq:NN - { - \cs_set_eq:NN \font_set_eq:NN \tex_let:D - \cs_set:Npn \font_set:Nnn #1#2#3 - { - \font #1 = #2 ~at~ #3\scan_stop: - } - \cs_set:Npn \font_gset:Nnn #1#2#3 - { +\cs_set:Npn \__fontspec_primitive_font_set:Nnn #1#2#3 + { + \font #1 = #2 ~at~ #3 \scan_stop: + } + +\cs_set:Npn \__fontspec_primitive_font_gset:Nnn #1#2#3 + { \global \font #1 = #2 ~at~ #3 \scan_stop: - } - \cs_set:Npn \font_suppress_not_found_error: - {\suppressfontnotfounderror=1} - \prg_set_conditional:Nnn \__fontspec_font_if_null:N {p,TF,T,F} - { + } + +\cs_set:Npn \__fontspec_font_suppress_not_found_error: + { + \int_set_eq:NN \xetex_suppressfontnotfounderror:D \c_one + } + +\prg_set_conditional:Nnn \__fontspec_font_if_null:N {p,TF,T,F} + { \ifx #1 \nullfont \prg_return_true: \else \prg_return_false: \fi - } - } + } \cs_new:Nn \__fontspec_font_set:Nnn { - \font_set:Nnn #1 {\__fontspec_fontwrap:n {#2}} {#3} + \__fontspec_primitive_font_set:Nnn #1 { \__fontspec_fontwrap:n {#2} } {#3} } \cs_new:Nn \__fontspec_font_gset:Nnn { - \font_gset:Nnn #1 {\__fontspec_fontwrap:n {#2}} {#3} + \__fontspec_primitive_font_gset:Nnn #1 { \__fontspec_fontwrap:n {#2} } {#3} } \prg_new_conditional:Nnn \font_glyph_if_exist:Nn {p,TF,T,F} { @@ -542,7 +540,7 @@ \cs_set:Nn \fontspec_select:nn { \group_begin: - \font_suppress_not_found_error: + \__fontspec_font_suppress_not_found_error: \__fontspec_init: \tl_set:Nx \l_fontspec_fontname_tl {#2} @@ -809,8 +807,9 @@ \cs_new:Nn \__fontspec_make_font_shapes:Nnnnn { \group_begin: + \keys_set_known:nxN {fontspec-preparse-external} { #4 } \l__fontspec_leftover_clist \__fontspec_load_fontname:n {#1} - \__fontspec_declare_shape:nnxx {#2} {#3} { \l__fontspec_fontopts_clist, #4 } {#5} + \__fontspec_declare_shape:nnxx {#2} {#3} { \l__fontspec_fontopts_clist, \l__fontspec_leftover_clist } {#5} \group_end: } @@ -1242,7 +1241,7 @@ \bool_set_true:N \l__fontspec_nobf_bool \bool_set_true:N \l__fontspec_noit_bool \bool_set_true:N \l__fontspec_external_bool - \cs_gset:Npn \__fontspec_namewrap:n ##1 { [ #1 ##1 ] } + \cs_set:Npn \__fontspec_namewrap:n ##1 { [ #1 ##1 ] } \keys_set:nn {fontspec-renderer} {Renderer=OpenType} } \aliasfontfeature{ExternalLocation}{Path} @@ -1436,7 +1435,6 @@ \tl_if_exist:NT \l_fontspec_family_tl { \cs_undefine:c {g__fontspec_ \l_fontspec_family_tl _prop} } } -\cs_generate_variant:Nn \prop_put:Nnn {Nxx} \prop_new:N \l__fontspec_nfssfont_prop \__fontspec_keys_define_code:nnn {fontspec} {FontFace} { @@ -1471,7 +1469,6 @@ } \cs_generate_variant:Nn \__fontspec_add_nfssfont:nnnn {ooo} \cs_generate_variant:Nn \__fontspec_add_nfssfont:nnnn {oooo} -\cs_generate_variant:Nn \tl_if_empty:nTF {x} \__fontspec_keys_define_code:nnn {fontspec} {Scale} { \str_case:nnF {#1} diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec.lua b/Master/texmf-dist/tex/latex/fontspec/fontspec.lua index ea7802ee184..f5c17fd02b5 100644 --- a/Master/texmf-dist/tex/latex/fontspec/fontspec.lua +++ b/Master/texmf-dist/tex/latex/fontspec/fontspec.lua @@ -29,12 +29,17 @@ fontspec.module = { local err, warn, info, log = luatexbase.provides_module(fontspec.module) -fontspec.log = log -fontspec.warning = warn -fontspec.error = err +fontspec.log = log or (function (s) luatexbase.module_info("fontspec", s) end) +fontspec.warning = warn or (function (s) luatexbase.module_warning("fontspec", s) end) +fontspec.error = err or (function (s) luatexbase.module_error("fontspec", s) end) +if luatexbase.catcodetables == nil then + latexpackage_catcodetable=luatexbase.registernumber("catcodetable@atletter") +else + latexpackage_catcodetable=luatexbase.catcodetables['latex-package'] +end function fontspec.sprint (...) - tex.sprint(luatexbase.catcodetables['latex-package'], ...) + tex.sprint(latexpackage_catcodetable, ...) end local check_script = luaotfload.aux.provides_script local check_language = luaotfload.aux.provides_language diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec.sty b/Master/texmf-dist/tex/latex/fontspec/fontspec.sty index 26b78761823..8f7489564a4 100644 --- a/Master/texmf-dist/tex/latex/fontspec/fontspec.sty +++ b/Master/texmf-dist/tex/latex/fontspec/fontspec.sty @@ -14,10 +14,10 @@ %% %% \ProvidesPackage{fontspec} - [2015/07/22 v2.4d Font selection for XeLaTeX and LuaLaTeX] + [2015/09/24 v2.4e Font selection for XeLaTeX and LuaLaTeX] -\RequirePackage{expl3}[2011/09/05] +\RequirePackage{expl3}[2015/06/26] \RequirePackage{xparse} \ExplSyntaxOn \cs_if_exist:NF \lua_now_x:n @@ -35,7 +35,7 @@ \luatex_if_engine:TF { \RequirePackage{luaotfload}[2013/05/20] - \RequireLuaModule{fontspec} + \directlua{require("fontspec")} } { \msg_fatal:nn {fontspec} {cannot-use-pdftex} @@ -70,6 +70,9 @@ \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} +\cs_generate_variant:Nn \tl_if_empty:nTF {x} +\cs_generate_variant:Nn \tl_if_empty:nTF {x} +\cs_generate_variant:Nn \prop_put:Nnn {Nxx} \cs_new:Nn \__fontspec_int_mult_truncate:Nn { \int_set:Nn #1 { \__dim_eval:w #2 #1 \__dim_eval_end: } |