summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex/xepersian/xepersian.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/xepersian/xepersian.sty')
-rw-r--r--Master/texmf-dist/tex/xelatex/xepersian/xepersian.sty59
1 files changed, 53 insertions, 6 deletions
diff --git a/Master/texmf-dist/tex/xelatex/xepersian/xepersian.sty b/Master/texmf-dist/tex/xelatex/xepersian/xepersian.sty
index c271c433cab..f3dcdfcfb28 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{9425}
+%% \CheckSum{9517}
%% \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{v19.5}
-\def\xepersiandate{2017/12/19}
+\def\xepersianversion{v19.7}
+\def\xepersiandate{2017/12/20}
\ProvidesPackage{xepersian}[\xepersiandate\space \xepersianversion\space
Persian typesetting in XeLaTeX]
\RequirePackage{fontspec}
@@ -357,19 +357,31 @@ Persian typesetting in XeLaTeX]
\ExplSyntaxOff
\def\resetlatinfont{%
+\let\@xepersian@@fontsize@scale\xepersian@@fontsize@scale%
+\def\xepersian@@fontsize@scale{%
+ \strip@pt\dimexpr 1pt * \dimexpr
+ \xepersian@@latin@fontsize@scale pt\relax
+ / \dimexpr \@xepersian@@fontsize@scale pt\relax\relax
+}%
\@nonlatinfalse%
\let\normalfont\latinfont%
\let\reset@font\normalfont%
\latinfont%
\fontsize\f@size\f@baselineskip%
-\selectfont}
+\selectfont%
+\let\xepersian@@fontsize@scale\xepersian@@latin@fontsize@scale%
+}
\def\setpersianfont{%
+\let\@xepersian@@fontsize@scale\xepersian@@fontsize@scale%
+\let\xepersian@@fontsize@scale\@ne%
\@nonlatintrue%
\let\normalfont\persianfont%
\let\reset@font\normalfont%
\persianfont%
\fontsize\f@size\f@baselineskip%
-\selectfont}
+\selectfont%
+\let\xepersian@@fontsize@scale\@xepersian@@fontsize@scale%
+}
\bidi@newrobustcmd*{\lr}[1]{\LRE{\resetlatinfont#1}}
\bidi@newrobustcmd*{\rl}[1]{\RLE{\setpersianfont#1}}
\def\latin{\LTR\LatinAlphs\@RTL@footnotefalse\resetlatinfont}
@@ -944,10 +956,18 @@ number is 999,999,999.}%
{#1}
}
+\DeclareOptionX{mathfontsizescale}{%
+ \def\xepersian@@math@fontsize@scale{#1}%
+ }
+
\DeclareOptionX{fontsizescale}{%
\def\xepersian@@fontsize@scale{#1}%
}
+\DeclareOptionX{latinfontsizescale}{%
+ \def\xepersian@@latin@fontsize@scale{#1}%
+ }
+
\define@choicekey{xepersian.sty}{computeautoilg}[\xepersian@tempa\xepersian@tempb]{on,off}[on]{%
\ifcase\xepersian@tempb\relax
\@xepersian@@computeautoilgtrue
@@ -977,7 +997,9 @@ number is 999,999,999.}%
footnoterule=automatic,
abjadvariant=two,
DetectColumn=off,
- fontsizescale=\@ne
+ fontsizescale=\@ne,
+ latinfontsizescale=\@ne,
+ mathfontsizescale=\@ne
}
\ProcessOptionsX
@@ -991,6 +1013,31 @@ number is 999,999,999.}%
\@tempdimb\xepersian@@fontsize@scale\dimexpr#2pt\relax
}{}{}
+\newcommand*{\xepersian@@update@math@fontsize}[1]{%
+ \strip@pt\dimexpr\xepersian@@math@fontsize@scale
+ \dimexpr 1pt * \dimexpr #1 pt\relax /
+ \dimexpr \xepersian@@fontsize@scale pt\relax
+ \relax\relax
+}
+
+\bidi@patchcmd{\getanddefine@fonts}{%
+ \xdef\font@name{\csname \string#2/\tf@size\endcsname}%
+}{%
+ \xdef\font@name{\csname \string#2/\xepersian@@update@math@fontsize\tf@size\endcsname}%
+}{}{}
+
+\bidi@patchcmd{\getanddefine@fonts}{%
+ \xdef\font@name{\csname \string#2/\sf@size\endcsname}%
+}{%
+ \xdef\font@name{\csname \string#2/\xepersian@@update@math@fontsize\sf@size\endcsname}%
+}{}{}
+
+\bidi@patchcmd{\getanddefine@fonts}{%
+ \xdef\font@name{\csname \string#2/\ssf@size\endcsname}%
+}{%
+ \xdef\font@name{\csname \string#2/\xepersian@@update@math@fontsize\ssf@size\endcsname}%
+}{}{}
+
\if@xepersian@@computeautoilg
\bidi@patchcmd{\set@fontsize}{%
\baselineskip\f@baselineskip\relax