From 98bc53938259ad553e545192ed20cc553dd48ae3 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Mon, 13 Jul 2020 10:28:08 +0200 Subject: new command used internally to store font family and shape to be used for transliterated Arabic --- arabluatex.dtx | 11 ++++++++++- arabluatex.lua | 8 +++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/arabluatex.dtx b/arabluatex.dtx index 6a91d9f..78bd3d4 100644 --- a/arabluatex.dtx +++ b/arabluatex.dtx @@ -269,7 +269,7 @@ % % \fi % -% \CheckSum{1059} +% \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 @@ -4668,6 +4668,15 @@ \NewDocumentCommand{\SetTranslitStyle}{m}{\def\al@trans@style{#1}} % \end{macrocode} % \end{macro} +% \begin{macro}{\altrfont} +% \changes{v1.21}{2020/07/13}{new command \cs{altrfont} to store +% font and shape information (trans mode)} Finally \cs{altrfont} +% is used internally by \package{arabluatex} to store the family and +% the shape of the font to be used for transliterated Arabic. +% \begin{macrocode} +\def\altrfont{\al@trans@font\al@trans@style } +% \end{macrocode} +% \end{macro} % \begin{macro}{\SetTranslitConvention} % \cs{SetTranslitConvention}\marg{convention} can be used to change % the transliteration convention, which is |dmg| by default: diff --git a/arabluatex.lua b/arabluatex.lua index 32bb500..8897194 100644 --- a/arabluatex.lua +++ b/arabluatex.lua @@ -532,6 +532,8 @@ local function novoceasy(str) return str end +local trfontinfo = "\\altrfont " + local function transdmg(str, rules) str = string.gsub(str, "\\arb(%b{})", function(inside) inside = string.sub(inside, 2, -2) @@ -567,7 +569,7 @@ local function transdmg(str, rules) for i = 1,#nulltr do inside = string.gsub(inside, nulltr[i].a, nulltr[i].b) end - return string.format("%s", inside) + return string.format("{%s%s}", trfontinfo, inside) end) return str end @@ -605,7 +607,7 @@ local function transloc(str) for i = 1,#nulltr do inside = string.gsub(inside, nulltr[i].a, nulltr[i].b) end - return string.format("%s", inside) + return string.format("{%s%s}", trfontinfo, inside) end) return str end @@ -640,7 +642,7 @@ local function transarabica(str) for i = 1,#nulltr do inside = string.gsub(inside, nulltr[i].a, nulltr[i].b) end - return string.format("%s", inside) + return string.format("{%s%s}", trfontinfo, inside) end) return str end -- cgit v1.2.3