diff options
author | Karl Berry <karl@freefriends.org> | 2010-04-10 00:04:40 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-04-10 00:04:40 +0000 |
commit | 5fd15d101add3e08ff14e00c8a38998602e87959 (patch) | |
tree | 0ec09aea3b1a0bac1b45bd6635145cd5d2ab267c /Master/texmf-dist/tex/latex/bidi/graphicx-xetex-bidi.def | |
parent | 1a415339f97d6e886e15efee8e7be4c3ba4e38ec (diff) |
bidi now lualatex, too (9apr10)
git-svn-id: svn://tug.org/texlive/trunk@17780 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/bidi/graphicx-xetex-bidi.def')
-rw-r--r-- | Master/texmf-dist/tex/latex/bidi/graphicx-xetex-bidi.def | 130 |
1 files changed, 130 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/bidi/graphicx-xetex-bidi.def b/Master/texmf-dist/tex/latex/bidi/graphicx-xetex-bidi.def new file mode 100644 index 00000000000..d6b51c90e4a --- /dev/null +++ b/Master/texmf-dist/tex/latex/bidi/graphicx-xetex-bidi.def @@ -0,0 +1,130 @@ +%% +%% This is file `graphicx-xetex-bidi.def', + +%% +%% __________________________________ +%% Copyright © 2009-2010 Vafa Khalighi +%% +%% License information appended. +%% +%% +\ProvidesFile{graphicx-xetex-bidi.def}[2010/07/25 v0.3 bidi adaptations for graphicx package for XeTeX engine] +\def\Grot@box@std#1#2{\ifmmode\else\if@RTL\beginL\fi\fi% + \Grot@setangle{#1}% + \setbox\z@\hbox{{\ifmmode\if@RTL\beginR\fi#2\if@RTL\endR\fi\else\if@RTL\beginR\fi#2\if@RTL\endR\fi\fi}}% + \Grot@x\z@ + \Grot@y\z@ + \Grot@box\ifmmode\else\if@RTL\endL\fi\fi} +\long\def\Gscale@box#1[#2]#3{\ifmmode\else\if@RTL\beginL\fi\fi% + \leavevmode + \def\Gscale@x{#1}\def\Gscale@y{#2}% + \setbox\z@\hbox{{#3}}% + \setbox\tw@\hbox{\Gscale@start\rlap{\copy\z@}\Gscale@end}% + \ifdim#2\p@<\z@ + \ht\tw@-#2\dp\z@ + \dp\tw@-#2\ht\z@ + \else + \ht\tw@#2\ht\z@ + \dp\tw@#2\dp\z@ + \fi + \ifdim#1\p@<\z@ + \hb@xt@-#1\wd\z@{\kern-#1\wd\z@\box\tw@\hss}% + \else + \wd\tw@#1\wd\z@ + \box\tw@ + \fi\ifmmode\else\if@RTL\endL\fi\fi} +\def\Gin@ii[#1]#2{\ifmmode\else\if@RTL\beginL\fi\fi% + \def\@tempa{[}\def\@tempb{#2}% + \ifx\@tempa\@tempb + \def\@tempa{\Gin@iii[#1][}% + \expandafter\@tempa + \else + \begingroup + \@tempswafalse + \toks@{\Ginclude@graphics{#2}}% + \setkeys{Gin}{#1}% + \Gin@esetsize + \the\toks@ + \endgroup + \fi\ifmmode\else\if@RTL\endL\fi\fi} +\def\reflectbox{\bidiGscale@box-1[1]} +\long\def\bidiGscale@box#1[#2]#3{\ifmmode\else\if@RTL\beginL\fi\fi% + \leavevmode + \def\Gscale@x{#1}\def\Gscale@y{#2}% + \setbox\z@\hbox{{\ifmmode\if@RTL\beginR\fi#3\if@RTL\endR\fi\else\if@RTL\beginR\fi#3\if@RTL\endR\fi\fi}}% + \setbox\tw@\hbox{\Gscale@start\rlap{\copy\z@}\Gscale@end}% + \ifdim#2\p@<\z@ + \ht\tw@-#2\dp\z@ + \dp\tw@-#2\ht\z@ + \else + \ht\tw@#2\ht\z@ + \dp\tw@#2\dp\z@ + \fi + \ifdim#1\p@<\z@ + \hb@xt@-#1\wd\z@{\kern-#1\wd\z@\box\tw@\hss}% + \else + \wd\tw@#1\wd\z@ + \box\tw@ + \fi\ifmmode\else\if@RTL\endL\fi\fi} +\def\scalebox#1{% + \@ifnextchar[{\bidiGscale@box{#1}}{\bidiGscale@box{#1}[#1]}} +\def\resizebox{% + \leavevmode + \@ifstar{\bidiGscale@@box\totalheight}{\bidiGscale@@box\height}} +\def\bidiGscale@@box#1#2#3{% + \let\@tempa\Gin@exclamation + \expandafter\def\expandafter\@tempb\expandafter{\string#2}% + \expandafter\def\expandafter\@tempc\expandafter{\string#3}% + \ifx\@tempb\@tempa + \ifx\@tempc\@tempa + \toks@{\mbox}% + \else + \toks@{\bidiGscale@box@dd{#3}#1}% + \fi + \else + \ifx\@tempc\@tempa + \toks@{\bidiGscale@box@dd{#2}\width}% + \else + \toks@{\bidiGscale@box@dddd{#2}\width{#3}#1}% + \fi + \fi + \the\toks@} +\long\def\bidiGscale@box@dd#1#2#3{% + \@begin@tempboxa\hbox{\ifmmode\if@RTL\beginR\fi#3\if@RTL\endR\fi\else\if@RTL\beginR\fi#3\if@RTL\endR\fi\fi}% + \setlength\@tempdima{#1}% + \setlength\@tempdimb{#2}% + \Gscale@div\@tempa\@tempdima\@tempdimb + \Gscale@box\@tempa[\@tempa]{\box\@tempboxa}% + \@end@tempboxa} +\long\def\bidiGscale@box@dddd#1#2#3#4#5{% + \@begin@tempboxa\hbox{\ifmmode\if@RTL\beginR\fi#5\if@RTL\endR\fi\else\if@RTL\beginR\fi#5\if@RTL\endR\fi\fi}% + \setlength\@tempdima{#1}% + \setlength\@tempdimb{#2}% + \Gscale@div\@tempa\@tempdima\@tempdimb + \setlength\@tempdima{#3}% + \setlength\@tempdimb{#4}% + \Gscale@div\@tempb\@tempdima\@tempdimb + \ifGin@iso + \ifdim\@tempa\p@>\@tempb\p@ + \let\@tempa\@tempb + \else + \let\@tempb\@tempa + \fi + \fi + \Gscale@box\@tempa[\@tempb]{\box\@tempboxa}% + \@end@tempboxa} +%% +%% Copyright © 2009-2010 by Vafa Khalighi <vafakh84@gmail.com> +%% +%% Distributable under the LaTeX Project Public License, +%% version 1.3c or higher (your choice). The latest version of +%% this license is at: http://www.latex-project.org/lppl.txt +%% +%% This work is "maintained" (as per LPPL maintenance status) +%% by Vafa Khalighi. +%% +%% +%% +%% +%% +%% End of file `graphicx-xetex-bidi.def'. |