summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/fontspec/fontspec-patches.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-02-26 00:29:14 +0000
committerKarl Berry <karl@freefriends.org>2013-02-26 00:29:14 +0000
commit824c41895b67301061dae9271c2b0e6b45fc5f77 (patch)
treebf32ac7f3302415c03e657738a71bf01869f701b /Master/texmf-dist/tex/latex/fontspec/fontspec-patches.sty
parent1f9e02e82c40a4bd9e9dec120b1ea56347cf070e (diff)
fontspec (25feb13)
git-svn-id: svn://tug.org/texlive/trunk@29230 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/fontspec/fontspec-patches.sty')
-rw-r--r--Master/texmf-dist/tex/latex/fontspec/fontspec-patches.sty123
1 files changed, 72 insertions, 51 deletions
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 <wspr81@gmail.com>
%% Copyright 2009--2012 Khaled Hosny <khaledhosny@eglug.org>