From 9e094c6e6b25f6ef903f2d502fd91cda0c7f6ad1 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Thu, 30 Apr 2015 20:41:00 +0000
Subject: xepersian (30apr15)

git-svn-id: svn://tug.org/texlive/trunk@37134 c570f23f-e606-0410-a88d-b1316a301751
---
 .../texmf-dist/tex/xelatex/xepersian/xepersian.sty | 80 +++++++++++++++-------
 1 file changed, 54 insertions(+), 26 deletions(-)

(limited to 'Master/texmf-dist/tex/xelatex/xepersian/xepersian.sty')

diff --git a/Master/texmf-dist/tex/xelatex/xepersian/xepersian.sty b/Master/texmf-dist/tex/xelatex/xepersian/xepersian.sty
index 5edb374a581..ca44f7b32d4 100644
--- a/Master/texmf-dist/tex/xelatex/xepersian/xepersian.sty
+++ b/Master/texmf-dist/tex/xelatex/xepersian/xepersian.sty
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10038}
+%% \CheckSum{10069}
 %% \CharacterTable
 %%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
 %%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
@@ -35,8 +35,8 @@
 %%   Right brace   \}     Tilde         \~}
 %%
 \NeedsTeXFormat{LaTeX2e}
-\def\xepersianversion{v16}
-\def\xepersiandate{2015/02/02}
+\def\xepersianversion{v16.1}
+\def\xepersiandate{2015/04/30}
 \ProvidesPackage{xepersian}[\xepersiandate\space \xepersianversion\space
 Persian typesetting in XeLaTeX]
 \RequirePackage{fontspec}
@@ -97,9 +97,12 @@ Persian typesetting in XeLaTeX]
 \newfontscript{Parsi}{arab}
 \newfontlanguage{Parsi}{FAR}
 \ExplSyntaxOn
-\DeclareDocumentCommand \settextfont { O{} m O{} }
+\DeclareDocumentCommand \settextfont { o m }
+ { \__fontspec_pass_args:nnn \__xepersian_settextfont:nn {#1} {#2} }
+
+\cs_new:Nn \__xepersian_settextfont:nn
  {
-  \fontspec_set_family:cnn { g__fontspec_ \cs_to_str:N \persianfont  _family } {Script=Parsi,Language=Parsi,Mapping=parsidigits,#1,#3} {#2}
+  \fontspec_set_family:cnn { g__fontspec_ \cs_to_str:N \persianfont _family } {Script=Parsi,Language=Parsi,Mapping=parsidigits,#1} {#2}
   \use:x
    {
     \exp_not:N \DeclareRobustCommand \exp_not:N \persianfont
@@ -111,9 +114,12 @@ Persian typesetting in XeLaTeX]
   \cs_set_eq:NN \rmdefault \l_fontspec_family_tl
   \normalfont
  }
-\DeclareDocumentCommand \setlatintextfont { O{} m O{} }
+\DeclareDocumentCommand \setlatintextfont { o m }
+ { \__fontspec_pass_args:nnn \__xepersian_setlatintextfont:nn  {#1} {#2} }
+
+\cs_new:Nn \__xepersian_setlatintextfont:nn
  {
-  \fontspec_set_family:cnn { g__fontspec_ \cs_to_str:N \latinfont _family } {Mapping=tex-text,#1,#3} {#2}
+  \fontspec_set_family:cnn { g__fontspec_ \cs_to_str:N \latinfont _family } {Mapping=tex-text,#1} {#2}
   \use:x
    {
     \exp_not:N \DeclareRobustCommand \exp_not:N \latinfont
@@ -125,9 +131,12 @@ Persian typesetting in XeLaTeX]
  }
 \cs_set_eq:NN \setlatinsansfont \setsansfont
 \cs_set_eq:NN \setlatinmonofont \setmonofont
-\DeclareDocumentCommand \defpersianfont { m O{} m O{} }
+\DeclareDocumentCommand \defpersianfont { m o m }
+ { \__fontspec_pass_args:nnn { \__xepersian_defpersianfont:Nnn #1 } {#2} {#3} }
+
+\cs_new:Nn \__xepersian_defpersianfont:Nnn
  {
-  \fontspec_set_family:cnn { g__fontspec_ \cs_to_str:N #1 _family } {Script=Parsi,Language=Parsi,Mapping=parsidigits,#2,#4} {#3}
+  \fontspec_set_family:cnn { g__fontspec_ \cs_to_str:N #1 _family } {Script=Parsi,Language=Parsi,Mapping=parsidigits,#2} {#3}
   \use:x
    {
     \exp_not:N \DeclareRobustCommand \exp_not:N #1
@@ -137,9 +146,12 @@ Persian typesetting in XeLaTeX]
      }
    }
  }
-\DeclareDocumentCommand \deflatinfont { m O{} m O{} }
+\DeclareDocumentCommand \deflatinfont { m o m }
+ { \__fontspec_pass_args:nnn { \__xepersian_deflatinfont:Nnn #1 } {#2} {#3} }
+
+\cs_new:Nn \__xepersian_deflatinfont:Nnn
  {
-  \fontspec_set_family:cnn { g__fontspec_ \cs_to_str:N #1 _family } {Mapping=tex-text,#2,#4} {#3}
+  \fontspec_set_family:cnn { g__fontspec_ \cs_to_str:N #1 _family } {Mapping=tex-text,#2} {#3}
   \use:x
    {
     \exp_not:N \DeclareRobustCommand \exp_not:N #1
@@ -179,39 +191,57 @@ Persian typesetting in XeLaTeX]
 \DeclareTextFontCommand{\textnavar}{\navarfamily}
 \DeclareTextFontCommand{\textpook}{\pookfamily}
 \DeclareTextFontCommand{\textsayeh}{\sayehfamily}
-\DeclareDocumentCommand \setpersiansansfont { O{} m O{} }
+\DeclareDocumentCommand \setpersiansansfont { o m }
+ { \__fontspec_pass_args:nnn \__xepersian_setpersiansansfont:nn {#1} {#2} }
+
+\cs_new:Nn \__xepersian_setpersiansansfont:nn
  {
-  \fontspec_set_family:Nnn \persiansfdefault {Script=Parsi,Language=Parsi,Mapping=parsidigits,#1,#3}{#2}
+  \fontspec_set_family:Nnn \persiansfdefault {Script=Parsi,Language=Parsi,Mapping=parsidigits,#1}{#2}
   \normalfont
   \ignorespaces
  }
-\DeclareDocumentCommand \setpersianmonofont { O{} m O{} }
+\DeclareDocumentCommand \setpersianmonofont { o m }
+ { \__fontspec_pass_args:nnn \__xepersian_setpersianmonofont:nn {#1} {#2} }
+
+\cs_new:Nn \__xepersian_setpersianmonofont:nn
  {
-  \fontspec_set_family:Nnn \persianttdefault {Script=Parsi,Language=Parsi,Mapping=parsidigits,#1,#3}{#2}
+  \fontspec_set_family:Nnn \persianttdefault {Script=Parsi,Language=Parsi,Mapping=parsidigits,#1}{#2}
   \normalfont
   \ignorespaces
  }
-\DeclareDocumentCommand \setnavarfont { O{} m O{} }
+\DeclareDocumentCommand \setnavarfont { o m }
+ { \__fontspec_pass_args:nnn \__xepersian_setnavarfont:nn {#1} {#2} }
+
+\cs_new:Nn \__xepersian_setnavarfont:nn
  {
-  \fontspec_set_family:Nnn \navardefault {Script=Parsi,Language=Parsi,Mapping=parsidigits,#1,#3}{#2}
+  \fontspec_set_family:Nnn \navardefault {Script=Parsi,Language=Parsi,Mapping=parsidigits,#1}{#2}
   \normalfont
   \ignorespaces
  }
-\DeclareDocumentCommand \setpookfont { O{} m O{} }
+\DeclareDocumentCommand \setpookfont { o m }
+ { \__fontspec_pass_args:nnn \__xepersian_setpookfont:nn {#1} {#2} }
+
+\cs_new:Nn \__xepersian_setpookfont:nn
  {
-  \fontspec_set_family:Nnn \pookdefault {Script=Parsi,Language=Parsi,Mapping=parsidigits,#1,#3}{#2}
+  \fontspec_set_family:Nnn \pookdefault {Script=Parsi,Language=Parsi,Mapping=parsidigits,#1}{#2}
   \normalfont
   \ignorespaces
  }
-\DeclareDocumentCommand \setsayehfont  { O{} m O{} }
+\DeclareDocumentCommand \setsayehfont { o m }
+ { \__fontspec_pass_args:nnn \__xepersian_setsayehfont:nn {#1} {#2} }
+
+\cs_new:Nn \__xepersian_setsayehfont:nn
  {
-  \fontspec_set_family:Nnn \sayehdefault {Script=Parsi,Language=Parsi,Mapping=parsidigits,#1,#3}{#2}
+  \fontspec_set_family:Nnn \sayehdefault {Script=Parsi,Language=Parsi,Mapping=parsidigits,#1}{#2}
   \normalfont
   \ignorespaces
  }
-\DeclareDocumentCommand \setiranicfont { O{} m O{} }
+\DeclareDocumentCommand \setiranicfont { o m }
+ { \__fontspec_pass_args:nnn \__xepersian_setiranicfont:nn {#1} {#2} }
+
+\cs_new:Nn \__xepersian_setiranicfont:nn
  {
-  \fontspec_set_family:Nnn \iranicdefault {Script=Parsi,Language=Parsi,Mapping=parsidigits,#1,#3}{#2}
+  \fontspec_set_family:Nnn \iranicdefault {Script=Parsi,Language=Parsi,Mapping=parsidigits,#1}{#2}
   \normalfont
   \ignorespaces
  }
@@ -614,14 +644,12 @@ number is 999,999,999.}%
 }{}}
 \@ifdefinitionfileloaded{loadingorder-xetex-bidi}{\input{loadingorder-xepersian.def}}{}
 \@ifpackageloaded{appendix}{\input{appendix-xepersian.def}}{}
-\@ifpackageloaded{fontspec-xetex}{\input{fontspec-xetex-xepersian.def}}{}
 \@ifpackageloaded{listings}{\input{listings-xepersian.def}}{}
 \@ifpackageloaded{algorithmic}{\input{algorithmic-xepersian.def}}{}
 \@ifpackageloaded{algorithm}{\input{algorithm-xepersian.def}}{}
 \@ifpackageloaded{backref}{\input{backref-xepersian.def}}{}
 \@ifpackageloaded{flowfram}{\input{flowfram-xepersian.def}}{}
-\@ifpackageloaded{bidi}{\input{footnote-xepersian.def}}{}
-\@ifpackageloaded{bidituftesidenote}{\input{bidituftesidenote-xepersian.def}}{}
+\@ifpackageloaded{bidituftesidenote}{\input{bidituftesidenote-xepersian.def}}{\input{footnote-xepersian.def}}
 \@ifpackageloaded{breqn}{\input{breqn-xepersian.def}}{}
 \@ifpackageloaded{enumerate}{\input{enumerate-xepersian.def}}{}
 \@ifpackageloaded{framed}{\input{framed-xepersian.def}}{}
-- 
cgit v1.2.3

