aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2016-06-19 11:26:50 +0200
committerRobert Alessi <alessi@robertalessi.net>2016-06-19 11:26:50 +0200
commitd0f6579a76225fbdac0c8f0a31ba37465d59666e (patch)
treefdcfe1c9806ed1077b1d524c1d2d28044ebd6fc3
parentcd24d52e7fb9c58e7d59724a200ed43933bb3b48 (diff)
downloadarabluatex-d0f6579a76225fbdac0c8f0a31ba37465d59666e.tar.gz
new macro \SetTranslitFont for selecting a specific font for transliterated texts
-rw-r--r--arabluatex.dtx47
1 files changed, 37 insertions, 10 deletions
diff --git a/arabluatex.dtx b/arabluatex.dtx
index 89c6457..e6ac1d6 100644
--- a/arabluatex.dtx
+++ b/arabluatex.dtx
@@ -135,7 +135,7 @@
135\defaultfontfeatures{RawFeature={+liga;+onum;+hlig}} 135\defaultfontfeatures{RawFeature={+liga;+onum;+hlig}}
136\setmainfont{Libertinus Serif} 136\setmainfont{Libertinus Serif}
137\setsansfont{Libertinus Sans} 137\setsansfont{Libertinus Sans}
138\setmonofont[Scale=.9]{Libertinus Mono} 138\setmonofont{Libertinus Mono}[Scale=.9]
139\usepackage{arabluatex}[2016/05/28] 139\usepackage{arabluatex}[2016/05/28]
140\usepackage{varioref} 140\usepackage{varioref}
141\usepackage{hypdoc} 141\usepackage{hypdoc}
@@ -189,7 +189,7 @@
189%</driver> 189%</driver>
190% \fi 190% \fi
191% 191%
192% \CheckSum{342} 192% \CheckSum{0}
193% 193%
194% \CharacterTable 194% \CharacterTable
195% {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 195% {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 @@
410% loading \package{arabluatex}. Assuming that \package{fontspec} is 410% loading \package{arabluatex}. Assuming that \package{fontspec} is
411% loaded, put this in your preamble just above the line that loads 411% loaded, put this in your preamble just above the line that loads
412% \package{arabluatex}: 412% \package{arabluatex}:
413% \arabluabox{\cs{newfontfamily}\cs{arabicfont}[Script=Arabic]\marg{fontname}} 413% \arabluabox{\cs{newfontfamily}\cs{arabicfont}\marg{fontname}[Script=Arabic]}
414% \noindent where \meta{fontname} is the standard name of the Arabic 414% \noindent where \meta{fontname} is the standard name of the Arabic
415% font you wish to use. 415% font you wish to use.
416% 416%
417% By default, if no Arabic font is selected, \package{arabluatex} will 417% By default, if no Arabic font is selected, \package{arabluatex} will
418% issue a warning message and attempt to load the Amiri 418% issue a warning message and attempt to load the Amiri
419% font\footnote{\textcite{pkg:amiri}.} like so:---\\ 419% font\footnote{\textcite{pkg:amiri}.} like so:---\\
420% \arabluaverb{\newfontfamily\arabicfont[Script=Arabic]{Amiri}} 420% \arabluaverb{\newfontfamily\arabicfont{Amiri}[Script=Arabic]}
421% \begin{quoting} 421% \begin{quoting}
422% \textsc{Rem.} By default Amiri places the \arb[trans]{kasraT} in 422% \textsc{Rem.} By default Amiri places the \arb[trans]{kasraT} in
423% combination with the \arb[trans]{ta^sdId} below the consonant, 423% combination with the \arb[trans]{ta^sdId} below the consonant,
424% like so: \arb{BBi}\,. That is correct, as at least in the oldest 424% like so: \arb{BBi}\,. That is correct, as at least in the oldest
425% manuscripts {\newfontfamily\arabicfont[Script=Arabic, 425% manuscripts {\newfontfamily\arabicfont{Amiri}[Script=Arabic,
426% RawFeature={+ss05}]{Amiri}\arb{BBi}} may stand for \arb{BBa} as 426% RawFeature={+ss05}]\arb{BBi}} may stand for \arb{BBa} as
427% well as \arb{BBi}\,. See \textcite[i.14.C--D]{Wright}. The placement 427% well as \arb{BBi}\,. See \textcite[i.14.C--D]{Wright}. The placement
428% of the \arb[trans]{kasraT} above the consonant may be obtained by 428% of the \arb[trans]{kasraT} above the consonant may be obtained by
429% selecting the |ss05| feature of the Amiri font, like 429% selecting the |ss05| feature of the Amiri font, like
430% so:---\footnote{See the documentation of \package{amiri}, 430% so:---\footnote{See the documentation of \package{amiri},
431% \textcite[5]{pkg:amiri}.}\\ 431% \textcite[5]{pkg:amiri}.}\\
432% \arabluaverb{\newfontfamily\arabicfont[Script=Arabic,RawFeature={+ss05}]{Amiri}} 432% \arabluaverb{\newfontfamily\arabicfont{Amiri}[Script=Arabic,RawFeature={+ss05}]}
433% 433%
434% Other Arabic fonts may behave differently. 434% Other Arabic fonts may behave differently.
435% \end{quoting} 435% \end{quoting}
@@ -1747,8 +1747,24 @@ vowels (see ยง~3).
1747% any point of the document by the command 1747% any point of the document by the command
1748% \cs{SetTranslitStyle}\marg{style}, where \meta{style} may be any 1748% \cs{SetTranslitStyle}\marg{style}, where \meta{style} may be any
1749% font shape selection command, eg. \cs{upshape}, \cs{itshape}, 1749% font shape selection command, eg. \cs{upshape}, \cs{itshape},
1750% \cs{slshape}, and so forth. Any specific font may also be selected 1750% \cs{slshape}, and so forth.
1751% using the font-selecting commands of the \package{fontspec} package. 1751%
1752% \paragraph{Font} \DescribeMacro{\SetTranslitFont} Any specific font
1753% may also be selected for rendering transliterated text with the
1754% font-selecting commands of the \package{fontspec} package. Of
1755% course, this font must have been defined properly. To take one
1756% example, here is how the \emph{Gentium Plus} font may be used for
1757% rendering transliterated text:---
1758% \iffalse
1759%<*example>
1760% \fi
1761\begin{arabluaverbatim}
1762\newfontfamily\translitfont{Gentium Plus}[Ligatures=TeX]
1763\SetTranslitFont{\translitfont}
1764\end{arabluaverbatim}
1765% \iffalse
1766%</example>
1767% \fi
1752% 1768%
1753% \paragraph{Proper names} \DescribeMacro{\cap} Proper names or book 1769% \paragraph{Proper names} \DescribeMacro{\cap} Proper names or book
1754% titles that must have their first letters uppercased may be passed 1770% titles that must have their first letters uppercased may be passed
@@ -2263,6 +2279,17 @@ wa-ya.sIru ta.hta 'l-jild-i
2263\NewDocumentCommand{\SetArbDflt}{}{\def\al@arb@rules{dflt}} 2279\NewDocumentCommand{\SetArbDflt}{}{\def\al@arb@rules{dflt}}
2264% \end{macrocode} 2280% \end{macrocode}
2265% \end{macro} 2281% \end{macro}
2282% \begin{macro}{\SetTranslitFont}
2283% By default, the font that is used for transliterated text is the
2284% main font of the document. Any other font may also be selected
2285% with the font-selecting commands of the \package{fontspec}
2286% package.
2287% \begin{macrocode}
2288\def\al@trans@font{\rmfamily}%
2289\NewDocumentCommand{\SetTranslitFont}{m}{\def\al@trans@font{#1}}
2290% \end{macrocode}
2291%
2292% \end{macro}
2266% \end{macro} 2293% \end{macro}
2267% \begin{macro}{\SetTranslitStyle} By default any transliterated 2294% \begin{macro}{\SetTranslitStyle} By default any transliterated
2268% Arabic text is printed in italics. This can be changed either 2295% Arabic text is printed in italics. This can be changed either
@@ -2327,7 +2354,7 @@ wa-ya.sIru ta.hta 'l-jild-i
2327\DeclareDocumentCommand{\txarb}{+m}{\bgroup\textdir 2354\DeclareDocumentCommand{\txarb}{+m}{\bgroup\textdir
2328 TRT\arabicfont#1\egroup} 2355 TRT\arabicfont#1\egroup}
2329\DeclareDocumentCommand{\txtrans}{+m}{\bgroup\textdir 2356\DeclareDocumentCommand{\txtrans}{+m}{\bgroup\textdir
2330 TLT\rmfamily#1\egroup} 2357 TLT\al@trans@font#1\egroup}
2331% \end{macrocode} 2358% \end{macrocode}
2332% \end{macro} 2359% \end{macro}
2333% \end{macro} 2360% \end{macro}