summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf-dist/tex/xelatex/xetex-def/xetex.def43
1 files changed, 35 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/xelatex/xetex-def/xetex.def b/Master/texmf-dist/tex/xelatex/xetex-def/xetex.def
index 8de30232f9f..b8edaefbc95 100644
--- a/Master/texmf-dist/tex/xelatex/xetex-def/xetex.def
+++ b/Master/texmf-dist/tex/xelatex/xetex-def/xetex.def
@@ -2,8 +2,8 @@
%% This is file `xetex.def',
%% based upon other drivers for LaTeX color and graphics support.
%%
-%% Copyright 2004, 2005, 2006, 2007, 2009 Ross Moore <ross@maths.mq.edu.au>
-%% modified by Jonathan Kew <jonathan_kew@sil.org>
+%% Copyright 2004-2007, 2009, 2013 Ross Moore <ross@maths.mq.edu.au>
+%% modified by Jonathan Kew <jonathan_kew@sil.org>
%%
%% This file is *not yet* part of the Standard LaTeX `Graphics Bundle'.
%% It may be distributed under the terms of the LaTeX Project Public
@@ -13,6 +13,9 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Version History
%%
+%% 2013/02/04 [RRM] Version v0.95 added clipping support.
+%% (code provided by Joseph Wright and Martin Scharrer)
+%%
%% 2009/11/21 [KB] Version v0.94 merge the two 0.93's.
%%
%% 2009/10/28 [RRM] Version v0.93 fix big-point incompatibility;
@@ -63,7 +66,7 @@
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ProvidesFile{xetex.def}
- [2009/11/22 v0.94 LaTeX color/graphics driver for XeTeX (RRM/JK)]
+ [2013/02/04 v0.95 LaTeX color/graphics driver for XeTeX (RRM/JK)]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% make sure we can use " with correct catcode
@@ -308,7 +311,6 @@
\Gin@clipfalse
}{}%
\ifGin@clip
- \GXT@warn{No clipping support in XeTeX yet}%
\if!\Gin@vllx\Gin@vlly\Gin@vurx\Gin@vury!%
\else
\let\GXT@clipend\GXT@DoClipEnd
@@ -354,12 +356,37 @@
\advance\dimen@ -\Gin@vlly\p@
\ht\@tempboxa\strip@pt\dimen@ bp\relax
% \ht\@tempboxa\dimen@ \relax
- % when clipping is implemented for XeTeX
- % make the changes here:
+ % Clip box to its official size
+ \GXT@clipbox\@tempboxa
\box\@tempboxa
}
-
-
+% Clipping support added by Martin Scharrer and Joseph Wright, Nov 2011
+% under the LPPL v1.0 or later.
+\def\GXT@clipbox#1{%
+ \setbox#1=\hbox{%
+ \Gin@defaultbp\WIDTH{\wd#1}%
+ \Gin@defaultbp\DEPTH{\dp#1}%
+ \@tempdima\ht#1%
+ \advance\@tempdima\dp#1%
+ \Gin@defaultbp\TOTALHEIGHT{\@tempdima}%
+ \special{pdf:content q }%
+ \special{%
+ pdf:literal direct
+ 0 -\DEPTH\space \WIDTH\space \TOTALHEIGHT\space re
+ }%
+ \special{pdf:literal direct W }%
+ \special{pdf:literal direct n }%
+ \special{pdf:literal direct -1 0 0 -1 0 0 cm }%
+ \special{pdf:content q }%
+ \special{pdf:literal direct -1 0 0 -1 0 0 cm }%
+ \box#1%
+ \special{pdf:literal direct Q }%
+ \special{pdf:literal direct Q }%
+ }%
+}
+% End of clipping code
+
+%
\def\Gread@QTm#1{\IfFileExists{\Gin@base.bb}%
{\Gread@eps{\Gin@base.bb}}%
{\G@measure@QTm{\Gin@base}{\Gin@ext}}%