aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arabluatex.dtx11
-rw-r--r--arabluatex.lua8
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 @@
269%</driver> 269%</driver>
270% \fi 270% \fi
271% 271%
272% \CheckSum{1059} 272% \CheckSum{0}
273% 273%
274% \CharacterTable 274% \CharacterTable
275% {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 275% {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 @@
4668\NewDocumentCommand{\SetTranslitStyle}{m}{\def\al@trans@style{#1}} 4668\NewDocumentCommand{\SetTranslitStyle}{m}{\def\al@trans@style{#1}}
4669% \end{macrocode} 4669% \end{macrocode}
4670% \end{macro} 4670% \end{macro}
4671% \begin{macro}{\altrfont}
4672% \changes{v1.21}{2020/07/13}{new command \cs{altrfont} to store
4673% font and shape information (trans mode)} Finally \cs{altrfont}
4674% is used internally by \package{arabluatex} to store the family and
4675% the shape of the font to be used for transliterated Arabic.
4676% \begin{macrocode}
4677\def\altrfont{\al@trans@font\al@trans@style }
4678% \end{macrocode}
4679% \end{macro}
4671% \begin{macro}{\SetTranslitConvention} 4680% \begin{macro}{\SetTranslitConvention}
4672% \cs{SetTranslitConvention}\marg{convention} can be used to change 4681% \cs{SetTranslitConvention}\marg{convention} can be used to change
4673% the transliteration convention, which is |dmg| by default: 4682% 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)
532 return str 532 return str
533end 533end
534 534
535local trfontinfo = "\\altrfont "
536
535local function transdmg(str, rules) 537local function transdmg(str, rules)
536 str = string.gsub(str, "\\arb(%b{})", function(inside) 538 str = string.gsub(str, "\\arb(%b{})", function(inside)
537 inside = string.sub(inside, 2, -2) 539 inside = string.sub(inside, 2, -2)
@@ -567,7 +569,7 @@ local function transdmg(str, rules)
567 for i = 1,#nulltr do 569 for i = 1,#nulltr do
568 inside = string.gsub(inside, nulltr[i].a, nulltr[i].b) 570 inside = string.gsub(inside, nulltr[i].a, nulltr[i].b)
569 end 571 end
570 return string.format("%s", inside) 572 return string.format("{%s%s}", trfontinfo, inside)
571 end) 573 end)
572 return str 574 return str
573end 575end
@@ -605,7 +607,7 @@ local function transloc(str)
605 for i = 1,#nulltr do 607 for i = 1,#nulltr do
606 inside = string.gsub(inside, nulltr[i].a, nulltr[i].b) 608 inside = string.gsub(inside, nulltr[i].a, nulltr[i].b)
607 end 609 end
608 return string.format("%s", inside) 610 return string.format("{%s%s}", trfontinfo, inside)
609 end) 611 end)
610 return str 612 return str
611end 613end
@@ -640,7 +642,7 @@ local function transarabica(str)
640 for i = 1,#nulltr do 642 for i = 1,#nulltr do
641 inside = string.gsub(inside, nulltr[i].a, nulltr[i].b) 643 inside = string.gsub(inside, nulltr[i].a, nulltr[i].b)
642 end 644 end
643 return string.format("%s", inside) 645 return string.format("{%s%s}", trfontinfo, inside)
644 end) 646 end)
645 return str 647 return str
646end 648end