From 824c41895b67301061dae9271c2b0e6b45fc5f77 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 26 Feb 2013 00:29:14 +0000 Subject: fontspec (25feb13) git-svn-id: svn://tug.org/texlive/trunk@29230 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/latex/fontspec/fontspec-patches.sty | 123 ++++++++++++--------- 1 file changed, 72 insertions(+), 51 deletions(-) (limited to 'Master/texmf-dist/tex/latex/fontspec/fontspec-patches.sty') diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec-patches.sty b/Master/texmf-dist/tex/latex/fontspec/fontspec-patches.sty index f2fc15b2a82..7564e72ddc4 100644 --- a/Master/texmf-dist/tex/latex/fontspec/fontspec-patches.sty +++ b/Master/texmf-dist/tex/latex/fontspec/fontspec-patches.sty @@ -14,40 +14,47 @@ %% %% \ProvidesPackage{fontspec-patches} - [2012/05/06 v2.2b Advanced font selection for XeLaTeX/LuaLaTeX] + [2013/02/25 v2.3 Font selection for XeLaTeX and LuaLaTeX] \ExplSyntaxOn \RequirePackage{fixltx2e}[2006/03/24] -\DeclareRobustCommand \em { +\DeclareRobustCommand \em + { \@nomath\em - \str_if_eq:xxTF \f@shape \itdefault \eminnershape + \str_if_eq_x:nnTF \f@shape \itdefault \eminnershape { - \str_if_eq:xxTF \f@shape \sldefault \eminnershape \emshape + \str_if_eq_x:nnTF \f@shape \sldefault \eminnershape \emshape } -} + } \DeclareTextFontCommand{\emph}{\em} \cs_set_eq:NN \emshape \itshape \cs_set_eq:NN \eminnershape \upshape -\DeclareRobustCommand{\-}{% - \discretionary{% +\DeclareRobustCommand{\-} + { + \discretionary + { \char\ifnum\hyphenchar\font<\z@ \xlx@defaulthyphenchar \else \hyphenchar\font - \fi}{}{}} + \fi + }{}{} + } \def\xlx@defaulthyphenchar{`\-} -\cs_new:Nn \fontspec_visible_space: { +\cs_new:Nn \fontspec_visible_space: + { \font_glyph_if_exist:NnTF \font {"2423} - {\char"2423\relax} - {\fontspec_visible_space_fallback:} -} -\cs_new:Nn \fontspec_visible_space_fallback: { + { \char"2423\scan_stop: } + { \fontspec_visible_space_fallback: } + } +\cs_new:Nn \fontspec_visible_space_fallback: + { { - \usefont{\g_fontspec_encoding_tl}{lmtt}{\f@series}{\f@shape} - \textvisiblespace + \usefont{\g_fontspec_encoding_tl}{lmtt}{\f@series}{\f@shape} + \textvisiblespace } -} + } \group_begin: \char_set_catcode_active:n{"20}% \cs_gset:Npn\fontspec_print_visible_spaces:{% @@ -55,60 +62,74 @@ \cs_set_eq:NN^^20\fontspec_visible_space:% }% \group_end: -\def\verb{ +\def\verb + { \relax\ifmmode\hbox\else\leavevmode\null\fi \bgroup \verb@eol@error \let\do\@makeother \dospecials \verbatim@font\@noligs - \@ifstar\@@sverb\@verb -} -\def\@@sverb{\fontspec_print_visible_spaces:\@sverb} -\AtBeginDocument{ + \@ifstar\__fontspecsverb\@verb + } +\def\__fontspecsverb{\fontspec_print_visible_spaces:\@sverb} +\AtBeginDocument + { \fontspec_patch_verbatim: \fontspec_patch_moreverb: \fontspec_patch_fancyvrb: \fontspec_patch_listings: -} -\cs_set:Npn \fontspec_patch_verbatim: { - \@ifpackageloaded{verbatim}{ - \cs_set:cpn {verbatim*} { + } +\cs_set:Npn \fontspec_patch_verbatim: + { + \@ifpackageloaded{verbatim} + { + \cs_set:cpn {verbatim*} + { \group_begin: \@verbatim \fontspec_print_visible_spaces: \verbatim@start - } - }{ - \cs_set:cpn {verbatim*} { + } + } + { + \cs_set:cpn {verbatim*} + { \@verbatim \fontspec_print_visible_spaces: \@sxverbatim - } - } -} -\cs_set:Npn \fontspec_patch_moreverb: { + } + } + } +\cs_set:Npn \fontspec_patch_moreverb: + { \@ifpackageloaded{moreverb}{ - \cs_set:cpn {listingcont*} { - \cs_set:Npn \verbatim@processline { + \cs_set:cpn {listingcont*} + { + \cs_set:Npn \verbatim@processline + { \thelisting@line \global\advance\listing@line\c_one \the\verbatim@line\par - } + } \@verbatim \fontspec_print_visible_spaces: \verbatim@start - } + } }{} -} -\cs_set:Npn \fontspec_patch_fancyvrb: { - \@ifpackageloaded{fancyvrb}{ + } +\cs_set:Npn \fontspec_patch_fancyvrb: + { + \@ifpackageloaded{fancyvrb} + { \cs_set_eq:NN \FancyVerbSpace \fontspec_visible_space: - }{} -} -\cs_set:Npn \fontspec_patch_listings: { - \@ifpackageloaded{listings}{ + }{} + } +\cs_set:Npn \fontspec_patch_listings: + { + \@ifpackageloaded{listings} + { \cs_set_eq:NN \lst@visiblespace \fontspec_visible_space: - }{} -} + }{} + } \RenewDocumentCommand \oldstylenums {m} - { - { \addfontfeature{Numbers=OldStyle} #1 } - } + { + { \addfontfeature{Numbers=OldStyle} #1 } + } \NewDocumentCommand \liningnums {m} - { - { \addfontfeature{Numbers=Lining} #1 } - } + { + { \addfontfeature{Numbers=Lining} #1 } + } %% %% Copyright 2004--2012 Will Robertson %% Copyright 2009--2012 Khaled Hosny -- cgit v1.2.3