summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty')
-rw-r--r--Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty78
1 files changed, 44 insertions, 34 deletions
diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty b/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty
index bac3bf4cd66..a7ef1c9a9ec 100644
--- a/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty
+++ b/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.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-luatex}
- [2011/09/18 v2.2a Advanced font selection for XeLaTeX/LuaLaTeX]
+ [2012/05/06 v2.2b Advanced font selection for XeLaTeX/LuaLaTeX]
\ExplSyntaxOn
@@ -667,7 +667,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}
}
}
@@ -710,7 +710,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 }
{
@@ -894,8 +894,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 = {
@@ -1011,38 +1009,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}
}
@@ -1199,10 +1197,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 {
@@ -1211,8 +1210,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 }
}
}
}
@@ -1261,21 +1260,25 @@
},
FakeStretch .default:n = {1.2}
}
-\keys_define:nn {fontspec} { FakeBold .code:n = {
- \fontspec_update_fontid:n {+embolden:#1}
- \fontspec_update_featstr:n{embolden=#1}
- },
- FakeBold .default:n = {1.5}
-}
+\keys_define:nn {fontspec}
+ {
+ FakeBold .code:n = { \fontspec_warning:n {fakebold-only-xetex} }
+ }
\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
}
}
@@ -1284,13 +1287,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
}
}
@@ -1402,7 +1410,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
@@ -1413,7 +1422,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}
@@ -1957,8 +1967,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