diff options
author | Karl Berry <karl@freefriends.org> | 2012-05-06 23:12:26 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-05-06 23:12:26 +0000 |
commit | d9a4092da5a0568ae5fa57b80e8f3e2243547a22 (patch) | |
tree | 2da08b9f459e3dadccac8fc3ad70ef2ea65b96e7 /Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty | |
parent | ec4155a8b435806195767c2047ab6b3f9f2a1052 (diff) |
fontspec 2.2b (6may12)
git-svn-id: svn://tug.org/texlive/trunk@26230 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty | 68 |
1 files changed, 40 insertions, 28 deletions
diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty b/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty index b0fad28a8a8..701d5030093 100644 --- a/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty +++ b/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty @@ -8,13 +8,13 @@ %% %% _________________________________________ %% The fontspec package for XeLaTeX/LuaLaTeX -%% (C) 2004--2011 Will Robertson and Khaled Hosny +%% (C) 2004--2012 Will Robertson and Khaled Hosny %% %% License information appended. %% %% \ProvidesPackage{fontspec-xetex} - [2011/09/18 v2.2a Advanced font selection for XeLaTeX/LuaLaTeX] + [2012/05/06 v2.2b Advanced font selection for XeLaTeX/LuaLaTeX] \ExplSyntaxOn @@ -686,7 +686,7 @@ } { \use:x { - \exp_not:N \DeclareFontShape {\g_fontspec_encoding_tl}{\l_fontspec_family_tl}{#2}{\sldefault} + \exp_not:N \DeclareFontShape {\g_fontspec_encoding_tl}{\l_fontspec_family_tl}{#1}{\sldefault} {<->ssub*\l_fontspec_family_tl/#1/\itdefault}{\l_fontspec_postadjust_tl} } } @@ -730,7 +730,7 @@ \tl_set_eq:NN \l_fontspec_opacity_tl \g_fontspec_opacity_tl \tl_set_eq:NN \l_fontspec_hexcol_tl \g_fontspec_hexcol_tl \tl_clear:N \l_fontspec_postadjust_tl - \keys_set:nx {fontspec} {\l_fontspec_fontfeat_clist #1} + \keys_set:nx {fontspec} {\l_fontspec_fontfeat_clist, #1} \str_if_eq:xxF { \l_fontspec_hexcol_tl \l_fontspec_opacity_tl } { \g_fontspec_hexcol_tl \g_fontspec_opacity_tl } { @@ -960,8 +960,6 @@ } \if@tempswa \prg_return_true: \else: \prg_return_false: \fi: } -\cs_generate_variant:Nn \keys_set:nn {nx} -\cs_generate_variant:Nn \keys_set_known:nnN {nx} \bool_new:N \l_fontspec_external_bool \keys_define:nn {fontspec-preparse-external} { ExternalLocation .code:n = { @@ -1079,38 +1077,38 @@ } \cs_generate_variant:Nn \tl_replace_all:Nnn {Nnx} \keys_define:nn {fontspec-preparse} { UprightFeatures .code:n = { - \def\l_fontspec_fontfeat_up_clist{, #1} + \tl_set:Nn \l_fontspec_fontfeat_up_clist { , #1} \fontspec_update_fontid:n {rmfeat:#1} } } \keys_define:nn {fontspec-preparse} { BoldFeatures .code:n = { - \def\l_fontspec_fontfeat_bf_clist{, #1} + \tl_set:Nn \l_fontspec_fontfeat_bf_clist {, #1} \fontspec_update_fontid:n {bffeat:#1} } } \keys_define:nn {fontspec-preparse} { ItalicFeatures .code:n = { - \def\l_fontspec_fontfeat_it_clist{, #1} + \tl_set:Nn \l_fontspec_fontfeat_it_clist {, #1} \fontspec_update_fontid:n {itfeat:#1} } } \keys_define:nn {fontspec-preparse} { BoldItalicFeatures .code:n = { - \def\l_fontspec_fontfeat_bfit_clist{, #1} + \tl_set:Nn \l_fontspec_fontfeat_bfit_clist {, #1} \fontspec_update_fontid:n {bfitfeat:#1} } } \keys_define:nn {fontspec-preparse} { SlantedFeatures .code:n = { - \def\l_fontspec_fontfeat_sl_clist{, #1} + \tl_set:Nn \l_fontspec_fontfeat_sl_clist {, #1} \fontspec_update_fontid:n {slfeat:#1} } } \keys_define:nn {fontspec-preparse} { BoldSlantedFeatures .code:n = { - \def\l_fontspec_fontfeat_bfsl_clist{, #1} + \tl_set:Nn \l_fontspec_fontfeat_bfsl_clist {, #1} \fontspec_update_fontid:n {bfslfeat:#1} } } \keys_define:nn {fontspec} { SmallCapsFeatures .code:n = { \bool_if:NF \l_fontspec_firsttime_bool { - \def\l_fontspec_fontfeat_sc_clist{, #1} + \tl_set:Nn \l_fontspec_fontfeat_sc_clist {, #1} } \fontspec_update_fontid:n {scfeat:#1} } @@ -1264,10 +1262,11 @@ \tl_set:Nn \l_fontspec_opacity_tl {#7#8} } \aliasfontfeature{Color}{Colour} -\newcounter{fontspec_tmp_int} +\int_new:N \l_fontspec_tmp_int \keys_define:nn {fontspec} { Opacity .code:n = { \fontspec_update_fontid:n {+opac:#1} - \setcounter {fontspec_tmp_int} { 255*\real{#1} } + \int_set:Nn \l_fontspec_tmp_int {255} + \_int_mult_truncate:Nn \l_fontspec_tmp_int { #1 } \tl_if_eq:NNF \l_fontspec_opacity_tl \g_fontspec_opacity_tl { \bool_if:NF \l_fontspec_firsttime_bool { @@ -1276,8 +1275,8 @@ } \tl_set:Nx \l_fontspec_opacity_tl { - \int_compare:nT { \value{fontspec_tmp_int} <= "F } {0} % zero pad - \int_to_hexadecimal:n { \value{fontspec_tmp_int} } + \int_compare:nT { \l_fontspec_tmp_int <= "F } {0} % zero pad + \int_to_hexadecimal:n { \l_fontspec_tmp_int } } } } @@ -1341,13 +1340,19 @@ } \keys_define:nn {fontspec} { AutoFakeSlant .code:n = { \bool_if:NT \l_fontspec_firsttime_bool { + \tl_set:Nn \l_fontspec_fake_slant_tl {#1} - \clist_put_right:Nn \l_fontspec_fontfeat_it_clist {,FakeSlant=#1} + \clist_put_right:Nn \l_fontspec_fontfeat_it_clist {FakeSlant=#1} \tl_set_eq:NN \l_fontspec_fontname_it_tl \l_fontspec_fontname_tl + \bool_set_false:N \l_fontspec_noit_bool + \fontspec_update_fontid:n {fakeit:#1} - \tl_if_empty:NF \l_fontspec_fake_embolden_tl { - \tl_put_right:Nx \l_fontspec_fontfeat_bfit_clist - {,FakeBold=\l_fontspec_fake_embolden_tl,FakeSlant=#1} + + \tl_if_empty:NF \l_fontspec_fake_embolden_tl + { + \clist_put_right:Nx \l_fontspec_fontfeat_bfit_clist + {FakeBold=\l_fontspec_fake_embolden_tl} + \clist_put_right:Nx \l_fontspec_fontfeat_bfit_clist {FakeSlant=#1} \tl_set_eq:NN \l_fontspec_fontname_bfit_tl \l_fontspec_fontname_tl } } @@ -1356,13 +1361,18 @@ } \keys_define:nn {fontspec} { AutoFakeBold .code:n = { \bool_if:NT \l_fontspec_firsttime_bool { + \tl_set:Nn \l_fontspec_fake_embolden_tl {#1} - \tl_put_right:Nn \l_fontspec_fontfeat_bf_clist {,FakeBold=#1} + \clist_put_right:Nn \l_fontspec_fontfeat_bf_clist {FakeBold=#1} \tl_set_eq:NN \l_fontspec_fontname_bf_tl \l_fontspec_fontname_tl + \bool_set_false:N \l_fontspec_nobf_bool + \fontspec_update_fontid:n {fakebf:#1} + \tl_if_empty:NF \l_fontspec_fake_slant_tl { - \tl_put_right:Nx \l_fontspec_fontfeat_bfit_clist - {,FakeSlant=\l_fontspec_fake_slant_tl,FakeBold=#1} + \clist_put_right:Nx \l_fontspec_fontfeat_bfit_clist + {FakeSlant=\l_fontspec_fake_slant_tl} + \clist_put_right:Nx \l_fontspec_fontfeat_bfit_clist {FakeBold=#1} \tl_set_eq:NN \l_fontspec_fontname_bfit_tl \l_fontspec_fontname_tl } } @@ -1474,7 +1484,8 @@ Alternate .default:n = {0} , Alternate / unknown .code:n = { - \fontspec_make_feature:nnx {17}{#1} { \fontspec_salt:n {#1} } + \clist_map_inline:nn {#1} + { \fontspec_make_feature:nnx {17}{##1} { \fontspec_salt:n {##1} } } } } \cs_set:Nn \fontspec_salt:n @@ -1485,7 +1496,8 @@ Variant .default:n = {0} , Variant / unknown .code:n = { - \fontspec_make_feature:nnx {18}{#1} { +ss \two@digits {#1} } + \clist_map_inline:nn {#1} + { \fontspec_make_feature:nnx {18}{##1} { +ss \two@digits {##1} } } } } \aliasfontfeature{Variant}{StylisticSet} @@ -2029,8 +2041,8 @@ } \ExplSyntaxOff %% -%% Copyright 2004--2011 Will Robertson <wspr81@gmail.com> -%% Copyright 2009--2010 Khaled Hosny <khaledhosny@eglug.org> +%% Copyright 2004--2012 Will Robertson <wspr81@gmail.com> +%% Copyright 2009--2012 Khaled Hosny <khaledhosny@eglug.org> %% %% Distributable under the LaTeX Project Public License, %% version 1.3c or higher (your choice). The latest version of |