From ae29f8fd830ee6798b80ee088fdd0c92b1a215f4 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Fri, 28 May 2010 15:53:06 +0000
Subject: xltxtra 0.5c (27may10)

git-svn-id: svn://tug.org/texlive/trunk@18559 c570f23f-e606-0410-a88d-b1316a301751
---
 .../texmf-dist/source/xelatex/xltxtra/xltxtra.dtx  | 247 ++++++++++++---------
 1 file changed, 146 insertions(+), 101 deletions(-)

(limited to 'Master/texmf-dist/source/xelatex/xltxtra/xltxtra.dtx')

diff --git a/Master/texmf-dist/source/xelatex/xltxtra/xltxtra.dtx b/Master/texmf-dist/source/xelatex/xltxtra/xltxtra.dtx
index 8758ffb1037..d66db15b1ae 100644
--- a/Master/texmf-dist/source/xelatex/xltxtra/xltxtra.dtx
+++ b/Master/texmf-dist/source/xelatex/xltxtra/xltxtra.dtx
@@ -4,15 +4,18 @@
 %</internal>
 %<*readme>
 _________________________
-THE XLTXTRA PACKAGE v0.5b
+THE XLTXTRA PACKAGE v0.5c
 
 This package provides a number of small features
 that are useful for XeLaTeX.
 
-It loads the fixltx2e and etex packages and
-patches a couple of other LaTeX commands: 
+- Loads fontspec and Ross Moore's xunicode automatically.
+
+- Loads Andrew Moschou's metalogo package for \XeTeX and \XeLaTeX logos.
+
+- Loads the fixltx2e package and patches other LaTeX commands:
   \-: for discretionary hyphenation with variable
-     hyphenation characters, and 
+     hyphenation characters, and
   \textsuperscript & \textsubscript:
      now use fontspec to access
      real superior/inferior characters,
@@ -22,29 +25,30 @@ patches a couple of other LaTeX commands:
   \verb*: now displays visible spaces correctly
   \begin{verbatim*}: ditto
 
-The following packages are patched (if necessary)
-to correctly display visible space within various
-verbatims: verbatim, moreverb, fancyvrb, listings
+- The following packages are patched (where necessary)
+  to correctly display visible space within various
+  verbatims: verbatim, moreverb, fancyvrb, listings
 
-Defines logos \XeTeX and \XeLaTeX via 
-Andrew Moschou's metalogo package.
+- Defines the dubiously useful commands
+     \vfrac - for vulgar fractions with fontspec
+     \namedglyph - to access font glyphs by name
 
-Defines the dubiously useful commands
- \vfrac - for vulgar fractions with fontspec
- \namedglyph - to access font glyphs by name
- 
 For more information see the documentation xltxtra.pdf.
 
 ____________
 Change History
 
+v0.5c:
+    Update internals for fontspec v2.0.
+    (No user-level changes.)
+
 v0.5b:
     Bug fix for "\LaTeX" when [no-logos] is used.
     Thanks to Enrico Gregorio for finding this.
 
 ______________
 Will Robertson
-2006-2009
+2006-2010
 Released under the LaTeX Project Public License
 %</readme>
 %<*internal>
@@ -60,13 +64,13 @@ Released under the LaTeX Project Public License
 \preamble
   ____________________________
   The XLTXTRA package         
-  (C) 2006-2009 Will Robertson
+  (C) 2006-2010 Will Robertson
   License information appended
 
 \endpreamble
 \postamble
 
-Copyright (C) 2006-2009 by Will Robertson <wspr81@gmail.com>
+Copyright (C) 2006-2010 by Will Robertson <wspr81@gmail.com>
 
 Distributable under the LaTeX Project Public License,
 version 1.3c or higher (your choice). The latest version of
@@ -130,7 +134,7 @@ This work consists of the file  xltxtra.dtx
 % \XeTeX\ format.
 %
 % \subsection{Usage}
-% Easy: |\usepackage{xltxtra}|. This package automatically loads the following packages: \pkg{fixltx2e}, \pkg{etex}, \pkg{metalogo}, \pkg{xunicode}, \pkg{fontspec}.
+% Easy: |\usepackage{xltxtra}|. This package automatically loads the following packages: \pkg{fixltx2e}, \pkg{metalogo}, \pkg{xunicode}, \pkg{fontspec}.
 %
 % There are some package options to disable various functionality that could clash with other things:
 % \begin{description}[font=\ttfamily]
@@ -293,7 +297,7 @@ This work consists of the file  xltxtra.dtx
 %
 %    \begin{macrocode}
 \ProvidesPackage{xltxtra}
-  [2009/12/26 v0.5b Improvements for the "XeLaTeX" format]  
+  [2010/05/27 v0.5c Improvements for the "XeLaTeX" format]
 %    \end{macrocode}
 %
 % \changes{v0.3}{2007/05/29}{Added proper documentation.}
@@ -301,6 +305,28 @@ This work consists of the file  xltxtra.dtx
 % \changes{v0.4}{2008/07/29}{Added support for verbatim \& visible spaces.}
 % ^^A\PrintChanges
 %
+% \paragraph{Not for Lua\TeX}
+%    \begin{macrocode}
+\RequirePackage{ifluatex}
+\ifluatex
+  \PackageWarningNoLine {xltxtra} {^^J
+    XLTXTRA IS TO BE USED ONLY UNDER XETEX.
+    LOAD FONTSPEC DIRECTLY, INSTEAD.^^J
+    ABORTING LOADING%
+  }
+  \RequirePackage{fontspec}[2010/05/14 v2.0]
+  \expandafter \endinput
+\fi
+%    \end{macrocode}
+%
+% \paragraph{Required packages}
+%    \begin{macrocode}
+\RequirePackage{ifxetex}
+\RequireXeTeX
+\RequirePackage{fontspec}[2010/05/14 v2.0]
+\RequirePackage{xunicode}
+%    \end{macrocode}
+%
 % \paragraph{Option processing}
 %    \begin{macrocode}
 \newif\if@xxt@nosscript@
@@ -316,13 +342,6 @@ This work consists of the file  xltxtra.dtx
 \ProcessOptions*
 %    \end{macrocode}
 %
-% \paragraph{Required packages}
-%    \begin{macrocode}
-\RequirePackage{ifxetex}
-\RequireXeTeX
-\RequirePackage{fontspec}
-\RequirePackage{xunicode}
-%    \end{macrocode}
 %
 % \section{Programmming bits and pieces}
 %
@@ -392,14 +411,6 @@ This work consists of the file  xltxtra.dtx
 % \changes{v0.5a}{2009/10/25}{Removed metalogo customisations; reply on the package defaults instead.}
 % \end{macro}
 %
-% \section{\eTeX\ functionality}
-% Because it's just sensible, we load the package that actually
-% allows \LaTeX\ to access the extra registers, etc., provided
-% by \eTeX.
-%    \begin{macrocode}
-\RequirePackage{etex}
-%    \end{macrocode}
-%
 % \subsection{Unicode footnote symbols}
 %    \begin{macrocode}
 \RequirePackage{fixltx2e}[2006/03/24]
@@ -505,74 +516,100 @@ This work consists of the file  xltxtra.dtx
 %
 % \begin{macro}{\realsubscript}
 %    \begin{macrocode}
-\DeclareRobustCommand*\realsubscript[1]{%
-  \begingroup
-    \ifcsname zf@family@fontdef\f@family\endcsname
-      \c@zf@script 1818326126\relax
-      \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt
-      \zf@set@font@type
-      \ifzf@icu
-        \zf@check@ot@feat{+subs}%
-        \if@tempswa
-          {\addfontfeature{VerticalPosition=Inferior}#1}%
-        \else
-          \zf@check@ot@feat{+sinf}%
-          \if@tempswa
-            {\addfontfeature{VerticalPosition=ScientificInferior}#1}%
-          \else
-            \fakesubscript{#1}%
-          \fi
-        \fi
-      \else\ifzf@atsui
-        \zf@make@aat@feature@string{10}{2}%
-        \unless\ifx\@tempa\@empty
-          {\addfontfeature{VerticalPosition=Inferior}#1}%
-        \else
-          \fakesubscript{#1}%
-        \fi
-      \fi\fi
-    \else
-      \fakesubscript{#1}%
-    \fi
-  \endgroup}
+\ExplSyntaxOn
+\DeclareRobustCommand*\realsubscript[1]{
+  \fontspec_if_fontspec_font:TF
+  {
+%    \end{macrocode}
+% OpenType fonts:
+%    \begin{macrocode}
+    \fontspec_if_opentype:TF
+    {
+      \fontspec_if_feature:nTF {+subs}
+      {
+        {\addfontfeature{VerticalPosition=Inferior}#1}
+      }
+      {
+        \fontspec_if_feature:nTF {+sinf}
+        {
+          {\addfontfeature{VerticalPosition=ScientificInferior}#1}
+        }
+        {
+          \fakesubscript{#1}
+        }
+      }
+    }
+%    \end{macrocode}
+% ATSUI fonts:
+%    \begin{macrocode}
+    {
+      \fontspec_if_aat_feature:nnTF {10} {2}
+      {
+        {\addfontfeature{VerticalPosition=Inferior}#1}
+      }
+      {
+        \fakesubscript{#1}
+      }
+    }
+  }
+%    \end{macrocode}
+% Non-fontspec fonts:
+%    \begin{macrocode}
+  {
+    \fakesubscript{#1}
+  }
+}
 %    \end{macrocode}
 % \changes{v0.1}{2006/05/03}{Implemented.}
 % \changes{v0.3}{2007/05/29}{Fixes to catch up with fontspec. Name change.}
 % \changes{v0.3c}{2008/03/02}{Fixed crash when used with a TFM font.}
+% \changes{v0.5c}{2010/05/14}{Use fontspec programmer's interface.}
 % \end{macro}
 %
 % \begin{macro}{\realsuperscript}
 % Text superscripts:
 %    \begin{macrocode}
-\DeclareRobustCommand*\realsuperscript[1]{%
-  \begingroup
-    \ifcsname zf@family@fontdef\f@family\endcsname
-      \c@zf@script 1818326126\relax
-      \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt
-      \zf@set@font@type
-      \ifzf@icu
-        \zf@check@ot@feat{+sups}%
-        \if@tempswa
-          {\addfontfeature{VerticalPosition=Superior}#1}%
-        \else
-          \fakesuperscript{#1}%
-        \fi
-      \else\ifzf@atsui
-        \zf@make@aat@feature@string{10}{1}%
-        \unless\ifx\@tempa\@empty
-          {\addfontfeature{VerticalPosition=Superior}#1}%
-        \else
-         \fakesuperscript{#1}%
-        \fi
-      \fi\fi
-    \else
-      \fakesuperscript{#1}%
-    \fi
-  \endgroup}
+\DeclareRobustCommand*\realsuperscript[1]{
+  \fontspec_if_fontspec_font:TF
+  {
+%    \end{macrocode}
+% OpenType fonts:
+%    \begin{macrocode}
+    \fontspec_if_opentype:TF
+    {
+      \fontspec_if_feature:nTF {+sups}
+      {
+        {\addfontfeature{VerticalPosition=Superior}#1}
+      }
+      {
+        \fakesuperscript{#1}
+      }
+    }
+%    \end{macrocode}
+% ATSUI fonts:
+%    \begin{macrocode}
+    {
+      \fontspec_if_aat_feature:nnTF {10} {1}
+      {
+        {\addfontfeature{VerticalPosition=Superior}#1}
+      }
+      {
+        \fakesuperscript{#1}
+      }
+    }
+  }
+%    \end{macrocode}
+% Non-fontspec fonts:
+%    \begin{macrocode}
+  {
+    \fakesuperscript{#1}
+  }
+}
 %    \end{macrocode}
 % \changes{v0.1}{2006/05/03}{Implemented.}
 % \changes{v0.3}{2007/05/29}{Fixes to catch up with fontspec. Name change.}
 % \changes{v0.3c}{2008/03/02}{Fixed crash when used with a TFM font.}
+% \changes{v0.5c}{2010/05/14}{Use fontspec programmer's interface.}
 % \end{macro}
 %
 % Patching footnotes:
@@ -590,23 +627,31 @@ This work consists of the file  xltxtra.dtx
 % No error checking is done to ensure that the font actually has the neceessary features.
 % Requires the \pkg{xunicode} package for \cmd\textfractionsolidus.
 %    \begin{macrocode}
-\newcommand*\vfrac[2]{%
-  \begingroup
-    \c@zf@script 1818326126\relax
-    \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt
-    \zf@set@font@type
-    \ifzf@icu
-      {\addfontfeature{VerticalPosition=Numerator}#1}%
+\newcommand*\vfrac[2]{
+  \fontspec_if_fontspec_font:TF
+  {
+    \fontspec_if_opentype:TF
+    {
+      {\addfontfeature{VerticalPosition=Numerator}#1}
        \textfractionsolidus
-      {\addfontfeature{VerticalPosition=Denominator}#2}%      
-    \else\ifzf@atsui
-      {\addfontfeature{VerticalPosition=Superior}#1}%
+      {\addfontfeature{VerticalPosition=Denominator}#2}
+    }
+    {
+      {\addfontfeature{VerticalPosition=Superior}#1}
        \textfractionsolidus
-      {\addfontfeature{VerticalPosition=Inferior}#2}%
-    \fi\fi
-  \endgroup}
+      {\addfontfeature{VerticalPosition=Inferior}#2}
+    }
+  }
+  {
+    \PackageError {xltxtra}
+      { \string\vfrac\space~can~only~be~used~with~fontspec~fonts }
+      { Nothing~more~to~tell. }
+  }
+}
+\ExplSyntaxOff
 %    \end{macrocode}
 % \changes{v0.1}{2006/05/03}{Implemented.}
+% \changes{v0.5c}{2010/05/14}{Use fontspec programmer's interface.}
 % \end{macro}
 %
 % \begin{macro}{\namedglyph}
-- 
cgit v1.2.3

