summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/texnegar
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-02-09 22:01:37 +0000
committerKarl Berry <karl@freefriends.org>2021-02-09 22:01:37 +0000
commit48b3bc41d0b91de1472734c786a3506067fc99c1 (patch)
tree0be93741d0f22369f02e567ef83a01c0cee665f5 /Master/texmf-dist/source/latex/texnegar
parentfe491675252d9e6fe3ae6b1c67b198daed5cf936 (diff)
texnegar (9feb21)
git-svn-id: svn://tug.org/texlive/trunk@57692 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/texnegar')
-rw-r--r--Master/texmf-dist/source/latex/texnegar/texnegar.dtx106
1 files changed, 74 insertions, 32 deletions
diff --git a/Master/texmf-dist/source/latex/texnegar/texnegar.dtx b/Master/texmf-dist/source/latex/texnegar/texnegar.dtx
index 40a5baef1c0..1024a64dce5 100644
--- a/Master/texmf-dist/source/latex/texnegar/texnegar.dtx
+++ b/Master/texmf-dist/source/latex/texnegar/texnegar.dtx
@@ -101,7 +101,7 @@ make time to fix.
% }^^A
% }
%
-% \date{Released \quad 2021-01-31 \quad v0.1d}
+% \date{Released \quad 2021-02-09 \quad v0.1e}
%
% \maketitle
%
@@ -137,7 +137,7 @@ make time to fix.
\RequirePackage{newverbs}[2010/09/02]
\RequirePackage{environ}[2014/05/04]
-\ProvidesExplPackage {texnegar} {2021-01-31} {0.1d} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
+\ProvidesExplPackage {texnegar} {2021-02-09} {0.1e} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
\sys_if_engine_luatex:T
{
@@ -165,7 +165,7 @@ make time to fix.
%
% \begin{macrocode}
%<*texnegar-luatex-sty>
-\ProvidesExplPackage {texnegar-luatex} {2021-01-31} {0.1d} { Full implementation of kashida feature in xetex and luatex }
+\ProvidesExplPackage {texnegar-luatex} {2021-02-09} {0.1e} { Full implementation of kashida feature in xetex and luatex }
\tex_input:D { texnegar-ini.tex }
@@ -201,7 +201,7 @@ make time to fix.
% \begin{macrocode}
%<*texnegar-xetex-sty>
\RequirePackage{zref-savepos}[2020-03-03]
-\ProvidesExplPackage {texnegar-xetex} {2021-01-31} {0.1d} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
+\ProvidesExplPackage {texnegar-xetex} {2021-02-09} {0.1e} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
\tex_input:D { texnegar-ini.tex }
@@ -218,7 +218,7 @@ make time to fix.
%
% \begin{macrocode}
%<*texnegar-ini-tex>
-\ProvidesExplFile {texnegar-ini.tex} {2021-01-31} {0.1d} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
+\ProvidesExplFile {texnegar-ini.tex} {2021-02-09} {0.1e} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
\def\TeXNegar{\TeX Negar}
@@ -653,6 +653,7 @@ make time to fix.
\bool_if:NF \l_texnegar_minimal_bool
{
+ \directlua{dofile(kpse.find_file("luatex-tools.lua"))}
\input texnegar-luabidi.tex
}
@@ -663,7 +664,7 @@ make time to fix.
% \subsection{File: \texttt{texnegar-common-kashida.tex}}
% \begin{macrocode}
%<*texnegar-common-kashida-tex>
-\ProvidesExplFile {texnegar-common-kashida.tex} {2021-01-31} {0.1d} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
+\ProvidesExplFile {texnegar-common-kashida.tex} {2021-02-09} {0.1e} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
\bool_if:NT \l_texnegar_ligature_bool
{
@@ -740,7 +741,7 @@ make time to fix.
%
% \begin{macrocode}
%<*texnegar-xetex-kashida-tex>
-\ProvidesExplFile {texnegar-xetex-kashida.tex} {2021-01-31} {0.1d} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
+\ProvidesExplFile {texnegar-xetex-kashida.tex} {2021-02-09} {0.1e} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
\newXeTeXintercharclass \c_texnegar_d_charclass % dual-joiner class
\newXeTeXintercharclass \c_texnegar_l_charclass % lam
@@ -961,8 +962,8 @@ make time to fix.
-- local texnegar_char_table = texnegar_char_table
-- texnegar_char_table.module = {
-- name = "texnegar_char_table",
--- version = "0.1d",
--- date = "2021-01-31",
+-- version = "0.1e",
+-- date = "2021-02-09",
-- description = "Full implementation of kashida feature in XeLaTex and LuaLaTeX",
-- author = "Hossein Movahhedian",
-- copyright = "Hossein Movahhedian",
@@ -975,6 +976,31 @@ make time to fix.
-- texnegar_char_table.warning = warn or (function (s) luatexbase.module_warning("texnegar_char_table", s) end)
-- texnegar_char_table.error = err or (function (s) luatexbase.module_error("texnegar_char_table", s) end)
+local peCharTableDiacritic = {
+ [1611] = utf8.char(1611), -- "ً", utf8.codepoint("ً") == 1611, "\u{064B}", ARABIC-FATHATAN
+ [1612] = utf8.char(1612), -- "ٌ", utf8.codepoint("ٌ") == 1612, "\u{064C}", ARABIC-DAMMATAN
+ [1613] = utf8.char(1613), -- "ٍ", utf8.codepoint("ٍ") == 1613, "\u{064D}", ARABIC-KASRATAN
+ [1614] = utf8.char(1614), -- "َ", utf8.codepoint("َ") == 1614, "\u{064E}", ARABIC-FATHA
+ [1615] = utf8.char(1615), -- "ُ", utf8.codepoint("ُ") == 1615, "\u{064F}", ARABIC-DAMMA
+ [1616] = utf8.char(1616), -- "ِ", utf8.codepoint("ِ") == 1616, "\u{0650}", ARABIC-KASRA
+ [1617] = utf8.char(1617), -- "ّ", utf8.codepoint("ّ") == 1617, "\u{0651}", ARABIC-SHADDA
+ [1618] = utf8.char(1618), -- "ْ", utf8.codepoint("ْ") == 1618, "\u{0652}", ARABIC-SUKUN
+ [1619] = utf8.char(1619), -- "ٓ", utf8.codepoint("ٓ") == 1619, "\u{0653}", ARABIC-MADDA ABOVE
+ [1620] = utf8.char(1620), -- "ٔ", utf8.codepoint("ٔ") == 1620, "\u{0654}", ARABIC-HAMZA ABOVE
+ [1621] = utf8.char(1621), -- "ٕ", utf8.codepoint("ٕ") == 1621, "\u{0655}", ARABIC-HAMZA BELOW
+ [1622] = utf8.char(1622), -- "ٖ", utf8.codepoint("ٖ") == 1622, "\u{0656}", ARABIC-SUBSCRIPT ALEF
+ [1623] = utf8.char(1623), -- "ٗ", utf8.codepoint("ٗ") == 1623, "\u{0657}", ARABIC-INVERTED DAMMA
+ [1624] = utf8.char(1624), -- "٘", utf8.codepoint("٘") == 1624, "\u{0658}", ARABIC-MARK NOON GHUNNA
+ [1625] = utf8.char(1625), -- "ٙ", utf8.codepoint("ٙ") == 1625, "\u{0659}", ARABIC-ZWARAKAY
+ [1648] = utf8.char(1648), -- "", utf8.codepoint("") == 1648, "\u{0670}", ARABIC-SUPERSCRIPT ALEF
+ [64606] = utf8.char(64606), -- "", utf8.codepoint("") == 64606, "\u{FC5E}", ARABIC-LIGATURE SHADDA WITH DAMMATAN ISOLATED FORM
+ [64607] = utf8.char(64607), -- "", utf8.codepoint("") == 64607, "\u{FC5F}", ARABIC-LIGATURE SHADDA WITH KASRATAN ISOLATED FORM
+ [64608] = utf8.char(64608), -- "", utf8.codepoint("") == 64608, "\u{FC60}", ARABIC-LIGATURE SHADDA WITH FATHA ISOLATED FORM
+ [64609] = utf8.char(64609), -- "", utf8.codepoint("") == 64609, "\u{FC61}", ARABIC-LIGATURE SHADDA WITH DAMMA ISOLATED FORM
+ [64610] = utf8.char(64610), -- "", utf8.codepoint("") == 64610, "\u{FC62}", ARABIC-LIGATURE SHADDA WITH KASRA ISOLATED FORM
+ [64611] = utf8.char(64611), -- "", utf8.codepoint("") == 64611, "\u{FC63}", ARABIC-LIGATURE SHADDA WITH SUPERSCRIPT ALEF ISOLATED FORM
+}
+
local peCharTableDigit = {
[1632] = utf8.char(1632), -- "٠", utf8.codepoint("٠") == 1632, "\u{0660}", ARABIC-INDIC DIGIT ZERO
[1633] = utf8.char(1633), -- "١", utf8.codepoint("١") == 1633, "\u{0661}", ARABIC-INDIC DIGIT ONE
@@ -1157,7 +1183,7 @@ local peCharTableFinal = {
[65276] = utf8.char(65276), -- "ﻼ", utf8.codepoint("ﻼ") == 65276, "\u{FEFC}", FINAL FORM LIGATURE LAM WITH ALEF
}
-return peCharTableInitial, peCharTableMedial, peCharTableFinal
+return peCharTableInitial, peCharTableMedial, peCharTableFinal, peCharTableDiacritic
--
--
-- End of file `texnegar-char-table.lua'.
@@ -1186,8 +1212,8 @@ return peCharTableInitial, peCharTableMedial, peCharTableFinal
-- local texnegar = texnegar
-- texnegar.module = {
-- name = "texnegar",
--- version = "0.1d",
--- date = "2021-01-31",
+-- version = "0.1e",
+-- date = "2021-02-09",
-- description = "Full implementation of kashida feature in XeLaTex and LuaLaTeX",
-- author = "Hossein Movahhedian",
-- copyright = "Hossein Movahhedian",
@@ -1338,8 +1364,8 @@ dofile(kpse.find_file("texnegar-ini.lua"))
-- local texnegar_ini = texnegar_ini
-- texnegar_ini.module = {
-- name = "texnegar_ini",
--- version = "0.1d",
--- date = "2021-01-31",
+-- version = "0.1e",
+-- date = "2021-02-09",
-- description = "Full implementation of kashida feature in XeLaTex and LuaLaTeX",
-- author = "Hossein Movahhedian",
-- copyright = "Hossein Movahhedian",
@@ -1392,8 +1418,8 @@ dofile(kpse.find_file("texnegar-luatex-kashida.lua"))
-- local texnegar_luatex_kashida = texnegar_luatex_kashida
-- texnegar_luatex_kashida.module = {
-- name = "texnegar_luatex_kashida",
--- version = "0.1d",
--- date = "2021-01-31",
+-- version = "0.1e",
+-- date = "2021-02-09",
-- description = "Full implementation of kashida feature in XeLaTex and LuaLaTeX",
-- author = "Hossein Movahhedian",
-- copyright = "Hossein Movahhedian",
@@ -1406,7 +1432,7 @@ dofile(kpse.find_file("texnegar-luatex-kashida.lua"))
-- texnegar_luatex_kashida.warning = warn or (function (s) luatexbase.module_warning("texnegar_luatex_kashida", s) end)
-- texnegar_luatex_kashida.error = err or (function (s) luatexbase.module_error("texnegar_luatex_kashida", s) end)
-local peCharTableInitial, peCharTableMedial, peCharTableFinal = dofile(kpse.find_file("texnegar-char-table.lua"))
+local peCharTableInitial, peCharTableMedial, peCharTableFinal, peCharTableDiacritic = dofile(kpse.find_file("texnegar-char-table.lua"))
local kashida_unicode = 1600
local kashida_subtype = 256
@@ -1417,6 +1443,7 @@ local GLUE = node_id("glue")
local GLYPH = node_id("glyph")
local HLIST = node_id("hlist")
local RULE = node_id("rule")
+local VLIST = node_id("vlist")
local WHATSIT = node_id("whatsit")
local l_texnegar_kashida_glyph_bool = token.create("l_texnegar_kashida_glyph_bool")
@@ -1519,11 +1546,11 @@ function ProcessTableKashidaHlist(ksh_hlistNode, hbox_num, in_font)
local tn_id = tn.id
local tn_subtype = tn.subtype
- if tn_id == 0 then
+ if tn_id == HLIST then
for tp in node.traverse(tn.head) do
local tp_id = tp.id
local tp_subtype = tp.subtype
- if tp_id == 29 then
+ if tp_id == GLYPH then
if l_texnegar_color_bool.mode == c_true_bool.mode then
local col_str = color_tbl[1] .. " " .. color_tbl[2] .. " " .. color_tbl[3]
local col_str_rg = col_str .. " rg "
@@ -1555,17 +1582,17 @@ function ProcessTableKashidaHlist(ksh_hlistNode, hbox_num, in_font)
tn_width = tn.width
ksh_hlistNode.width = tn_width
end
- elseif tp_id == 0 then
+ elseif tp_id == HLIST then
if tp.subtype ~= 3 then
tbl_kashida_hlist_nodes[ #tbl_kashida_hlist_nodes + 1 ] = tp
end
end
end
- elseif tn_id == 1 then
+ elseif tn_id == VLIST then
do end
- elseif tn_id == 8 then
+ elseif tn_id == WHATSIT then
do end
- elseif tn_id == 29 then
+ elseif tn_id == GLYPH then
if l_texnegar_color_bool.mode == c_true_bool.mode then
local col_str = color_tbl[1] .. " " .. color_tbl[2] .. " " .. color_tbl[3]
local col_str_rg = col_str .. " rg "
@@ -1681,13 +1708,28 @@ function StretchGlyph(t_plb_node, t_plb_glyph_node, t_gluePerJoiner, t_dir, t_fi
node_glue.leader.dir = t_dir
- node.insert_after(t_plb_node.list, t_plb_glyph_node, node_glue)
+ local t_plb_glyph_node_next = t_plb_glyph_node.next
+ local t_plb_glyph_node_next_id = t_plb_glyph_node_next.id
+ if not t_plb_glyph_node_next then
+ node.insert_after(t_plb_node.list, t_plb_glyph_node, node_glue)
+ else
+ if t_plb_glyph_node_next_id == GLYPH then
+ local t_plb_glyph_node_next_char = t_plb_glyph_node_next.char
+ if peCharTableDiacritic[t_plb_glyph_node_next_char] then
+ node.insert_after(t_plb_node.list, t_plb_glyph_node_next, node_glue)
+ else
+ node.insert_after(t_plb_node.list, t_plb_glyph_node, node_glue)
+ end
+ else
+ node.insert_after(t_plb_node.list, t_plb_glyph_node, node_glue)
+ end
+ end
if t_filler == "leaders+hrule" then
for tn in node.traverse(t_plb_node.head) do
local tn_id = tn.id
local tn_subtype = tn.subtype
- if tn_id == 12 and tn_subtype == 100 then
+ if tn_id == GLUE and tn_subtype == 100 then
local t_hbox = node.new(HLIST)
local t_hrule = node.copy(tn)
@@ -1731,20 +1773,20 @@ function GetFillerSpec(t_plb_node, t_plb_head_node, t_tbl_line_fields, t_CharTab
for p in node.traverse(t_plb_head_node) do
local p_id = p.id
local p_subtype = p.subtype
- if p_id == 0 then
+ if p_id == HLIST then
t_tbl_line_fields.lineWidthRemainder = t_tbl_line_fields.lineWidthRemainder - p.width
if p.subtype ~= 3 then
tbl_hlist_nodes[ #tbl_hlist_nodes + 1 ] = p
end
- elseif p_id == 1 then
+ elseif p_id == VLIST then
t_tbl_line_fields.lineWidthRemainder = t_tbl_line_fields.lineWidthRemainder - p.width
tbl_vlist_nodes[ #tbl_vlist_nodes + 1 ] = p
- elseif p_id == 12 then
+ elseif p_id == GLUE then
tbl_p_glue = GetGlue(p, t_plb_node)
t_tbl_line_fields.lineWidthRemainder = t_tbl_line_fields.lineWidthRemainder - tbl_p_glue["effective_glue"]
t_tbl_line_fields.total_glues = t_tbl_line_fields.total_glues + 1
t_tbl_line_fields.stretchedGlue = t_tbl_line_fields.stretchedGlue + tbl_p_glue["delta"]
- elseif p_id == 29 then
+ elseif p_id == GLYPH then
tbl_p_glyph, t_tbl_line_fields = GetGlyph(p, t_tbl_line_fields, t_CharTableInitial, t_CharTableMedial, t_CharTableFinal)
selected_font_old = selected_font
selected_font = tbl_p_glyph["font"]
@@ -1781,7 +1823,7 @@ function ProcessTableHlist(tmphl_n)
local tbl_p_glue, tbl_p_glyph
- if (tmphl_n_id == 0) and (tmphl_n_subtype == 1 or tmphl_n_subtype == 2) then
+ if (tmphl_n_id == HLIST) and (tmphl_n_subtype == 1 or tmphl_n_subtype == 2) then
tbl_line_fields.line_width = tmphl_n.width
tbl_line_fields.line_dir = tmphl_n.dir
tbl_line_fields.lineWidthRemainder = tbl_line_fields.line_width
@@ -1846,9 +1888,9 @@ function ProcessTableVlist(tmpvl_n)
local tmpvl_n_subtype = tmpvl_n.subtype
for vbNode in node.traverse(tmpvl_n) do
- if vbNode.id == 1 and vbNode.subtype == 0 then
+ if vbNode.id == VLIST and vbNode.subtype == 0 then
for tr_vbNode in node.traverse(vbNode.head) do
- if (tr_vbNode.id == 0) and (tr_vbNode.subtype == 1 or tr_vbNode.subtype == 2) then
+ if (tr_vbNode.id == HLIST) and (tr_vbNode.subtype == 1 or tr_vbNode.subtype == 2) then
ProcessTableHlist(tr_vbNode)
end
end