diff options
author | Karl Berry <karl@freefriends.org> | 2020-05-31 21:12:25 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-05-31 21:12:25 +0000 |
commit | bdb7cf7bcce7df41192e60afe8dc97f81a714044 (patch) | |
tree | 6cf81eb83858d30a39d4808407d0505d16f35b0b /Master/texmf-dist | |
parent | 6edc5f76fda7bebde980ba28e45866598a951d8f (diff) |
xepersian-hm (31may20)
git-svn-id: svn://tug.org/texlive/trunk@55365 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
16 files changed, 466 insertions, 210 deletions
diff --git a/Master/texmf-dist/doc/xelatex/xepersian-hm/INSTALL.txt b/Master/texmf-dist/doc/xelatex/xepersian-hm/INSTALL.txt index 3176048e778..340d9819aac 100644 --- a/Master/texmf-dist/doc/xelatex/xepersian-hm/INSTALL.txt +++ b/Master/texmf-dist/doc/xelatex/xepersian-hm/INSTALL.txt @@ -29,10 +29,11 @@ Don't forget to run 'texconfig rehash' afterwards. The example files kashida-glyph-example.tex - kashida-hrule-example.tex + kashida-leaders-glyph-example.tex + kashida-leaders-hrule-example.tex kashida-xep-XB-example.tex illustrate some features of the package and are an addendum to the main documentation xepersian-hm.pdf. -Thats it. +That's it. diff --git a/Master/texmf-dist/doc/xelatex/xepersian-hm/kashida-glyph-example.pdf b/Master/texmf-dist/doc/xelatex/xepersian-hm/kashida-glyph-example.pdf Binary files differindex 9e65b1261e9..8ea503d2210 100644 --- a/Master/texmf-dist/doc/xelatex/xepersian-hm/kashida-glyph-example.pdf +++ b/Master/texmf-dist/doc/xelatex/xepersian-hm/kashida-glyph-example.pdf diff --git a/Master/texmf-dist/doc/xelatex/xepersian-hm/kashida-glyph-example.tex b/Master/texmf-dist/doc/xelatex/xepersian-hm/kashida-glyph-example.tex index 4bcbcfc66ca..1cf5a029c52 100644 --- a/Master/texmf-dist/doc/xelatex/xepersian-hm/kashida-glyph-example.tex +++ b/Master/texmf-dist/doc/xelatex/xepersian-hm/kashida-glyph-example.tex @@ -29,6 +29,9 @@ \defpersianfont\HMXKayhanOb[Scale=4.5]{HM XKayhanOb Oblique} \defpersianfont\HMXKayhanOl[Scale=4.5]{HM XKayhan Outline} \defpersianfont\HMXKayhanSd[Scale=4.5]{HM XKayhan Shadow} +\defpersianfont\HMXKayhanPo[Scale=4.5]{HM XKayhan Pook} +\defpersianfont\HMXKayhanSa[Scale=4.5]{HM XKayhan Sayeh} +\defpersianfont\HMXKayhanNa[Scale=4.5]{HM XKayhan Navaar} % \def\SampleText{\discouragebadlinebreaks[8][0.14 em plus 5.5 em]{ % راهی جایی تابی چاپی چاههی تلاشهایی @@ -107,4 +110,22 @@ {\HMXKayhanSd \SampleText} +\newpage + +\KashidaOn{\hfill\lr{(Kashida On, Pook)}\hfill} + +{\HMXKayhanPo \SampleText} + +\newpage + +\KashidaOn{\hfill\lr{(Kashida On, Sayeh)}\hfill} + +{\HMXKayhanSa \SampleText} + +\newpage + +\KashidaOn{\hfill\lr{(Kashida On, Navaar)}\hfill} + +{\HMXKayhanNa \SampleText} + \end{document} diff --git a/Master/texmf-dist/doc/xelatex/xepersian-hm/kashida-hrule-example.pdf b/Master/texmf-dist/doc/xelatex/xepersian-hm/kashida-hrule-example.pdf Binary files differdeleted file mode 100644 index 5578b52549b..00000000000 --- a/Master/texmf-dist/doc/xelatex/xepersian-hm/kashida-hrule-example.pdf +++ /dev/null diff --git a/Master/texmf-dist/doc/xelatex/xepersian-hm/kashida-leaders-glyph-example.pdf b/Master/texmf-dist/doc/xelatex/xepersian-hm/kashida-leaders-glyph-example.pdf Binary files differnew file mode 100644 index 00000000000..6f4530ae89a --- /dev/null +++ b/Master/texmf-dist/doc/xelatex/xepersian-hm/kashida-leaders-glyph-example.pdf diff --git a/Master/texmf-dist/doc/xelatex/xepersian-hm/kashida-hrule-example.tex b/Master/texmf-dist/doc/xelatex/xepersian-hm/kashida-leaders-glyph-example.tex index 48894d1413c..bad9ac6a55e 100644 --- a/Master/texmf-dist/doc/xelatex/xepersian-hm/kashida-hrule-example.tex +++ b/Master/texmf-dist/doc/xelatex/xepersian-hm/kashida-leaders-glyph-example.tex @@ -5,7 +5,7 @@ % \textheight=620pt % \usepackage[Kashida]{xepersian} % Fails % \usepackage{xepersian-hm} % Succeeds -\usepackage[Kashida=hrule,kashidastretch=0.14 em plus 0.5 em]{xepersian-hm} % Succeeds +\usepackage[Kashida=leaders+glyph,kashidastretch=0.14 em plus 0.5 em]{xepersian-hm} % Succeeds % \usepackage[Kashida=hrule,kashidastretch=0.14 em plus 5.5 em]{xepersian-hm} % Succeeds % \usepackage[Kashida=glyph,linebreakpenalty=8,kashidastretch=0.14 em plus 5.5 em]{xepersian-hm} % Succeeds % \usepackage[Kashida=glyph,kashidastretch=kayhan]{xepersian-hm} % Succeeds @@ -29,6 +29,9 @@ \defpersianfont\HMXKayhanOb[Scale=4.5]{HM XKayhanOb Oblique} \defpersianfont\HMXKayhanOl[Scale=4.5]{HM XKayhan Outline} \defpersianfont\HMXKayhanSd[Scale=4.5]{HM XKayhan Shadow} +\defpersianfont\HMXKayhanPo[Scale=4.5]{HM XKayhan Pook} +\defpersianfont\HMXKayhanSa[Scale=4.5]{HM XKayhan Sayeh} +\defpersianfont\HMXKayhanNa[Scale=4.5]{HM XKayhan Navaar} % \def\SampleText{\discouragebadlinebreaks[8][0.14 em plus 5.5 em]{ % راهی جایی تابی چاپی چاههی تلاشهایی @@ -106,4 +109,22 @@ {\HMXKayhanSd \SampleText} +\newpage + +\KashidaOn{\hfill\lr{(Kashida On, Pook)}\hfill} + +{\HMXKayhanPo \SampleText} + +\newpage + +\KashidaOn{\hfill\lr{(Kashida On, Sayeh)}\hfill} + +{\HMXKayhanSa \SampleText} + +\newpage + +\KashidaOn{\hfill\lr{(Kashida On, Navaar)}\hfill} + +{\HMXKayhanNa \SampleText} + \end{document} diff --git a/Master/texmf-dist/doc/xelatex/xepersian-hm/kashida-leaders-hrule-example.pdf b/Master/texmf-dist/doc/xelatex/xepersian-hm/kashida-leaders-hrule-example.pdf Binary files differnew file mode 100644 index 00000000000..51f7f1b0249 --- /dev/null +++ b/Master/texmf-dist/doc/xelatex/xepersian-hm/kashida-leaders-hrule-example.pdf diff --git a/Master/texmf-dist/doc/xelatex/xepersian-hm/kashida-leaders-hrule-example.tex b/Master/texmf-dist/doc/xelatex/xepersian-hm/kashida-leaders-hrule-example.tex new file mode 100644 index 00000000000..0045ebe69e3 --- /dev/null +++ b/Master/texmf-dist/doc/xelatex/xepersian-hm/kashida-leaders-hrule-example.tex @@ -0,0 +1,130 @@ +% \PassOptionsToPackage{debugfootnotedirection=off,localise=off}{xepersian} % Load xepersian with a few options +\documentclass{report} +% \textwidth=345.0pt +% \textheight=550.0pt +% \textheight=620pt +% \usepackage[Kashida]{xepersian} % Fails +% \usepackage{xepersian-hm} % Succeeds +\usepackage[Kashida=leaders+hrule,kashidastretch=0.14 em plus 0.5 em]{xepersian-hm} % Succeeds +% \usepackage[Kashida=hrule,kashidastretch=0.14 em plus 5.5 em]{xepersian-hm} % Succeeds +% \usepackage[Kashida=glyph,linebreakpenalty=8,kashidastretch=0.14 em plus 5.5 em]{xepersian-hm} % Succeeds +% \usepackage[Kashida=glyph,kashidastretch=kayhan]{xepersian-hm} % Succeeds +% \usepackage[Kashida,kashidastretch=0.14 em plus 0.5 em]{xepersian-hm} % Succeeds +% \usepackage[Kashida,kashidastretch=noskip]{xepersian-hm} % Succeeds +% \usepackage[Kashida,kashidastretch=default]{xepersian-hm} % Succeeds +% \usepackage[Kashida,kashidastretch=kayhan]{xepersian-hm} % Succeeds +% \usepackage[Kashida,kashidastretch=khorramshahr]{xepersian-hm} % Succeeds + +% \settextfont[Scale=4.5,Colour=darkgray]{XB Kayhan} +\settextfont[Scale=4.5]{HM XKayhan} +% \settextfont[Scale=4.5,Colour=darkgray]{HM XNiloofar} +% \settextfont[Scale=4.5,Colour=darkgray]{HM XYas} +% \settextfont[Scale=4.5,Colour=darkgray]{HM XZar} +% \settextfont[Scale=1,Colour=darkgray]{HM XKayhan} + +% \setlatintextfont[Scale=2.5,Colour=0000FF]{XB Kayhan} +\setlatintextfont[Scale=1.5,Colour=0000FF]{HM XKayhan} + +\defpersianfont\HMXKayhanIt[Scale=4.5]{HM XKayhan Italic} +\defpersianfont\HMXKayhanOb[Scale=4.5]{HM XKayhanOb Oblique} +\defpersianfont\HMXKayhanOl[Scale=4.5]{HM XKayhan Outline} +\defpersianfont\HMXKayhanSd[Scale=4.5]{HM XKayhan Shadow} +\defpersianfont\HMXKayhanPo[Scale=4.5]{HM XKayhan Pook} +\defpersianfont\HMXKayhanSa[Scale=4.5]{HM XKayhan Sayeh} +\defpersianfont\HMXKayhanNa[Scale=4.5]{HM XKayhan Navaar} + +% \def\SampleText{\discouragebadlinebreaks[8][0.14 em plus 5.5 em]{ +% راهی جایی تابی چاپی چاههی تلاشهایی +% شتابهایی تابی چاپی راهی تلاشهــایی +% که کتابهایی که کلاههایی که کتابهایی }} + +% \def\SampleText{\discouragebadlinebreaks[10][0.12 em plus 5.5 em]{ +% راهی جایی تابی چاپی چاههی تلاشهایی +% شتابهایی تابی چاپی راهی تلاشهــایی +% که کتابهایی که کلاههایی که کتابهایی }} + +% \def\SampleText{\discouragebadlinebreaks{ +% راهی جایی تابی چاپی چاههی تلاشهایی +% شتابهایی تابی چاپی راهی تلاشهــایی +% که کتابهایی که کلاههایی که کتابهایی }} + +\def\SampleText{ + راهی جایی تابی چاپی چاههی تلاشهایی + شتابهایی تابی چاپی راهی تلاشهــایی + که کتابهایی که کلاههایی که کتابهایی } + +\setlength\parindent{0pt} +\pagestyle{empty} + +\begin{document} + +\begin{latin} +\begin{center} +\Huge\textsf{xepersian-hm}\vspace{20pt}\\ Example of Use\vspace{20pt}\\ \texttt{Kashida=hrule} \vspace{40pt} + +{\Large +\begin{tabular}{ll} + \textsf{Font:} & \textsf{HM XKayhan} \\ + \textsf{Font Scale:} & \texttt{4.5} \\ + \textsf{kashidastretch:} & \texttt{0.14em plus 0.5em} +\end{tabular} +} +\end{center} + +\end{latin} + +\newpage + +\KashidaOff{\hfill\lr{(Kashida Off, Regular)}\hfill} + +\SampleText + +\newpage + +\KashidaOn{\hfill\lr{(Kashida On, Regular)}\hfill} + +\SampleText + +\newpage + +\KashidaOn{\hfill\lr{(Kashida On, Italic)}\hfill} + +{\HMXKayhanIt \SampleText} + +\newpage + +\KashidaOn{\hfill\lr{(Kashida On, Oblique)}\hfill} + +{\HMXKayhanOb \SampleText} + +\newpage + +\KashidaOn{\hfill\lr{(Kashida On, Outline)}\hfill} + +{\HMXKayhanOl \SampleText} + +\newpage + +\KashidaOn{\hfill\lr{(Kashida On, Shadow)}\hfill} + +{\HMXKayhanSd \SampleText} + +\newpage + +\KashidaOn{\hfill\lr{(Kashida On, Pook)}\hfill} + +{\HMXKayhanPo \SampleText} + +\newpage + +\KashidaOn{\hfill\lr{(Kashida On, Sayeh)}\hfill} + +{\HMXKayhanSa \SampleText} + +\newpage + +\KashidaOn{\hfill\lr{(Kashida On, Navaar)}\hfill} + +{\HMXKayhanNa \SampleText} + +\end{document} diff --git a/Master/texmf-dist/doc/xelatex/xepersian-hm/kashida-xep-XB-example.pdf b/Master/texmf-dist/doc/xelatex/xepersian-hm/kashida-xep-XB-example.pdf Binary files differindex 5e022cdf557..098cef1e4f0 100644 --- a/Master/texmf-dist/doc/xelatex/xepersian-hm/kashida-xep-XB-example.pdf +++ b/Master/texmf-dist/doc/xelatex/xepersian-hm/kashida-xep-XB-example.pdf diff --git a/Master/texmf-dist/doc/xelatex/xepersian-hm/kashida-xep-XB-example.tex b/Master/texmf-dist/doc/xelatex/xepersian-hm/kashida-xep-XB-example.tex index f623cb26e6a..6e5b13ef8bb 100644 --- a/Master/texmf-dist/doc/xelatex/xepersian-hm/kashida-xep-XB-example.tex +++ b/Master/texmf-dist/doc/xelatex/xepersian-hm/kashida-xep-XB-example.tex @@ -7,6 +7,9 @@ \defpersianfont\XBKayhanOb[Scale=4.5]{XB Zar Oblique} \defpersianfont\XBKayhanOl[Scale=4.5]{XB Kayhan Pook} \defpersianfont\XBKayhanSd[Scale=4.5]{XB Kayhan Sayeh} +\defpersianfont\XBKayhanPo[Scale=4.5]{XB Kayhan Pook} +\defpersianfont\XBKayhanSa[Scale=4.5]{XB Kayhan Sayeh} +\defpersianfont\XBKayhanNa[Scale=4.5]{XB Kayhan Navaar} \def\SampleText{ راهی جایی تابی چاپی چاههی تلاشهایی @@ -68,4 +71,22 @@ {\XBKayhanSd \SampleText} +\newpage + +\KashidaOn{\hfill\lr{(Kashida On, Pook)}\hfill} + +{\XBKayhanPo \SampleText} + +\newpage + +\KashidaOn{\hfill\lr{(Kashida On, Sayeh)}\hfill} + +{\XBKayhanSa \SampleText} + +\newpage + +\KashidaOn{\hfill\lr{(Kashida On, Navaar)}\hfill} + +{\XBKayhanNa \SampleText} + \end{document} diff --git a/Master/texmf-dist/doc/xelatex/xepersian-hm/xepersian-hm-doc.ltx b/Master/texmf-dist/doc/xelatex/xepersian-hm/xepersian-hm-doc.ltx index e1145052290..535b6dedd41 100644 --- a/Master/texmf-dist/doc/xelatex/xepersian-hm/xepersian-hm-doc.ltx +++ b/Master/texmf-dist/doc/xelatex/xepersian-hm/xepersian-hm-doc.ltx @@ -27,7 +27,7 @@ } } -\date{Released \quad 2020-05-20 \quad v0.5f} +\date{Released \quad 2020-05-31 \quad v1.0a} \let\tmpthepage\thepage \renewcommand{\thepage}{\lr{\Large\textbf\tmpthepage}} @@ -43,9 +43,14 @@ and \mbox{\textsf{X Series 2}} available at \href{http://wiki.irmug.com/index.php/X_Series_2}{\texttt{http://wiki.irmug.com/index.php/X\_Series\_2}}. The \textsf{xepersian-hm} package fixes these problems. -The files \texttt{kashida-glyph-example.tex} and \texttt{kashida-hrule-example.tex} -in the directory \texttt{texmf-dist/doc/xelatex/xepersian-hm/} can be used as simple -examples of the usage of the package. +The following files in the directory \texttt{texmf-dist/doc/xelatex/xepersian-hm/} can be used as simple +examples of the usage of the package: +\newcounter{beanx} + \begin{list}{\arabic{beanx}.}{\usecounter{beanx}\setlength{\rightmargin}{\leftmargin}} + \item \texttt{kashida-glyph-example.tex} + \item \texttt{kashida-leaders-glyph-example.tex} + \item \texttt{kashida-leaders-hrule-example.tex} +\end{list} Please use the Bitbucket issue tracker: \href{https://bitbucket.org/dma8hm1334/xepersian-hm/issues}{\textsf{https://bitbucket.org/dma8hm1334/\linebreak[4]xepersian-hm/issues}} @@ -59,7 +64,7 @@ which I cannot make time to fix. Kashida is one of the most important features that must be included in any Persian typesetter. In xepersian this feature is implemented but with some -problems. These problems along withe fixes in xepersian-hm are briefly: +problems. These problems along with the fixes in \textsf{xepersian-hm} are briefly: \newcounter{bean} \begin{list}{P-\Roman{bean}}{\usecounter{bean}\setlength{\rightmargin}{\leftmargin}} @@ -117,7 +122,7 @@ a variety of options available to these packages, please see the \begin{figure} \centerline{\fbox{\includegraphics[scale=1]{doc-samples-xep.pdf}}} - \caption{Package: \textsf{xeprsian}, Font: \textsf{XB Kayhan}, \textsf{Scale=4.5}, \textsf{Kashida=0n}} + \caption{Package: \textsf{xeprsian}, Font: \textsf{XB Kayhan}, \textsf{Scale=4.5}, \textsf{Kashida=On}} \label{fig:xepersian-XB} \end{figure} @@ -143,16 +148,16 @@ so you may only pass options to the package using the command \PassOptionsToPackage{debugfootnotedirection=off,localise=off}{xepersian} \documentclass{report} \usepackage{xcolor} -\usepackage[Kashida,kashidastretch=0.14 em plus 0.5 em]{xepersian-hm} +\usepackage[Kashida=leaders+glyph,kashidastretch=0.14 em plus 0.5 em]{xepersian-hm} \end{verbatim} The options available in \textsf{xepersian-hm} are: \begin{itemize} \item \texttt{Kashida}: \\ - which implements kashida feature with two possible values: + which implements kashida feature with three possible values: \begin{itemize} \item \texttt{glyph}: \\ - which uses the \texttt{Kashida} character to stretch the text. + which uses the \texttt{kashida} character to stretch the text. With this option you should run \texttt{xelatex} thrice. For example: \\ \texttt{rm -f kashida-example.aux \\ @@ -161,19 +166,38 @@ The options available in \textsf{xepersian-hm} are: xelatex kashida-example.tex} Please note that this feature is still experimental and is not regarded as stable. - If you are going to use this option be ready for unpredictable results. Also, note - that the value of \texttt{Kashida} is mandatory. + If you are going to use this option be ready for unpredictable results. + + Also note that with this option, for each gap which is to be filled with kashida, + some commands, current position on the page, and references are saved in the + \texttt{\bslash jobname.aux} file and if the text is long, the file size may get + too large. + + \item \texttt{leaders+glyph}: \\ + which uses kashida glyph leaders to stretch the text. + Please note that the option `Kashida=leaders+glyph' is currently only + supported by \mbox{\textsf{HM Series}} fonts available at + \href{https://dma8hm1334.bitbucket.io}{\texttt{https://dma8hm1334.bitbucket.io}}. + If you know of any other font that supports this option, please + let me know to add it to the list of corresponding fonts. + + Contrary to the option \texttt{Kashida=glyph}, in this case nothing is saved + in \texttt{.aux} files. - \item \texttt{hrule}: \\ - which uses a horizontal rule (\verb|\hrule|) to stretch the text. + \item \texttt{leaders+hrule}: \\ + which uses horizontal rule (\verb|\hrule|) leaders to stretch the text. \end{itemize} - For example \texttt{Kashida=glyph} inserts a stretched \texttt{Kashida} glyph where ever it is needed. + Also, please note that the value of \texttt{Kashida} is mandatory. + For example \texttt{Kashida=glyph} inserts a stretched \texttt{kashida} glyph + and \linebreak[4] \texttt{Kashida=leaders+glyph} inserts \texttt{kashida} leaders wherever + it is needed. \item \texttt{linebreakpenalty}: \\ which specifies the amount of penalty for preventing bad line-breaking. - You may strictly specify the value of this option. For example \texttt{'linebreakpenalty=8'} or you - may use the default values. The available default values of penalties which are put into the + You may strictly specify the value of this option. For example you may either set % \linebreak[4] + \texttt{'linebreakpenalty=8'} or + use the default values. The available default values of penalties which are put into the horizontal list output are the negative of the followings: \begin{longtable}{ll} @@ -254,10 +278,12 @@ The options available in \textsf{xepersian-hm} are: {\it text} may not contain paragraph breaks. This command puts a penalty after each Persian word. - The optional arguments \texttt{linebreakpenalty} and \texttt{kashidastretch} locally specify the value of the penalty and the amount - of extra stretching for some combinations of characters respectively as discussed previously. For example: + The optional arguments \texttt{linebreakpenalty} and \texttt{kashidastretch} locally + specify the value of the penalty and the amount of extra stretching for some + combinations of characters respectively as discussed previously. For example + you may set this option as follows: - \texttt{\bslash discouragebadlinebreaks[9][0.12 em plus 0.5 em]\{\dots\}} + \texttt{\bslash discouragebadlinebreaks[9][0.12 em plus 0.5 em]\{$\dots\,$\}} \end{description} \section{Important notes} @@ -266,7 +292,7 @@ The options available in \textsf{xepersian-hm} are: \item Kashida and ligatures: The method used to implement kashida feature breaks a ligature if it is applied to the letters which are joined to form - the ligature. This is fixed in \textsf{xepersian-hm}, but it is still immature. + the ligature. This is fixed in \textsf{xepersian-hm}, but it is not well developed yet. \end{description} \end{latin} diff --git a/Master/texmf-dist/doc/xelatex/xepersian-hm/xepersian-hm-doc.pdf b/Master/texmf-dist/doc/xelatex/xepersian-hm/xepersian-hm-doc.pdf Binary files differindex 161c34f012d..9df6063331e 100644 --- a/Master/texmf-dist/doc/xelatex/xepersian-hm/xepersian-hm-doc.pdf +++ b/Master/texmf-dist/doc/xelatex/xepersian-hm/xepersian-hm-doc.pdf diff --git a/Master/texmf-dist/doc/xelatex/xepersian-hm/xepersian-hm.pdf b/Master/texmf-dist/doc/xelatex/xepersian-hm/xepersian-hm.pdf Binary files differindex c244dee46f6..610320c3e89 100644 --- a/Master/texmf-dist/doc/xelatex/xepersian-hm/xepersian-hm.pdf +++ b/Master/texmf-dist/doc/xelatex/xepersian-hm/xepersian-hm.pdf diff --git a/Master/texmf-dist/source/xelatex/xepersian-hm/xepersian-hm.dtx b/Master/texmf-dist/source/xelatex/xepersian-hm/xepersian-hm.dtx index 582a05d6388..0daba1b3e04 100644 --- a/Master/texmf-dist/source/xelatex/xepersian-hm/xepersian-hm.dtx +++ b/Master/texmf-dist/source/xelatex/xepersian-hm/xepersian-hm.dtx @@ -67,7 +67,7 @@ make time to fix. % }^^A % } % -% \date{Released \quad 2020-05-20 \quad v0.5f} +% \date{Released \quad 2020-05-31 \quad v1.0a} % % \maketitle % @@ -96,7 +96,9 @@ make time to fix. \RequirePackage{zref-savepos}[2020-03-03] \RequirePackage{xepersian} \ExplSyntaxOn -\ProvidesExplPackage {xepersian-hm} {2020-05-20} {0.5f} { Fixes~issues~in~xepersian~package } +\ProvidesExplPackage {xepersian-hm} {2020-05-31} {1.0a} { Fixes~issues~in~xepersian~package } + +\box_new:N \l_xephm_ksh_box \int_const:Nn \c_xephm_ksh_int {"0640} % kashida \int_const:Nn \c_xephm_lrm_int {"200E} % left-right-mark @@ -125,6 +127,9 @@ make time to fix. \tl_new:N \l_xephm_main_font_full_tl \tl_new:N \l_xephm_main_font_name_tl +\tl_new:N \l_xephm_font_full_tl +\tl_new:N \l_xephm_font_name_tl + \tl_new:N \l_xephm_skip_default_tl \tl_new:N \l_xephm_active_ligs_tl @@ -144,7 +149,8 @@ make time to fix. \int_set:Nn \l_xephm_max_penalty_int { 10000 } \tl_set:Nn \l_xephm_stretch_glyph_tl { glyph } -\tl_set:Nn \l_xephm_stretch_hrule_tl { hrule } +\tl_set:Nn \l_xephm_stretch_leaders_glyph_tl { leaders+glyph } +\tl_set:Nn \l_xephm_stretch_leaders_hrule_tl { leaders+hrule } \tl_set:Nn \l_xephm_fnt_kayhan_tl { kayhan } \tl_set:Nn \l_xephm_fnt_kayhannavaar_tl { kayhannavaar } @@ -211,7 +217,7 @@ make time to fix. \msg_new:nnn { xepersian-hm } { error-kashida-character-is-not-available-in-the-main-font } { - Sorry,~ kashida~ character~ is~ not~ available~ in~ the~ main~ font~! + Sorry,~ kashida~ character~ is~ not~ available~ in~ the~ main~ font~#1! } \msg_new:nnn { xepersian-hm } { error-value-not-available-for-kashida-option } @@ -230,6 +236,16 @@ make time to fix. and~ is~ not~ regarded~ as~ stable. } +\msg_new:nnn { xepersian-hm } { hm-series-font-not-found } + { + Either~ the~ font~`#1'~ is~ not~ installed~ on~ your~ system~ or~ does~ not~ + belong~ to~ HM~Series~fonts.~ + Please~ note~ that~ the~ option~ `Kashida=leaders+glyph'~ is~ currently~ only~ + supported~ by~ HM~Series~fonts.~ + If~ you~ know~ of~ any~ other~ font~ that~ supports~ this~ option,~ please~ + let~ me~ know~ to~ add~ it~ to~ the~ list~ of~ corresponding~ fonts.~ + } + \keys_define:nn { xepersian-hm } { Kashida .code:n = @@ -239,7 +255,8 @@ make time to fix. { \l_xephm_stretch_glyph_tl { - \tl_set:Nn \l_xephm_gap_filler_tl { \l_xephm_stretch_glyph_tl } + \msg_warning:nnn { xepersian-hm } { warning-experimental-feature } { Kashida=glyph } + \tl_set:Nx \l_xephm_gap_filler_tl { \l_xephm_stretch_glyph_tl } \AtBeginDocument { \tl_set:Nx \l_xephm_main_font_full_tl { \tex_fontname:D \tex_the:D \tex_font:D } @@ -248,13 +265,17 @@ make time to fix. \int_set:Nn \l_xephm_kashida_slot_int { \xetex_charglyph:D \c_xephm_ksh_int } \int_compare:nT { \l_xephm_kashida_slot_int = \c_zero_int } { - \msg_error:nn { xepersian-hm } { error-kashida-character-is-not-available-in-the-main-font } + \msg_error:nnx { xepersian-hm } { error-kashida-character-is-not-available-in-the-main-font } { \l_xephm_main_font_name_tl } } } } - \l_xephm_stretch_hrule_tl + \l_xephm_stretch_leaders_glyph_tl + { + \tl_set:Nx \l_xephm_gap_filler_tl { \l_xephm_stretch_leaders_glyph_tl } + } + \l_xephm_stretch_leaders_hrule_tl { - \tl_set:Nn \l_xephm_gap_filler_tl { \l_xephm_stretch_hrule_tl } + \tl_set:Nx \l_xephm_gap_filler_tl { \l_xephm_stretch_leaders_hrule_tl } } } { } { \tl_set:Nx \l_xephm_gap_filler_tl { #1 } } \tl_if_empty:NT \l_xephm_gap_filler_tl { \msg_error:nn { xepersian-hm } { error-specify-value-for-kashida-option } } @@ -351,7 +372,7 @@ make time to fix. % \begin{macrocode} %<*kashida-xepersian-hm-def> \ExplSyntaxOn -\ProvidesExplFile {kashida-xepersian-hm.def} {2020-05-20} {0.5f} { Fixes~implementation~of~Kashida~in~xepersian~package } +\ProvidesExplFile {kashida-xepersian-hm.def} {2020-05-31} {1.0a} { Fixes~implementation~of~Kashida~in~xepersian~package } \newXeTeXintercharclass \c_xephm_d_charclass % dual-joiner class \newXeTeXintercharclass \c_xephm_l_charclass % lam @@ -473,24 +494,45 @@ make time to fix. } } -%% Partly adapted from the code provided by Jonathan Kew in: -%% https://tug.org/pipermail/xetex/2009-February/012307.html. -%% Somebody notified me that the code in 'kashida-xepersian.def' from xepersian -%% package is an exact copy of Jonathan Kew's code. Being unaware of this, in -%% the earlier versions of this package I made a mistake and acknowledged -%% Vafa Khalighi instead of Jonathan Kew. A sincere thank you to Jonathan Kew -%% for his excellent code. -\cs_new:Npn \xephm_kashida_hrule #1 - { - \bool_if:NT \l_xephm_kashida_hm_fix_bool +\cs_new:Npn \xephm_kashida_leaders #1 +{ + \bool_if:NT \l_xephm_kashida_hm_fix_bool { - \c_xephm_lrm_int\c_xephm_zwj_int\tex_penalty:D 10000 - \tex_leaders:D \tex_hrule:D height \XeTeXglyphbounds \c_xephm_two_int - \int_use:N \XeTeXcharglyph \c_xephm_ksh_int depth \XeTeXglyphbounds \c_xephm_four_int - \int_use:N \XeTeXcharglyph \c_xephm_ksh_int \skip_horizontal:n { #1 } - \c_xephm_zwj_int + \tl_if_eq:NNTF \l_xephm_gap_filler_tl \l_xephm_stretch_leaders_glyph_tl + { + \tl_set:Nx \l_xephm_font_full_tl { \tex_fontname:D \tex_the:D \tex_font:D } + \tl_set:Nx \l_xephm_font_name_tl { \l_xephm_font_full_tl } + \tl_set:Nx \l_xephm_font_init_tl { \l_xephm_font_name_tl } + \regex_replace_once:nnN { ^"\[?(HM)[\_\ ](X|F).* } { \1\2 } \l_xephm_font_init_tl\relax + \tl_set:Nn \l_tmpa_tl { HMF } + \tl_set:Nn \l_tmpb_tl { HMX } + \bool_if:nTF { \str_if_eq_p:NN { \l_xephm_font_init_tl } { \l_tmpa_tl } || \str_if_eq_p:NN { \l_xephm_font_init_tl } { \l_tmpb_tl } } + { + \hbox_set:Nn \l_xephm_ksh_box { \XeTeXglyph\XeTeXglyphindex"kashida" } + \c_xephm_zwj_int \tex_penalty:D 10000 + \tex_leaders:D \copy\l_xephm_ksh_box \skip_horizontal:n { #1 } + \c_xephm_zwj_int + } + { + \msg_error:nnx { xepersian-hm } { hm-series-font-not-found } { \l_xephm_font_name_tl } + } + } + { + %% Partly adapted from the code provided by Jonathan Kew in: + %% https://tug.org/pipermail/xetex/2009-February/012307.html. + %% Somebody notified me that the code in 'kashida-xepersian.def' from xepersian + %% package is an exact copy of Jonathan Kew's code. Being unaware of this, in + %% the earlier versions of this package I made a mistake and acknowledged + %% Vafa Khalighi instead of Jonathan Kew. A sincere thank you to Jonathan Kew + %% for his excellent code. + \c_xephm_lrm_int\c_xephm_zwj_int\tex_penalty:D 10000 + \tex_leaders:D \tex_hrule:D height \XeTeXglyphbounds \c_xephm_two_int + \int_use:N \XeTeXcharglyph \c_xephm_ksh_int depth \XeTeXglyphbounds \c_xephm_four_int + \int_use:N \XeTeXcharglyph \c_xephm_ksh_int \skip_horizontal:n { #1 } + \c_xephm_zwj_int + } } - } +} \XeTeXinterchartokenstate = 1 @@ -524,81 +566,57 @@ make time to fix. \XeTeXcharclass "#1 \c_xephm_y_charclass } -\str_case:VnTF \l_xephm_gap_filler_tl - { - \l_xephm_stretch_glyph_tl - { - \XeTeXinterchartoks \c_xephm_y_charclass \c_xephm_y_charclass = - { - \bool_if:NTF \l_xephm_kashida_hm_fix_bool - { \c_xephm_zwj_int \xephm_kashida_glyph \l_xephm_skip_default_tl \c_xephm_zwj_int } - { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } - } - \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_y_charclass = - { - \bool_if:NTF \l_xephm_kashida_hm_fix_bool - { \c_xephm_zwj_int \xephm_kashida_glyph \l_xephm_skip_default_tl \c_xephm_zwj_int } - { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } - } - \XeTeXinterchartoks \c_xephm_y_charclass \c_xephm_d_charclass = - { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } - \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_d_charclass = - { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } - \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_d_charclass = - { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } - \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_l_charclass = - { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } - \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_l_charclass = - { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } - \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_r_charclass = - { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } - \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_a_charclass = - { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } - \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_r_charclass = - { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } - \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_a_charclass = - { } - } - \l_xephm_stretch_hrule_tl - { - \XeTeXinterchartoks \c_xephm_y_charclass \c_xephm_y_charclass = - { - \bool_if:NTF \l_xephm_kashida_hm_fix_bool - { \xephm_kashida_hrule \l_xephm_skip_default_tl } - { \xephm_kashida_hrule \c_xephm_skip_a_tl } - } - \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_y_charclass = - { - \bool_if:NTF \l_xephm_kashida_hm_fix_bool - { \xephm_kashida_hrule \l_xephm_skip_default_tl } - { \xephm_kashida_hrule \c_xephm_skip_a_tl } - } - \XeTeXinterchartoks \c_xephm_y_charclass \c_xephm_d_charclass = - { \xephm_kashida_hrule \c_xephm_skip_a_tl } - \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_d_charclass = - { \xephm_kashida_hrule \c_xephm_skip_a_tl } - \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_d_charclass = - { \xephm_kashida_hrule \c_xephm_skip_a_tl } - \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_l_charclass = - { \xephm_kashida_hrule \c_xephm_skip_a_tl } - \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_l_charclass = - { \xephm_kashida_hrule \c_xephm_skip_a_tl } - \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_r_charclass = - { \xephm_kashida_hrule \c_xephm_skip_a_tl } - \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_a_charclass = - { \xephm_kashida_hrule \c_xephm_skip_a_tl } - \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_r_charclass = - { \xephm_kashida_hrule \c_xephm_skip_a_tl } - \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_a_charclass = - { } - } +\tl_if_eq:NNTF \l_xephm_gap_filler_tl \l_xephm_stretch_glyph_tl { + \XeTeXinterchartoks \c_xephm_y_charclass \c_xephm_y_charclass = { + \bool_if:NTF \l_xephm_kashida_hm_fix_bool + { \c_xephm_zwj_int \xephm_kashida_glyph \l_xephm_skip_default_tl \c_xephm_zwj_int } + { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } + } + \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_y_charclass = { + \bool_if:NTF \l_xephm_kashida_hm_fix_bool + { \c_xephm_zwj_int \xephm_kashida_glyph \l_xephm_skip_default_tl \c_xephm_zwj_int } + { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } + } + \XeTeXinterchartoks \c_xephm_y_charclass \c_xephm_d_charclass = { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } + \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_d_charclass = { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } + \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_d_charclass = { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } + \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_l_charclass = { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } + \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_l_charclass = { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } + \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_r_charclass = { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } + \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_a_charclass = { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } + \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_r_charclass = { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } + \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_a_charclass = { } +} +{ + \bool_if:nTF { + \tl_if_eq_p:NN \l_xephm_gap_filler_tl \l_xephm_stretch_leaders_glyph_tl || + \tl_if_eq_p:NN \l_xephm_gap_filler_tl \l_xephm_stretch_leaders_hrule_tl } { - \msg_warning:nnn { xepersian-hm } { warning-experimental-feature } { Kashida=glyph } + \XeTeXinterchartoks \c_xephm_y_charclass \c_xephm_y_charclass = { + \bool_if:NTF \l_xephm_kashida_hm_fix_bool + { \xephm_kashida_leaders \l_xephm_skip_default_tl } + { \xephm_kashida_leaders \c_xephm_skip_a_tl } + } + \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_y_charclass = { + \bool_if:NTF \l_xephm_kashida_hm_fix_bool + { \xephm_kashida_leaders \l_xephm_skip_default_tl } + { \xephm_kashida_leaders \c_xephm_skip_a_tl } + } + \XeTeXinterchartoks \c_xephm_y_charclass \c_xephm_d_charclass = { \xephm_kashida_leaders \c_xephm_skip_a_tl } + \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_d_charclass = { \xephm_kashida_leaders \c_xephm_skip_a_tl } + \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_d_charclass = { \xephm_kashida_leaders \c_xephm_skip_a_tl } + \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_l_charclass = { \xephm_kashida_leaders \c_xephm_skip_a_tl } + \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_l_charclass = { \xephm_kashida_leaders \c_xephm_skip_a_tl } + \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_r_charclass = { \xephm_kashida_leaders \c_xephm_skip_a_tl } + \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_a_charclass = { \xephm_kashida_leaders \c_xephm_skip_a_tl } + \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_r_charclass = { \xephm_kashida_leaders \c_xephm_skip_a_tl } + \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_a_charclass = { } } { \msg_error:nnx { xepersian-hm } { error-value-not-available-for-kashida-option } { \l_xephm_gap_filler_tl } } +} \NewDocumentCommand \KashidaHMFixOn {} { \bool_set_true:N \l_xephm_kashida_hm_fix_bool } \NewDocumentCommand \KashidaHMFixOff {} { \bool_set_false:N \l_xephm_kashida_hm_fix_bool } diff --git a/Master/texmf-dist/tex/xelatex/xepersian-hm/kashida-xepersian-hm.def b/Master/texmf-dist/tex/xelatex/xepersian-hm/kashida-xepersian-hm.def index d3e96f981f7..e936a9d2a8d 100644 --- a/Master/texmf-dist/tex/xelatex/xepersian-hm/kashida-xepersian-hm.def +++ b/Master/texmf-dist/tex/xelatex/xepersian-hm/kashida-xepersian-hm.def @@ -13,7 +13,7 @@ %% this license is at: http://www.latex-project.org/lppl.txt %% \ExplSyntaxOn -\ProvidesExplFile {kashida-xepersian-hm.def} {2020-05-20} {0.5f} { Fixes~implementation~of~Kashida~in~xepersian~package } +\ProvidesExplFile {kashida-xepersian-hm.def} {2020-05-31} {1.0a} { Fixes~implementation~of~Kashida~in~xepersian~package } \newXeTeXintercharclass \c_xephm_d_charclass % dual-joiner class \newXeTeXintercharclass \c_xephm_l_charclass % lam @@ -135,24 +135,45 @@ } } -%% Partly adapted from the code provided by Jonathan Kew in: -%% https://tug.org/pipermail/xetex/2009-February/012307.html. -%% Somebody notified me that the code in 'kashida-xepersian.def' from xepersian -%% package is an exact copy of Jonathan Kew's code. Being unaware of this, in -%% the earlier versions of this package I made a mistake and acknowledged -%% Vafa Khalighi instead of Jonathan Kew. A sincere thank you to Jonathan Kew -%% for his excellent code. -\cs_new:Npn \xephm_kashida_hrule #1 - { - \bool_if:NT \l_xephm_kashida_hm_fix_bool +\cs_new:Npn \xephm_kashida_leaders #1 +{ + \bool_if:NT \l_xephm_kashida_hm_fix_bool { - \c_xephm_lrm_int\c_xephm_zwj_int\tex_penalty:D 10000 - \tex_leaders:D \tex_hrule:D height \XeTeXglyphbounds \c_xephm_two_int - \int_use:N \XeTeXcharglyph \c_xephm_ksh_int depth \XeTeXglyphbounds \c_xephm_four_int - \int_use:N \XeTeXcharglyph \c_xephm_ksh_int \skip_horizontal:n { #1 } - \c_xephm_zwj_int + \tl_if_eq:NNTF \l_xephm_gap_filler_tl \l_xephm_stretch_leaders_glyph_tl + { + \tl_set:Nx \l_xephm_font_full_tl { \tex_fontname:D \tex_the:D \tex_font:D } + \tl_set:Nx \l_xephm_font_name_tl { \l_xephm_font_full_tl } + \tl_set:Nx \l_xephm_font_init_tl { \l_xephm_font_name_tl } + \regex_replace_once:nnN { ^"\[?(HM)[\_\ ](X|F).* } { \1\2 } \l_xephm_font_init_tl\relax + \tl_set:Nn \l_tmpa_tl { HMF } + \tl_set:Nn \l_tmpb_tl { HMX } + \bool_if:nTF { \str_if_eq_p:NN { \l_xephm_font_init_tl } { \l_tmpa_tl } || \str_if_eq_p:NN { \l_xephm_font_init_tl } { \l_tmpb_tl } } + { + \hbox_set:Nn \l_xephm_ksh_box { \XeTeXglyph\XeTeXglyphindex"kashida" } + \c_xephm_zwj_int \tex_penalty:D 10000 + \tex_leaders:D \copy\l_xephm_ksh_box \skip_horizontal:n { #1 } + \c_xephm_zwj_int + } + { + \msg_error:nnx { xepersian-hm } { hm-series-font-not-found } { \l_xephm_font_name_tl } + } + } + { + %% Partly adapted from the code provided by Jonathan Kew in: + %% https://tug.org/pipermail/xetex/2009-February/012307.html. + %% Somebody notified me that the code in 'kashida-xepersian.def' from xepersian + %% package is an exact copy of Jonathan Kew's code. Being unaware of this, in + %% the earlier versions of this package I made a mistake and acknowledged + %% Vafa Khalighi instead of Jonathan Kew. A sincere thank you to Jonathan Kew + %% for his excellent code. + \c_xephm_lrm_int\c_xephm_zwj_int\tex_penalty:D 10000 + \tex_leaders:D \tex_hrule:D height \XeTeXglyphbounds \c_xephm_two_int + \int_use:N \XeTeXcharglyph \c_xephm_ksh_int depth \XeTeXglyphbounds \c_xephm_four_int + \int_use:N \XeTeXcharglyph \c_xephm_ksh_int \skip_horizontal:n { #1 } + \c_xephm_zwj_int + } } - } +} \XeTeXinterchartokenstate = 1 @@ -186,81 +207,57 @@ \XeTeXcharclass "#1 \c_xephm_y_charclass } -\str_case:VnTF \l_xephm_gap_filler_tl - { - \l_xephm_stretch_glyph_tl - { - \XeTeXinterchartoks \c_xephm_y_charclass \c_xephm_y_charclass = - { - \bool_if:NTF \l_xephm_kashida_hm_fix_bool - { \c_xephm_zwj_int \xephm_kashida_glyph \l_xephm_skip_default_tl \c_xephm_zwj_int } - { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } - } - \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_y_charclass = - { - \bool_if:NTF \l_xephm_kashida_hm_fix_bool - { \c_xephm_zwj_int \xephm_kashida_glyph \l_xephm_skip_default_tl \c_xephm_zwj_int } - { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } - } - \XeTeXinterchartoks \c_xephm_y_charclass \c_xephm_d_charclass = - { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } - \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_d_charclass = - { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } - \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_d_charclass = - { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } - \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_l_charclass = - { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } - \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_l_charclass = - { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } - \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_r_charclass = - { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } - \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_a_charclass = - { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } - \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_r_charclass = - { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } - \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_a_charclass = - { } - } - \l_xephm_stretch_hrule_tl - { - \XeTeXinterchartoks \c_xephm_y_charclass \c_xephm_y_charclass = - { - \bool_if:NTF \l_xephm_kashida_hm_fix_bool - { \xephm_kashida_hrule \l_xephm_skip_default_tl } - { \xephm_kashida_hrule \c_xephm_skip_a_tl } - } - \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_y_charclass = - { - \bool_if:NTF \l_xephm_kashida_hm_fix_bool - { \xephm_kashida_hrule \l_xephm_skip_default_tl } - { \xephm_kashida_hrule \c_xephm_skip_a_tl } - } - \XeTeXinterchartoks \c_xephm_y_charclass \c_xephm_d_charclass = - { \xephm_kashida_hrule \c_xephm_skip_a_tl } - \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_d_charclass = - { \xephm_kashida_hrule \c_xephm_skip_a_tl } - \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_d_charclass = - { \xephm_kashida_hrule \c_xephm_skip_a_tl } - \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_l_charclass = - { \xephm_kashida_hrule \c_xephm_skip_a_tl } - \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_l_charclass = - { \xephm_kashida_hrule \c_xephm_skip_a_tl } - \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_r_charclass = - { \xephm_kashida_hrule \c_xephm_skip_a_tl } - \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_a_charclass = - { \xephm_kashida_hrule \c_xephm_skip_a_tl } - \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_r_charclass = - { \xephm_kashida_hrule \c_xephm_skip_a_tl } - \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_a_charclass = - { } - } +\tl_if_eq:NNTF \l_xephm_gap_filler_tl \l_xephm_stretch_glyph_tl { + \XeTeXinterchartoks \c_xephm_y_charclass \c_xephm_y_charclass = { + \bool_if:NTF \l_xephm_kashida_hm_fix_bool + { \c_xephm_zwj_int \xephm_kashida_glyph \l_xephm_skip_default_tl \c_xephm_zwj_int } + { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } + } + \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_y_charclass = { + \bool_if:NTF \l_xephm_kashida_hm_fix_bool + { \c_xephm_zwj_int \xephm_kashida_glyph \l_xephm_skip_default_tl \c_xephm_zwj_int } + { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } + } + \XeTeXinterchartoks \c_xephm_y_charclass \c_xephm_d_charclass = { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } + \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_d_charclass = { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } + \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_d_charclass = { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } + \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_l_charclass = { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } + \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_l_charclass = { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } + \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_r_charclass = { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } + \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_a_charclass = { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } + \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_r_charclass = { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } + \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_a_charclass = { } +} +{ + \bool_if:nTF { + \tl_if_eq_p:NN \l_xephm_gap_filler_tl \l_xephm_stretch_leaders_glyph_tl || + \tl_if_eq_p:NN \l_xephm_gap_filler_tl \l_xephm_stretch_leaders_hrule_tl } { - \msg_warning:nnn { xepersian-hm } { warning-experimental-feature } { Kashida=glyph } + \XeTeXinterchartoks \c_xephm_y_charclass \c_xephm_y_charclass = { + \bool_if:NTF \l_xephm_kashida_hm_fix_bool + { \xephm_kashida_leaders \l_xephm_skip_default_tl } + { \xephm_kashida_leaders \c_xephm_skip_a_tl } + } + \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_y_charclass = { + \bool_if:NTF \l_xephm_kashida_hm_fix_bool + { \xephm_kashida_leaders \l_xephm_skip_default_tl } + { \xephm_kashida_leaders \c_xephm_skip_a_tl } + } + \XeTeXinterchartoks \c_xephm_y_charclass \c_xephm_d_charclass = { \xephm_kashida_leaders \c_xephm_skip_a_tl } + \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_d_charclass = { \xephm_kashida_leaders \c_xephm_skip_a_tl } + \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_d_charclass = { \xephm_kashida_leaders \c_xephm_skip_a_tl } + \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_l_charclass = { \xephm_kashida_leaders \c_xephm_skip_a_tl } + \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_l_charclass = { \xephm_kashida_leaders \c_xephm_skip_a_tl } + \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_r_charclass = { \xephm_kashida_leaders \c_xephm_skip_a_tl } + \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_a_charclass = { \xephm_kashida_leaders \c_xephm_skip_a_tl } + \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_r_charclass = { \xephm_kashida_leaders \c_xephm_skip_a_tl } + \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_a_charclass = { } } { \msg_error:nnx { xepersian-hm } { error-value-not-available-for-kashida-option } { \l_xephm_gap_filler_tl } } +} \NewDocumentCommand \KashidaHMFixOn {} { \bool_set_true:N \l_xephm_kashida_hm_fix_bool } \NewDocumentCommand \KashidaHMFixOff {} { \bool_set_false:N \l_xephm_kashida_hm_fix_bool } diff --git a/Master/texmf-dist/tex/xelatex/xepersian-hm/xepersian-hm.sty b/Master/texmf-dist/tex/xelatex/xepersian-hm/xepersian-hm.sty index ba57d9bfd3f..cc493c22a31 100644 --- a/Master/texmf-dist/tex/xelatex/xepersian-hm/xepersian-hm.sty +++ b/Master/texmf-dist/tex/xelatex/xepersian-hm/xepersian-hm.sty @@ -31,7 +31,9 @@ \RequirePackage{zref-savepos}[2020-03-03] \RequirePackage{xepersian} \ExplSyntaxOn -\ProvidesExplPackage {xepersian-hm} {2020-05-20} {0.5f} { Fixes~issues~in~xepersian~package } +\ProvidesExplPackage {xepersian-hm} {2020-05-31} {1.0a} { Fixes~issues~in~xepersian~package } + +\box_new:N \l_xephm_ksh_box \int_const:Nn \c_xephm_ksh_int {"0640} % kashida \int_const:Nn \c_xephm_lrm_int {"200E} % left-right-mark @@ -60,6 +62,9 @@ \tl_new:N \l_xephm_main_font_full_tl \tl_new:N \l_xephm_main_font_name_tl +\tl_new:N \l_xephm_font_full_tl +\tl_new:N \l_xephm_font_name_tl + \tl_new:N \l_xephm_skip_default_tl \tl_new:N \l_xephm_active_ligs_tl @@ -79,7 +84,8 @@ \int_set:Nn \l_xephm_max_penalty_int { 10000 } \tl_set:Nn \l_xephm_stretch_glyph_tl { glyph } -\tl_set:Nn \l_xephm_stretch_hrule_tl { hrule } +\tl_set:Nn \l_xephm_stretch_leaders_glyph_tl { leaders+glyph } +\tl_set:Nn \l_xephm_stretch_leaders_hrule_tl { leaders+hrule } \tl_set:Nn \l_xephm_fnt_kayhan_tl { kayhan } \tl_set:Nn \l_xephm_fnt_kayhannavaar_tl { kayhannavaar } @@ -146,7 +152,7 @@ \msg_new:nnn { xepersian-hm } { error-kashida-character-is-not-available-in-the-main-font } { - Sorry,~ kashida~ character~ is~ not~ available~ in~ the~ main~ font~! + Sorry,~ kashida~ character~ is~ not~ available~ in~ the~ main~ font~#1! } \msg_new:nnn { xepersian-hm } { error-value-not-available-for-kashida-option } @@ -165,6 +171,16 @@ and~ is~ not~ regarded~ as~ stable. } +\msg_new:nnn { xepersian-hm } { hm-series-font-not-found } + { + Either~ the~ font~`#1'~ is~ not~ installed~ on~ your~ system~ or~ does~ not~ + belong~ to~ HM~Series~fonts.~ + Please~ note~ that~ the~ option~ `Kashida=leaders+glyph'~ is~ currently~ only~ + supported~ by~ HM~Series~fonts.~ + If~ you~ know~ of~ any~ other~ font~ that~ supports~ this~ option,~ please~ + let~ me~ know~ to~ add~ it~ to~ the~ list~ of~ corresponding~ fonts.~ + } + \keys_define:nn { xepersian-hm } { Kashida .code:n = @@ -174,7 +190,8 @@ { \l_xephm_stretch_glyph_tl { - \tl_set:Nn \l_xephm_gap_filler_tl { \l_xephm_stretch_glyph_tl } + \msg_warning:nnn { xepersian-hm } { warning-experimental-feature } { Kashida=glyph } + \tl_set:Nx \l_xephm_gap_filler_tl { \l_xephm_stretch_glyph_tl } \AtBeginDocument { \tl_set:Nx \l_xephm_main_font_full_tl { \tex_fontname:D \tex_the:D \tex_font:D } @@ -183,13 +200,17 @@ \int_set:Nn \l_xephm_kashida_slot_int { \xetex_charglyph:D \c_xephm_ksh_int } \int_compare:nT { \l_xephm_kashida_slot_int = \c_zero_int } { - \msg_error:nn { xepersian-hm } { error-kashida-character-is-not-available-in-the-main-font } + \msg_error:nnx { xepersian-hm } { error-kashida-character-is-not-available-in-the-main-font } { \l_xephm_main_font_name_tl } } } } - \l_xephm_stretch_hrule_tl + \l_xephm_stretch_leaders_glyph_tl + { + \tl_set:Nx \l_xephm_gap_filler_tl { \l_xephm_stretch_leaders_glyph_tl } + } + \l_xephm_stretch_leaders_hrule_tl { - \tl_set:Nn \l_xephm_gap_filler_tl { \l_xephm_stretch_hrule_tl } + \tl_set:Nx \l_xephm_gap_filler_tl { \l_xephm_stretch_leaders_hrule_tl } } } { } { \tl_set:Nx \l_xephm_gap_filler_tl { #1 } } \tl_if_empty:NT \l_xephm_gap_filler_tl { \msg_error:nn { xepersian-hm } { error-specify-value-for-kashida-option } } |