diff options
30 files changed, 155 insertions, 65 deletions
diff --git a/Master/texmf-dist/doc/latex/texnegar/INSTALL.txt b/Master/texmf-dist/doc/latex/texnegar/INSTALL.txt index 30a096fb97f..23e69ebe1fc 100644 --- a/Master/texmf-dist/doc/latex/texnegar/INSTALL.txt +++ b/Master/texmf-dist/doc/latex/texnegar/INSTALL.txt @@ -1,7 +1,7 @@ texnegar -- INSTALL ====================== - Source: texnegar.dtx (2021-01-31 v0.1d) + Source: texnegar.dtx (2021-02-09 v0.1e) Author: Hossein Movahhedian Info: filecontents + macro + verbatim License: LPPL 1.3c diff --git a/Master/texmf-dist/doc/latex/texnegar/doc-ligature-texnegar.pdf b/Master/texmf-dist/doc/latex/texnegar/doc-ligature-texnegar.pdf Binary files differindex 1a2a98538c7..49c7460249c 100644 --- a/Master/texmf-dist/doc/latex/texnegar/doc-ligature-texnegar.pdf +++ b/Master/texmf-dist/doc/latex/texnegar/doc-ligature-texnegar.pdf diff --git a/Master/texmf-dist/doc/latex/texnegar/doc-ligature-xep.pdf b/Master/texmf-dist/doc/latex/texnegar/doc-ligature-xep.pdf Binary files differindex abe4facd9ed..8cb68fb7f35 100644 --- a/Master/texmf-dist/doc/latex/texnegar/doc-ligature-xep.pdf +++ b/Master/texmf-dist/doc/latex/texnegar/doc-ligature-xep.pdf diff --git a/Master/texmf-dist/doc/latex/texnegar/doc-samples-glyph.pdf b/Master/texmf-dist/doc/latex/texnegar/doc-samples-glyph.pdf Binary files differindex 9461731e028..4cc8fcee481 100644 --- a/Master/texmf-dist/doc/latex/texnegar/doc-samples-glyph.pdf +++ b/Master/texmf-dist/doc/latex/texnegar/doc-samples-glyph.pdf diff --git a/Master/texmf-dist/doc/latex/texnegar/doc-samples-hrule.pdf b/Master/texmf-dist/doc/latex/texnegar/doc-samples-hrule.pdf Binary files differindex 25e9856e580..36c09699037 100644 --- a/Master/texmf-dist/doc/latex/texnegar/doc-samples-hrule.pdf +++ b/Master/texmf-dist/doc/latex/texnegar/doc-samples-hrule.pdf diff --git a/Master/texmf-dist/doc/latex/texnegar/doc-samples-xep.pdf b/Master/texmf-dist/doc/latex/texnegar/doc-samples-xep.pdf Binary files differindex e1dbc20a38c..4cbeccc9315 100644 --- a/Master/texmf-dist/doc/latex/texnegar/doc-samples-xep.pdf +++ b/Master/texmf-dist/doc/latex/texnegar/doc-samples-xep.pdf diff --git a/Master/texmf-dist/doc/latex/texnegar/texnegar-doc.ltx b/Master/texmf-dist/doc/latex/texnegar/texnegar-doc.ltx index 6b38d66e34a..124d153befd 100644 --- a/Master/texmf-dist/doc/latex/texnegar/texnegar-doc.ltx +++ b/Master/texmf-dist/doc/latex/texnegar/texnegar-doc.ltx @@ -63,7 +63,7 @@ } } -\date{Released \quad 2021-01-31 \quad v0.1d} +\date{Released \quad 2021-02-09 \quad v0.1e} \definecolor{HMhighlightBlueI}{rgb}{0,0,1} \definecolor{HMhighlightbgYellowII}{rgb}{1,1,1} @@ -535,6 +535,12 @@ I also would like to thank the developer teams of TeX's friends especially LaTeX fonts other than \textsf{HM Series} and \textsf{Adobe Arab}. \end{Itemize} +\SubSecItem{2021-02-09~v0.1e} +\begin{Itemize} + \item Fixed the problem of inserting the kashida before the diacritical marks. Now, after stretching, + the diacritical marks appear before kashida. +\end{Itemize} + \section*{To Do's} To do diff --git a/Master/texmf-dist/doc/latex/texnegar/texnegar-doc.pdf b/Master/texmf-dist/doc/latex/texnegar/texnegar-doc.pdf Binary files differindex 75a809b26d5..fcf76c2da55 100644 --- a/Master/texmf-dist/doc/latex/texnegar/texnegar-doc.pdf +++ b/Master/texmf-dist/doc/latex/texnegar/texnegar-doc.pdf diff --git a/Master/texmf-dist/doc/latex/texnegar/texnegar-luatex-glyph.pdf b/Master/texmf-dist/doc/latex/texnegar/texnegar-luatex-glyph.pdf Binary files differindex 38f55ce7aee..453573d8c28 100644 --- a/Master/texmf-dist/doc/latex/texnegar/texnegar-luatex-glyph.pdf +++ b/Master/texmf-dist/doc/latex/texnegar/texnegar-luatex-glyph.pdf diff --git a/Master/texmf-dist/doc/latex/texnegar/texnegar-luatex-leaders-glyph.pdf b/Master/texmf-dist/doc/latex/texnegar/texnegar-luatex-leaders-glyph.pdf Binary files differindex d2175bb022d..6f6bd2823e0 100644 --- a/Master/texmf-dist/doc/latex/texnegar/texnegar-luatex-leaders-glyph.pdf +++ b/Master/texmf-dist/doc/latex/texnegar/texnegar-luatex-leaders-glyph.pdf diff --git a/Master/texmf-dist/doc/latex/texnegar/texnegar-luatex-leaders-hrule.pdf b/Master/texmf-dist/doc/latex/texnegar/texnegar-luatex-leaders-hrule.pdf Binary files differindex 245750465ab..222eb781083 100644 --- a/Master/texmf-dist/doc/latex/texnegar/texnegar-luatex-leaders-hrule.pdf +++ b/Master/texmf-dist/doc/latex/texnegar/texnegar-luatex-leaders-hrule.pdf diff --git a/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-bidi-glyph.pdf b/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-bidi-glyph.pdf Binary files differindex b27a5a2d230..f4ca7ba05f5 100644 --- a/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-bidi-glyph.pdf +++ b/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-bidi-glyph.pdf diff --git a/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-bidi-leaders-glyph.pdf b/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-bidi-leaders-glyph.pdf Binary files differindex 8ebdff53b38..0cbd1edd495 100644 --- a/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-bidi-leaders-glyph.pdf +++ b/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-bidi-leaders-glyph.pdf diff --git a/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-bidi-leaders-hrule.pdf b/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-bidi-leaders-hrule.pdf Binary files differindex e45da3f31fe..dd10b46f261 100644 --- a/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-bidi-leaders-hrule.pdf +++ b/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-bidi-leaders-hrule.pdf diff --git a/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-xepersian-glyph.pdf b/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-xepersian-glyph.pdf Binary files differindex 16a3d0bac9b..dce968d0d86 100644 --- a/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-xepersian-glyph.pdf +++ b/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-xepersian-glyph.pdf diff --git a/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-xepersian-leaders-glyph.pdf b/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-xepersian-leaders-glyph.pdf Binary files differindex b76e2e3e154..8359e4ca0f0 100644 --- a/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-xepersian-leaders-glyph.pdf +++ b/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-xepersian-leaders-glyph.pdf diff --git a/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-xepersian-leaders-hrule.pdf b/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-xepersian-leaders-hrule.pdf Binary files differindex db2648da2da..09b90cf0797 100644 --- a/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-xepersian-leaders-hrule.pdf +++ b/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-xepersian-leaders-hrule.pdf diff --git a/Master/texmf-dist/doc/latex/texnegar/texnegar.pdf b/Master/texmf-dist/doc/latex/texnegar/texnegar.pdf Binary files differindex 3abdf6da0b0..a5c1d33ee5e 100644 --- a/Master/texmf-dist/doc/latex/texnegar/texnegar.pdf +++ b/Master/texmf-dist/doc/latex/texnegar/texnegar.pdf diff --git a/Master/texmf-dist/doc/latex/texnegar/xepersian-XB.pdf b/Master/texmf-dist/doc/latex/texnegar/xepersian-XB.pdf Binary files differindex 18a3e065fa8..1cad32f51d4 100644 --- a/Master/texmf-dist/doc/latex/texnegar/xepersian-XB.pdf +++ b/Master/texmf-dist/doc/latex/texnegar/xepersian-XB.pdf 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 diff --git a/Master/texmf-dist/tex/latex/texnegar/texnegar-char-table.lua b/Master/texmf-dist/tex/latex/texnegar/texnegar-char-table.lua index 64ba467ee45..c1c7fe3ade6 100644 --- a/Master/texmf-dist/tex/latex/texnegar/texnegar-char-table.lua +++ b/Master/texmf-dist/tex/latex/texnegar/texnegar-char-table.lua @@ -16,8 +16,8 @@ -- 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", @@ -30,6 +30,31 @@ -- 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 @@ -212,7 +237,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'. diff --git a/Master/texmf-dist/tex/latex/texnegar/texnegar-common-kashida.tex b/Master/texmf-dist/tex/latex/texnegar/texnegar-common-kashida.tex index 7f68e2dd9a8..509fac80f29 100644 --- a/Master/texmf-dist/tex/latex/texnegar/texnegar-common-kashida.tex +++ b/Master/texmf-dist/tex/latex/texnegar/texnegar-common-kashida.tex @@ -12,7 +12,7 @@ %% version 1.3c or higher (your choice). The latest version of %% this license is at: http://www.latex-project.org/lppl.txt %% -\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 { diff --git a/Master/texmf-dist/tex/latex/texnegar/texnegar-ini.lua b/Master/texmf-dist/tex/latex/texnegar/texnegar-ini.lua index 18b711294be..457de8b2b93 100644 --- a/Master/texmf-dist/tex/latex/texnegar/texnegar-ini.lua +++ b/Master/texmf-dist/tex/latex/texnegar/texnegar-ini.lua @@ -16,8 +16,8 @@ -- 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", diff --git a/Master/texmf-dist/tex/latex/texnegar/texnegar-ini.tex b/Master/texmf-dist/tex/latex/texnegar/texnegar-ini.tex index 659b2988af8..18a501e622c 100644 --- a/Master/texmf-dist/tex/latex/texnegar/texnegar-ini.tex +++ b/Master/texmf-dist/tex/latex/texnegar/texnegar-ini.tex @@ -12,7 +12,7 @@ %% version 1.3c or higher (your choice). The latest version of %% this license is at: http://www.latex-project.org/lppl.txt %% -\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} @@ -447,6 +447,7 @@ \bool_if:NF \l_texnegar_minimal_bool { + \directlua{dofile(kpse.find_file("luatex-tools.lua"))} \input texnegar-luabidi.tex } diff --git a/Master/texmf-dist/tex/latex/texnegar/texnegar-luatex-kashida.lua b/Master/texmf-dist/tex/latex/texnegar/texnegar-luatex-kashida.lua index 9761462210e..a6f2fc97feb 100644 --- a/Master/texmf-dist/tex/latex/texnegar/texnegar-luatex-kashida.lua +++ b/Master/texmf-dist/tex/latex/texnegar/texnegar-luatex-kashida.lua @@ -16,8 +16,8 @@ -- 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", @@ -30,7 +30,7 @@ -- 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 @@ -41,6 +41,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") @@ -143,11 +144,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 " @@ -179,17 +180,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 " @@ -305,13 +306,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) @@ -355,20 +371,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"] @@ -405,7 +421,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 @@ -470,9 +486,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 diff --git a/Master/texmf-dist/tex/latex/texnegar/texnegar-luatex.sty b/Master/texmf-dist/tex/latex/texnegar/texnegar-luatex.sty index 8490d2a5f11..70240a4478f 100644 --- a/Master/texmf-dist/tex/latex/texnegar/texnegar-luatex.sty +++ b/Master/texmf-dist/tex/latex/texnegar/texnegar-luatex.sty @@ -12,7 +12,7 @@ %% version 1.3c or higher (your choice). The latest version of %% this license is at: http://www.latex-project.org/lppl.txt %% -\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 } diff --git a/Master/texmf-dist/tex/latex/texnegar/texnegar-xetex-kashida.tex b/Master/texmf-dist/tex/latex/texnegar/texnegar-xetex-kashida.tex index 6e2d4d25b15..52d56f216fd 100644 --- a/Master/texmf-dist/tex/latex/texnegar/texnegar-xetex-kashida.tex +++ b/Master/texmf-dist/tex/latex/texnegar/texnegar-xetex-kashida.tex @@ -12,7 +12,7 @@ %% version 1.3c or higher (your choice). The latest version of %% this license is at: http://www.latex-project.org/lppl.txt %% -\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 diff --git a/Master/texmf-dist/tex/latex/texnegar/texnegar-xetex.sty b/Master/texmf-dist/tex/latex/texnegar/texnegar-xetex.sty index e2c6f8710d1..2e27bdf3a2a 100644 --- a/Master/texmf-dist/tex/latex/texnegar/texnegar-xetex.sty +++ b/Master/texmf-dist/tex/latex/texnegar/texnegar-xetex.sty @@ -13,7 +13,7 @@ %% this license is at: http://www.latex-project.org/lppl.txt %% \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 } diff --git a/Master/texmf-dist/tex/latex/texnegar/texnegar.lua b/Master/texmf-dist/tex/latex/texnegar/texnegar.lua index 2c9ee7897b0..5a9a428d4d7 100644 --- a/Master/texmf-dist/tex/latex/texnegar/texnegar.lua +++ b/Master/texmf-dist/tex/latex/texnegar/texnegar.lua @@ -16,8 +16,8 @@ -- 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", diff --git a/Master/texmf-dist/tex/latex/texnegar/texnegar.sty b/Master/texmf-dist/tex/latex/texnegar/texnegar.sty index b1dfe7f0d3a..a95b7497079 100644 --- a/Master/texmf-dist/tex/latex/texnegar/texnegar.sty +++ b/Master/texmf-dist/tex/latex/texnegar/texnegar.sty @@ -21,7 +21,7 @@ \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 { |