diff options
author | Karl Berry <karl@freefriends.org> | 2010-06-04 14:51:16 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-06-04 14:51:16 +0000 |
commit | 5951573660cc43025942d3e58fba2913a65315a9 (patch) | |
tree | 7140b9a8323327ab5a1d1dd71e94640a80377237 /Master/texmf-dist/tex | |
parent | 943f8e7dc659d590fba8306ac7de79aad7b25c3a (diff) |
fontspec 2.0b2 (2jun10)
git-svn-id: svn://tug.org/texlive/trunk@18727 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/fontspec/fontspec-patches.sty | 6 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/fontspec/fontspec.lua | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/fontspec/fontspec.sty | 133 |
3 files changed, 102 insertions, 41 deletions
diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec-patches.sty b/Master/texmf-dist/tex/latex/fontspec/fontspec-patches.sty index d40bb9cf370..5298ad11cc0 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} - [2010/05/27 v2.0b1 Advanced font selection for XeLaTeX/LuaLaTeX] + [2010/06/03 v2.0b2 Advanced font selection for XeLaTeX/LuaLaTeX] \ExplSyntaxOn \RequirePackage{fixltx2e}[2006/03/24] \DeclareRobustCommand \em { @@ -106,8 +106,8 @@ %% and the derived files fontspec.sty, %% fontspec.lua, %% fontspec.cfg, -%% fontspec.ins, -%% fontspec-example.ltx, +%% fontspec-xetex.tex, +%% fontspec-luatex.tex, %% and fontspec.pdf. %% %% diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec.lua b/Master/texmf-dist/tex/latex/fontspec/fontspec.lua index 05e28c2124a..c67d56c2702 100644 --- a/Master/texmf-dist/tex/latex/fontspec/fontspec.lua +++ b/Master/texmf-dist/tex/latex/fontspec/fontspec.lua @@ -199,8 +199,8 @@ end -- and the derived files fontspec.sty, -- fontspec.lua, -- fontspec.cfg, --- fontspec.ins, --- fontspec-example.ltx, +-- fontspec-xetex.tex, +-- fontspec-luatex.tex, -- and fontspec.pdf. -- -- diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec.sty b/Master/texmf-dist/tex/latex/fontspec/fontspec.sty index 677ae23b306..b129b935e05 100644 --- a/Master/texmf-dist/tex/latex/fontspec/fontspec.sty +++ b/Master/texmf-dist/tex/latex/fontspec/fontspec.sty @@ -14,12 +14,12 @@ %% %% \ProvidesPackage{fontspec} - [2010/05/27 v2.0b1 Advanced font selection for XeLaTeX/LuaLaTeX] + [2010/06/03 v2.0b2 Advanced font selection for XeLaTeX/LuaLaTeX] \RequirePackage{expl3,xparse} \ExplSyntaxOn \msg_new:nnn {fontspec} {not-pdftex} { - Requires XeTeX or LuaTeX to function! + Requires~ XeTeX~ or~ LuaTeX~ to~ function! } \xetex_if_engine:F { \luatex_if_engine:TF { @@ -193,6 +193,10 @@ { Adjusting~ the~ maths~ setup~ (use~ [no-math]~ to~ avoid~ this). } +\msg_new:nnn {fontspec} {no-scripts} +{ + Font~ \zf@fontname~ does not contain any OpenType `Script' information. +} \DeclareOption{cm-default}{ \fontspec_warning:n {cm-default-obsolete} } @@ -212,7 +216,7 @@ \ProcessOptions* \RequirePackage{calc} \RequirePackage{xkeyval}[2005/05/07] -\luatex_if_engine:T { \RequirePackage{fontspec-patches} } +\RequirePackage{fontspec-patches} \xetex_or_luatex:nnn {\tl_set:Nn \zf@enc} {EU1} {EU2} \tl_set:Nn \rmdefault {lmr} \tl_set:Nn \sfdefault {lmss} @@ -226,41 +230,34 @@ \tl_set_eq:NN \latinencoding \zf@enc } \DeclareDocumentCommand \fontspec { O{} m } { - \fontspec_select:nn{#1}{#2} - \fontfamily\zf@family\selectfont + \fontspec_set_family:Nnn \f@family {#1}{#2} + \selectfont \ignorespaces } \DeclareDocumentCommand \setmainfont { O{} m } { - \fontspec_select:nn{#1}{#2} - \tl_set_eq:NN \rmdefault \zf@family + \fontspec_set_family:Nnn \rmdefault {#1}{#2} \normalfont } \DeclareDocumentCommand \setsansfont { O{} m } { - \fontspec_select:nn{#1}{#2} - \tl_set_eq:NN \sfdefault \zf@family + \fontspec_set_family:Nnn \sfdefault {#1}{#2} \normalfont } \DeclareDocumentCommand \setmonofont { O{} m } { - \fontspec_select:nn{#1}{#2} - \tl_set_eq:NN \ttdefault \zf@family + \fontspec_set_family:Nnn \ttdefault {#1}{#2} \normalfont } \cs_set_eq:NN \setromanfont \setmainfont \DeclareDocumentCommand \setmathrm { O{} m } { - \fontspec_select:nn{#1}{#2} - \let\zf@rmmaths\zf@family + \fontspec_set_family:Nnn \zf@rmmaths {#1}{#2} } \DeclareDocumentCommand \setboldmathrm { O{} m } { - \fontspec_select:nn{#1}{#2} - \let\zf@rmboldmaths\zf@family + \fontspec_set_family:Nnn \zf@rmboldmaths {#1}{#2} } \DeclareDocumentCommand \setmathsf { O{} m } { - \fontspec_select:nn{#1}{#2} - \let\zf@sfmaths\zf@family + \fontspec_set_family:Nnn \zf@sfmaths {#1}{#2} } \DeclareDocumentCommand \setmathtt { O{} m } { - \fontspec_select:nn{#1}{#2} - \let\zf@ttmaths\zf@family + \fontspec_set_family:Nnn \zf@ttmaths {#1}{#2} } \@onlypreamble\setmathrm \@onlypreamble\setboldmathrm @@ -513,6 +510,10 @@ \fi } \cs_generate_variant:Nn \tl_if_eq:nnTF {nv} +\cs_new:Npn \fontspec_set_family:Nnn #1#2#3 { + \fontspec_select:nn {#2}{#3} + \tl_set_eq:NN #1 \zf@family +} \cs_set:Npn \fontspec_select:nn #1#2 { \begingroup \fontspec_init: @@ -530,8 +531,26 @@ \global\font\zf@basefont="\fontspec_fullname:n {\zf@up}"~at~\f@size pt \zf@firsttimetrue \ifzf@icu - \fontspec_setkeys:xxx {feat} {Script} {\l_fontspec_script_name_tl} - \fontspec_setkeys:xxx {feat} {Lang} {\l_fontspec_lang_name_tl} + \tl_if_empty:NTF \l_fontspec_script_name_tl { + \fontspec_check_script:nTF {latn} + { + \tl_set:Nn \l_fontspec_script_name_tl {Latin} + \tl_set:Nn \l_fontspec_script_tl {latn} + \tl_if_empty:NT \l_fontspec_lang_tl { + \tl_set:Nn \l_fontspec_lang_name_tl {Default} + \tl_set:Nn \l_fontspec_lang_tl {DFLT} + } + \fontspec_setkeys:xxx {feat} {Script} {\l_fontspec_script_name_tl} + \fontspec_setkeys:xxx {feat} {Lang} {\l_fontspec_lang_name_tl} + } + { + \fontspec_info:n {no-scripts} + } + } + { + \fontspec_setkeys:xxx {feat} {Script} {\l_fontspec_script_name_tl} + \fontspec_setkeys:xxx {feat} {Lang} {\l_fontspec_lang_name_tl} + } \fi \fontspec_get_features:n{\zf@font@feat} \zf@firsttimefalse @@ -747,14 +766,20 @@ \xetex_or_luatex:nnn { \tl_set:Nn \l_fontspec_pre_feat_tl } { \ifzf@icu - script = \l_fontspec_script_tl ; - language = \l_fontspec_lang_tl ; + \tl_if_empty:NF \l_fontspec_script_tl + { + script = \l_fontspec_script_tl ; + language = \l_fontspec_lang_tl ; + } \fi } { mode = \l_fontspec_mode_tl ; - script = \l_fontspec_script_tl ; - language = \l_fontspec_lang_tl ; + \tl_if_empty:NF \l_fontspec_script_tl + { + script = \l_fontspec_script_tl ; + language = \l_fontspec_lang_tl ; + } } \newcommand*{\zf@update@family}[1]{ \ifzf@firsttime @@ -773,6 +798,8 @@ } \tl_clear:N \zf@bf \tl_clear:N \zf@it +\tl_clear:N \zf@fake@slant +\tl_clear:N \zf@fake@embolden \tl_clear:N \zf@bfit \tl_clear:N \zf@sl \tl_clear:N \zf@bfsl @@ -784,16 +811,16 @@ \tl_clear:N \zf@sl@feat \tl_clear:N \zf@bfsl@feat \tl_clear:N \zf@sc@feat +\tl_clear:N \l_fontspec_script_name_tl +\tl_clear:N \l_fontspec_script_tl +\tl_clear:N \l_fontspec_lang_name_tl +\tl_clear:N \l_fontspec_lang_tl \clist_clear:N \l_fontspec_sizefeat_clist \newcommand*\fontspec_init:{ \zf@icufalse \cs_set_eq:NN \fontspec_namewrap:n \use:n \tl_clear:N \l_fontspec_optical_size_tl \tl_clear:N \l_fontspec_renderer_tl - \tl_set:Nn \l_fontspec_script_name_tl {Latin} - \tl_set:Nn \l_fontspec_script_tl {latn} - \tl_set:Nn \l_fontspec_lang_name_tl {Default} - \tl_set:Nn \l_fontspec_lang_tl {DFLT} \luatex_if_engine:T { \tl_set:Nn \l_fontspec_mode_tl {node} \luatexprehyphenchar =`\- % fixme @@ -821,8 +848,10 @@ } } \cs_new:Npn \sclist_put_right:Nn #1#2 { - \tl_if_empty:NT #1 { - + \tl_if_empty:NTF #1 { + \tl_set:Nn #1 {#2} + }{ + \tl_put_right:Nn #1 {;#2} } } \newcommand*\zf@update@ff[1]{ @@ -1175,6 +1204,12 @@ } { \dim_set:Nn #1 { \directlua{ fontspec.get_dimen(#2, "\cs_to_str:N #3") } } + \dim_compare:nNnT #1 = {0pt} { + \settoheight #1 { + \tl_if_eq:nnTF {#3} {\font} \rmfamily #3 + \prg_case_int:nnn #2 { 5 x 8 X } {?} + } + } } \define@key[zf]{options}{WordSpace}{ \zf@update@family{+wordspace:#1} @@ -1311,18 +1346,44 @@ \zf@update@family{+size:#1} } } -\define@key[zf]{options}{FakeSlant}{ +\define@key[zf]{options}{FakeSlant}[0.2]{ \zf@update@family{+slant:#1} \zf@update@ff{slant=#1} } -\define@key[zf]{options}{FakeStretch}{ +\define@key[zf]{options}{FakeStretch}[1.2]{ \zf@update@family{+extend:#1} \zf@update@ff{extend=#1} } -\define@key[zf]{options}{FakeBold}{ +\define@key[zf]{options}{FakeBold}[1.5]{ \zf@update@family{+embolden:#1} \zf@update@ff{embolden=#1} } +\define@key[zf]{options}{AutoFakeSlant}[0.2]{ + \ifzf@firsttime + \tl_set:Nn \zf@fake@slant {#1} + \tl_put_right:Nn \zf@it@feat {,FakeSlant=#1} + \tl_set_eq:NN \zf@it \zf@fontname + \zf@update@family{fakeit:#1} + \tl_if_empty:NF \zf@fake@embolden { + \tl_put_right:Nx \zf@bfit@feat + {,FakeBold=\zf@fake@embolden,FakeSlant=#1} + \tl_set_eq:NN \zf@bfit \zf@fontname + } + \fi +} +\define@key[zf]{options}{AutoFakeBold}[1.5]{ + \ifzf@firsttime + \tl_set:Nn \zf@fake@embolden {#1} + \tl_put_right:Nn \zf@bf@feat {,FakeBold=#1} + \tl_set_eq:NN \zf@bf \zf@fontname + \zf@update@family{fakebf:#1} + \tl_if_empty:NF \zf@fake@slant { + \tl_put_right:Nx \zf@bfit@feat + {,FakeSlant=\zf@fake@slant,FakeBold=#1} + \tl_set_eq:NN \zf@bfit \zf@fontname + } + \fi +} \zf@define@font@feature{Ligatures} \zf@define@feature@option{Ligatures}{Required} {1}{0}{+rlig} \zf@define@feature@option{Ligatures}{NoRequired} {1}{1}{-rlig} @@ -1920,8 +1981,8 @@ %% and the derived files fontspec.sty, %% fontspec.lua, %% fontspec.cfg, -%% fontspec.ins, -%% fontspec-example.ltx, +%% fontspec-xetex.tex, +%% fontspec-luatex.tex, %% and fontspec.pdf. %% %% |