From d0f6579a76225fbdac0c8f0a31ba37465d59666e Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Sun, 19 Jun 2016 11:26:50 +0200
Subject: new macro \SetTranslitFont for selecting a specific font for
 transliterated texts

---
 arabluatex.dtx | 47 +++++++++++++++++++++++++++++++++++++----------
 1 file changed, 37 insertions(+), 10 deletions(-)

(limited to 'arabluatex.dtx')

diff --git a/arabluatex.dtx b/arabluatex.dtx
index 89c6457..e6ac1d6 100644
--- a/arabluatex.dtx
+++ b/arabluatex.dtx
@@ -135,7 +135,7 @@
 \defaultfontfeatures{RawFeature={+liga;+onum;+hlig}}
 \setmainfont{Libertinus Serif}
 \setsansfont{Libertinus Sans}
-\setmonofont[Scale=.9]{Libertinus Mono}
+\setmonofont{Libertinus Mono}[Scale=.9]
 \usepackage{arabluatex}[2016/05/28]
 \usepackage{varioref}
 \usepackage{hypdoc}
@@ -189,7 +189,7 @@
 %</driver>
 % \fi
 %
-% \CheckSum{342}
+% \CheckSum{0}
 %
 % \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
@@ -410,26 +410,26 @@
 % loading \package{arabluatex}. Assuming that \package{fontspec} is
 % loaded, put this in your preamble just above the line that loads
 % \package{arabluatex}:
-% \arabluabox{\cs{newfontfamily}\cs{arabicfont}[Script=Arabic]\marg{fontname}}
+% \arabluabox{\cs{newfontfamily}\cs{arabicfont}\marg{fontname}[Script=Arabic]}
 % \noindent where \meta{fontname} is the standard name of the Arabic
 % font you wish to use.
 %
 % By default, if no Arabic font is selected, \package{arabluatex} will
 % issue a warning message and attempt to load the Amiri
 % font\footnote{\textcite{pkg:amiri}.} like so:---\\
-% \arabluaverb{\newfontfamily\arabicfont[Script=Arabic]{Amiri}}
+% \arabluaverb{\newfontfamily\arabicfont{Amiri}[Script=Arabic]}
 % \begin{quoting}
 %   \textsc{Rem.} By default Amiri places the \arb[trans]{kasraT} in
 %   combination with the \arb[trans]{ta^sdId} below the consonant,
 %   like so: \arb{BBi}\,. That is correct, as at least in the oldest
-%   manuscripts {\newfontfamily\arabicfont[Script=Arabic,
-%   RawFeature={+ss05}]{Amiri}\arb{BBi}} may stand for \arb{BBa} as
+%   manuscripts {\newfontfamily\arabicfont{Amiri}[Script=Arabic,
+%   RawFeature={+ss05}]\arb{BBi}} may stand for \arb{BBa} as
 %   well as \arb{BBi}\,. See \textcite[i.14.C--D]{Wright}. The placement
 %   of the \arb[trans]{kasraT} above the consonant may be obtained by
 %   selecting the |ss05| feature of the Amiri font, like
 %   so:---\footnote{See the documentation of \package{amiri},
 %   \textcite[5]{pkg:amiri}.}\\
-%   \arabluaverb{\newfontfamily\arabicfont[Script=Arabic,RawFeature={+ss05}]{Amiri}}
+%   \arabluaverb{\newfontfamily\arabicfont{Amiri}[Script=Arabic,RawFeature={+ss05}]}
 %
 %   Other Arabic fonts may behave differently.
 % \end{quoting}
@@ -1747,8 +1747,24 @@ vowels (see §~3).
 % any point of the document by the command
 % \cs{SetTranslitStyle}\marg{style}, where \meta{style} may be any
 % font shape selection command, eg. \cs{upshape}, \cs{itshape},
-% \cs{slshape}, and so forth. Any specific font may also be selected
-% using the font-selecting commands of the \package{fontspec} package.
+% \cs{slshape}, and so forth.
+%
+% \paragraph{Font} \DescribeMacro{\SetTranslitFont} Any specific font
+% may also be selected for rendering transliterated text with the
+% font-selecting commands of the \package{fontspec} package. Of
+% course, this font must have been defined properly. To take one
+% example, here is how the \emph{Gentium Plus} font may be used for
+% rendering transliterated text:---
+% \iffalse
+%<*example>
+% \fi
+\begin{arabluaverbatim}
+\newfontfamily\translitfont{Gentium Plus}[Ligatures=TeX]
+\SetTranslitFont{\translitfont}
+\end{arabluaverbatim}
+% \iffalse
+%</example>
+% \fi
 %
 % \paragraph{Proper names} \DescribeMacro{\cap} Proper names or book
 % titles that must have their first letters uppercased may be passed
@@ -2263,6 +2279,17 @@ wa-ya.sIru ta.hta 'l-jild-i
 \NewDocumentCommand{\SetArbDflt}{}{\def\al@arb@rules{dflt}}
 %    \end{macrocode}
 % \end{macro}
+% \begin{macro}{\SetTranslitFont}
+%   By default, the font that is used for transliterated text is the
+%   main font of the document. Any other font may also be selected
+%   with the font-selecting commands of the \package{fontspec}
+%   package.
+%    \begin{macrocode}
+\def\al@trans@font{\rmfamily}%
+\NewDocumentCommand{\SetTranslitFont}{m}{\def\al@trans@font{#1}}
+%    \end{macrocode}
+%   
+% \end{macro}
 % \end{macro}
 % \begin{macro}{\SetTranslitStyle} By default any transliterated
 %   Arabic text is printed in italics. This can be changed either
@@ -2327,7 +2354,7 @@ wa-ya.sIru ta.hta 'l-jild-i
 \DeclareDocumentCommand{\txarb}{+m}{\bgroup\textdir
   TRT\arabicfont#1\egroup}
 \DeclareDocumentCommand{\txtrans}{+m}{\bgroup\textdir
-  TLT\rmfamily#1\egroup}
+  TLT\al@trans@font#1\egroup}
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
-- 
cgit v1.2.3

