diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/fontspec/fontspec.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/fontspec/fontspec.sty | 90 |
1 files changed, 35 insertions, 55 deletions
diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec.sty b/Master/texmf-dist/tex/latex/fontspec/fontspec.sty index afb20ff702c..bed70f621fb 100644 --- a/Master/texmf-dist/tex/latex/fontspec/fontspec.sty +++ b/Master/texmf-dist/tex/latex/fontspec/fontspec.sty @@ -14,7 +14,8 @@ %% %% \ProvidesPackage{fontspec} - [2010/06/08 v2.0 Advanced font selection for XeLaTeX/LuaLaTeX] + [2010/07/11 v2.0a Advanced font selection for XeLaTeX/LuaLaTeX] + \RequirePackage{expl3,xparse} @@ -65,6 +66,13 @@ \cs_set:Npn \use:x #1 { \edef\@tempa{#1}\@tempa } \cs_set:Npn \use_v:nnnnn #1#2#3#4#5 {#5} \cs_set:Npn \use_iv:nnnnn #1#2#3#4#5 {#4} +\prg_new_conditional:Nnn \fontspec_glyph_if_exist:Nn {p,TF,T,F} { + \etex_iffontchar:D #1 #2 \scan_stop: + \prg_return_true: + \else: + \prg_return_false: + \fi: +} \cs_new:Npn \fontspec_setkeys:xx #1#2 { \use:x { \exp_not:N \setkeys*[zf]{#1}{#2} } @@ -96,7 +104,7 @@ } \msg_new:nnn {fontspec} {no-glyph} { - '\zf@fontname'~ doesn't~ appear~ to~ have~ the~ glyph~ corresponding~ to~ '#1'. + '\zf@fontname'~ does~ not~ contain~ glyph~ #1. } \msg_new:nnnn {fontspec} {unknown-options} { @@ -611,10 +619,8 @@ \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_if_empty:NT \l_fontspec_lang_name_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} @@ -624,9 +630,8 @@ } } { - \tl_if_empty:NT \l_fontspec_lang_tl { + \tl_if_empty:NT \l_fontspec_lang_name_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} @@ -1302,53 +1307,26 @@ } \define@key[zf]{options}{HyphenChar}{ \zf@update@family{+hyphenchar:#1} - \edef\@tempa{#1} - \edef\@tempb{None} - \ifx\@tempa\@tempb - \xetex_or_luatex:nnn { \g@addto@macro\zf@adjust } - { \hyphenchar\font-1\relax } - { \luatexprehyphenchar=-1\relax } - \else - \zf@check@one@char#1\zf@@ - \ifx\@tempb\@empty - \xetex_or_luatex:nn { - {\zf@basefont\expandafter\ifnum\expandafter\XeTeXcharglyph - \expandafter`#1 > \z@ - \g@addto@macro\zf@adjust{% - {\expandafter\hyphenchar\expandafter - \font\expandafter`#1}}% - \else - \fontspec_error:nx {no-glyph}{#1} - \fi}% - }{ - \ifnum\directlua{ - fontspec.sprint(fontspec.charglyph('#1', 'zf@basefont')) - } > \z@ - \g@addto@macro\zf@adjust{\luatexprehyphenchar=`#1\relax} - \else - \fontspec_error:nx {no-glyph}{#1} - \fi - } - \else - \xetex_or_luatex:nn { - {\zf@basefont\ifnum\XeTeXcharglyph#1 > \z@ - \g@addto@macro\zf@adjust{\hyphenchar\font#1\relax}% - \else - \fontspec_error:nx {no-glyph}{#1} - \fi}% - }{ - \ifnum\directlua{ - fontspec.sprint(fontspec.charglyph('#1', 'zf@basefont')) - } > \z@ - \g@addto@macro\zf@adjust{\luatexprehyphenchar=#1\relax} - \else - \fontspec_error:nx {no-glyph}{#1} - \fi - } - \fi - \fi + \tl_if_eq:nnTF {#1} {None} + { + \tl_put_right:Nn \zf@adjust { \hyphenchar \font = \c_minus_one } + } + { + \tl_if_single:nTF {#1} + { \tl_set:Nn \l_fontspec_hyphenchar_tl {`#1} } + { \tl_set:Nn \l_fontspec_hyphenchar_tl { #1} } + \fontspec_glyph_if_exist:NnTF \zf@basefont {\l_fontspec_hyphenchar_tl} + { + \xetex_or_luatex:nnn { \tl_put_right:Nn \zf@adjust } + { \hyphenchar \font = \l_fontspec_hyphenchar_tl \scan_stop: } + { + \hyphenchar \font = \c_zero + \luatexprehyphenchar = \l_fontspec_hyphenchar_tl \scan_stop: + } + } + { \fontspec_error:nx {no-glyph}{#1} } + } } -\def\zf@check@one@char#1#2\zf@@{\def\@tempb{#2}} \define@key[zf]{options}{Color}{ \zf@update@family{+col:#1} \cs_if_exist:cTF {\token_to_str:N\color@#1} @@ -1509,7 +1487,6 @@ \zf@define@feature@option{Numbers}{NoSlashedZero}{14}{4}{-zero} \luatex_if_engine:T { \zf@define@feature@option{Numbers}{Arabic}{}{}{+anum} - \zf@define@feature@option{Numbers}{Farsi} {}{}{+anum} } \zf@define@font@feature {Contextuals} \zf@define@feature@option{Contextuals}{Swash} {} {} {+cswh} @@ -1719,7 +1696,10 @@ \newfontlanguage{Spanish}{ESP}\newfontlanguage{Estonian}{ETI} \newfontlanguage{Basque}{EUQ}\newfontlanguage{Evenki}{EVK} \newfontlanguage{Even}{EVN}\newfontlanguage{Ewe}{EWE} -\newfontlanguage{French~Antillean}{FAN}\newfontlanguage{Farsi}{FAR} +\newfontlanguage{French~Antillean}{FAN} +\newfontlanguage{Farsi}{FAR} +\newfontlanguage{Parsi}{FAR} +\newfontlanguage{Persian}{FAR} \newfontlanguage{Finnish}{FIN}\newfontlanguage{Fijian}{FJI} \newfontlanguage{Flemish}{FLE}\newfontlanguage{Forest~Nenets}{FNE} \newfontlanguage{Fon}{FON}\newfontlanguage{Faroese}{FOS} |