summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-07-16 22:34:10 +0000
committerKarl Berry <karl@freefriends.org>2014-07-16 22:34:10 +0000
commit966482b48825b6eb8921b32c685b0ce8805480f8 (patch)
tree161e13300c97b3d4f7af51b50b89b520f48e9f4b /Master/texmf-dist/tex/xelatex
parentdf7fe5d3445e7c25bc8b42529e984e91eb110d9d (diff)
bidishadowtext (16jul14)
git-svn-id: svn://tug.org/texlive/trunk@34633 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/xelatex')
-rw-r--r--Master/texmf-dist/tex/xelatex/bidishadowtext/bidishadowtext.sty67
1 files changed, 67 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/xelatex/bidishadowtext/bidishadowtext.sty b/Master/texmf-dist/tex/xelatex/bidishadowtext/bidishadowtext.sty
new file mode 100644
index 00000000000..9d969088c9e
--- /dev/null
+++ b/Master/texmf-dist/tex/xelatex/bidishadowtext/bidishadowtext.sty
@@ -0,0 +1,67 @@
+%%
+%% This is file `bidishadowtext.sty'.
+%%
+%% __________________________________________________
+%% Copyright © 2014 Vafa Khalighi <persian-tex@tug.org>
+%%
+%% It may be distributed and/or modified 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 “author-maintained” (as per LPPL maintenance status)
+%% by Vafa Khalighi.
+%%
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{bidishadowtext}
+ [2014/07/16 v0.1 Bidi-aware shadow text]
+
+\RequirePackage{color}
+
+\newlength\bidist@shadowoffsetx
+\newlength\bidist@shadowoffsety
+
+\bidist@shadowoffsetx=1pt
+\bidist@shadowoffsety=1pt
+
+\newcommand\bidishadowoffset[1]{\setlength\bidist@shadowoffsetx{#1}\setlength\bidist@shadowoffsety{#1}}
+\newcommand\bidishadowoffsetx[1]{\setlength\bidist@shadowoffsetx{#1}}
+\newcommand\bidishadowoffsety[1]{\setlength\bidist@shadowoffsety{#1}}
+\newcommand\bidishadowcolor[1]{\def\bidist@shadowcolor{#1}}
+\newcommand\bidishadowrgb[1]{\definecolor{bidist@shadowcolorrgb}{rgb}{#1}\bidishadowcolor{bidist@shadowcolorrgb}}
+
+\bidishadowrgb{0.66,0.66,0.66}
+
+\newlength\bidist@temp@width
+\newlength\bidist@temp@height
+\newlength\bidist@pic@width
+\newlength\bidist@pic@height
+
+\newcommand\bidishadowtext[1]%
+{%
+ \begingroup%
+ \settowidth{\bidist@temp@width}{#1}%
+ \settoheight{\bidist@temp@height}{#1}%
+ \setlength{\bidist@pic@width}{\bidist@temp@width}%
+ \setlength{\bidist@pic@height}{\bidist@temp@height}%
+ \addtolength{\bidist@pic@width}{\bidist@shadowoffsetx}%
+ \addtolength{\bidist@pic@height}{\bidist@shadowoffsety}%
+ %
+ \edef\num@tw{\strip@pt\bidist@temp@width}%
+ \edef\num@th{\strip@pt\bidist@temp@height}%
+ \edef\num@pw{\strip@pt\bidist@pic@width}%
+ \edef\num@ph{\strip@pt\bidist@pic@height}%
+ \edef\num@offsetx{\strip@pt\bidist@shadowoffsetx}%
+ \edef\num@offsety{\strip@pt\bidist@shadowoffsety}%
+ \raisebox{-\bidist@shadowoffsety}{
+ \begin{picture}(\num@pw,\num@ph)(0,0)
+ \if@RTL\put(0,\num@offsety){\makebox(\num@tw,\num@th)[tl]{\ignorespaces #1}}\fi
+ \put(\num@offsetx,0){\makebox(\num@tw,\num@th)[tl]{{\color{\bidist@shadowcolor}\def\color##1{}\ignorespaces #1}}}
+ \if@RTL\else\put(0,\num@offsety){\makebox(\num@tw,\num@th)[tl]{\ignorespaces #1}}\fi
+ \end{picture}}%
+ \endgroup%
+ \ignorespaces%
+}
+\endinput
+%%
+%% End of file `bidishadowtext.sty'. \ No newline at end of file