texlive[57581] Master/texmf-dist: texnegar (31jan21)
commits+karl at tug.org
commits+karl at tug.org
Sun Jan 31 22:36:25 CET 2021
Revision: 57581
http://tug.org/svn/texlive?view=revision&revision=57581
Author: karl
Date: 2021-01-31 22:36:25 +0100 (Sun, 31 Jan 2021)
Log Message:
-----------
texnegar (31jan21)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/texnegar/INSTALL.txt
trunk/Master/texmf-dist/doc/latex/texnegar/doc-ligature-texnegar.pdf
trunk/Master/texmf-dist/doc/latex/texnegar/doc-ligature-xep.pdf
trunk/Master/texmf-dist/doc/latex/texnegar/doc-samples-glyph.pdf
trunk/Master/texmf-dist/doc/latex/texnegar/doc-samples-hrule.pdf
trunk/Master/texmf-dist/doc/latex/texnegar/doc-samples-xep.pdf
trunk/Master/texmf-dist/doc/latex/texnegar/texnegar-doc.ltx
trunk/Master/texmf-dist/doc/latex/texnegar/texnegar-doc.pdf
trunk/Master/texmf-dist/doc/latex/texnegar/texnegar-luatex-glyph.pdf
trunk/Master/texmf-dist/doc/latex/texnegar/texnegar-luatex-leaders-glyph.pdf
trunk/Master/texmf-dist/doc/latex/texnegar/texnegar-luatex-leaders-hrule.pdf
trunk/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-bidi-glyph.pdf
trunk/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-bidi-leaders-glyph.pdf
trunk/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-bidi-leaders-hrule.pdf
trunk/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-xepersian-glyph.pdf
trunk/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-xepersian-leaders-glyph.pdf
trunk/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-xepersian-leaders-hrule.pdf
trunk/Master/texmf-dist/doc/latex/texnegar/texnegar.pdf
trunk/Master/texmf-dist/doc/latex/texnegar/xepersian-XB.pdf
trunk/Master/texmf-dist/source/latex/texnegar/texnegar.dtx
trunk/Master/texmf-dist/source/latex/texnegar/texnegar.ins
trunk/Master/texmf-dist/tex/latex/texnegar/texnegar-char-table.lua
trunk/Master/texmf-dist/tex/latex/texnegar/texnegar-common-kashida.tex
trunk/Master/texmf-dist/tex/latex/texnegar/texnegar-ini.lua
trunk/Master/texmf-dist/tex/latex/texnegar/texnegar-ini.tex
trunk/Master/texmf-dist/tex/latex/texnegar/texnegar-luatex-kashida.lua
trunk/Master/texmf-dist/tex/latex/texnegar/texnegar-luatex.sty
trunk/Master/texmf-dist/tex/latex/texnegar/texnegar-xetex-kashida.tex
trunk/Master/texmf-dist/tex/latex/texnegar/texnegar-xetex.sty
trunk/Master/texmf-dist/tex/latex/texnegar/texnegar.lua
trunk/Master/texmf-dist/tex/latex/texnegar/texnegar.sty
Modified: trunk/Master/texmf-dist/doc/latex/texnegar/INSTALL.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/texnegar/INSTALL.txt 2021-01-31 21:35:59 UTC (rev 57580)
+++ trunk/Master/texmf-dist/doc/latex/texnegar/INSTALL.txt 2021-01-31 21:36:25 UTC (rev 57581)
@@ -1,7 +1,7 @@
texnegar -- INSTALL
======================
- Source: texnegar.dtx (2021-01-27 v0.1c)
+ Source: texnegar.dtx (2021-01-31 v0.1d)
Author: Hossein Movahhedian
Info: filecontents + macro + verbatim
License: LPPL 1.3c
@@ -9,23 +9,23 @@
<dma8hm1334 AT gmail DOT com>
- To extract the package and at the same time produce the
- documentation, execute: xelatex thrice on texnegar.dtx.
+ documentation, execute: lualatex or xelatex thrice on texnegar.dtx.
Files should then be moved to appropriate locations.
--- *.dtx -> TEXMF/source/xelatex/texnegar/
--- *.ins -> TEXMF/source/xelatex/texnegar/
+-- *.dtx -> TEXMF/source/latex/texnegar/
+-- *.ins -> TEXMF/source/latex/texnegar/
--- *.sty -> TEXMF/tex/xelatex/texnegar/
--- *.lua -> TEXMF/tex/xelatex/texnegar/
--- texnegar-ini.tex -> TEXMF/tex/xelatex/texnegar/
--- texnegar-xetex-kashida.tex -> TEXMF/tex/xelatex/texnegar/
--- texnegar-common-kashida.tex -> TEXMF/tex/xelatex/texnegar/
+-- *.sty -> TEXMF/tex/latex/texnegar/
+-- *.lua -> TEXMF/tex/latex/texnegar/
+-- texnegar-ini.tex -> TEXMF/tex/latex/texnegar/
+-- texnegar-xetex-kashida.tex -> TEXMF/tex/latex/texnegar/
+-- texnegar-common-kashida.tex -> TEXMF/tex/latex/texnegar/
--- *.pdf -> TEXMF/doc/xelatex/texnegar/
--- *.tex -> TEXMF/doc/xelatex/texnegar/
--- *.ltx -> TEXMF/doc/xelatex/texnegar/
--- *.txt -> TEXMF/doc/xelatex/texnegar/
+-- *.pdf -> TEXMF/doc/latex/texnegar/
+-- *.tex -> TEXMF/doc/latex/texnegar/
+-- *.ltx -> TEXMF/doc/latex/texnegar/
+-- *.txt -> TEXMF/doc/latex/texnegar/
Don't forget to run 'texconfig rehash' afterwards.
Modified: trunk/Master/texmf-dist/doc/latex/texnegar/doc-ligature-texnegar.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/texnegar/doc-ligature-xep.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/texnegar/doc-samples-glyph.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/texnegar/doc-samples-hrule.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/texnegar/doc-samples-xep.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/texnegar/texnegar-doc.ltx
===================================================================
--- trunk/Master/texmf-dist/doc/latex/texnegar/texnegar-doc.ltx 2021-01-31 21:35:59 UTC (rev 57580)
+++ trunk/Master/texmf-dist/doc/latex/texnegar/texnegar-doc.ltx 2021-01-31 21:36:25 UTC (rev 57581)
@@ -1,7 +1,7 @@
%%
%% This is file `texnegar-doc.tex'
%%
-%% Copyright (c) Hossein Movahhedian 2020-2021
+%% Copyright (C) 2020-2021 Hossein Movahhedian
%%
%% It may be distributed and/or modified under the LaTeX Project Public License,
%% version 1.3c or higher (your choice). The latest version of
@@ -63,7 +63,7 @@
}
}
-\date{Released \quad 2021-01-27 \quad v0.1c}
+\date{Released \quad 2021-01-31 \quad v0.1d}
\definecolor{HMhighlightBlueI}{rgb}{0,0,1}
\definecolor{HMhighlightbgYellowII}{rgb}{1,1,1}
@@ -281,7 +281,7 @@
for using \texttt{texnegar} to implement kashida feature only.
\item \indextermsubsub{General Options}{\textbf{General Options}}{\texttt{Minimal}}{Off}: \\
- for using \texttt{texnegar} as a general purpose typesetter (including kashida implementation).
+ for using \texttt{texnegar} as a general purpose Persian typesetter (including kashida implementation).
This is the default value.
\end{itemize}
@@ -389,6 +389,26 @@
\begin{itemize}
\item \indexterm{LuaLaTeX-only Options}{\textbf{\hologo{LuaLaTeX}-only Options}}: \\
\begin{itemize}
+ \item \indextermsub{LuaLaTeX-only Options}{\textbf{\hologo{LuaLaTeX}-only Options}}{\texttt{Kashidafontfamily}}: \\
+ that fixes the issue in \texttt{ArabLuaTeX} if one uses fonts other than \textsf{HM Series} and \textsf{Adobe Arab},
+ among those are fonts such as \textsf{Scheherazade}, \textsf{Scheherazade New}, and \textsf{Amiri}.
+ The value of this option, as returned by \hologo{LuaTeX}, is the family name of the font without spaces.
+ A few examples of these values and the corresponding fonts are:
+
+ \begin{longtable}{ll}
+ value & corresponding fonts \\
+ \hline
+ \texttt{AdobeArab} & \textsf{\small Adobe Arab Regular}, \\
+ & \textsf{\small Adobe Arab Bold}, \dots\unkern. \\
+ \texttt{Amiri} & \textsf{\small Amiri Regular, Amiri Bold}, \\
+ & \textsf{\small Amiri Slanted}, \dots\unkern. \\
+ \texttt{HMXKayhan} & \textsf{\small HM XKayhan Regular}, \\
+ & \textsf{\small HM XKayhan Bold}, \dots\unkern. \\
+ \texttt{ScheherazadeNew} & \textsf{\small Scheherazade New Regular}, \\
+ & \textsf{\small Scheherazade New Bold}, \dots\unkern. \\
+ \texttt{Scheherazade} & \textsf{\small Scheherazade}, \dots\unkern. \\
+ \end{longtable}
+
\item \indextermsub{LuaLaTeX-only Options}{\textbf{\hologo{LuaLaTeX}-only Options}}{\texttt{hboxrecursion}}: \\
which enables kashida justification inside horizontal boxes recursively.
@@ -509,6 +529,12 @@
\item Fixed the problem with \texttt{Scheherazade} and \texttt{Amiri} fonts.
\end{Itemize}
+\SubSecItem{2021-01-31~v0.1d}
+\begin{Itemize}
+ \item Added the option \texttt{Kashidafontfamily} that fixes the issue in \texttt{ArabLuaTeX} if one uses
+ fonts other than \textsf{HM Series} and \textsf{Adobe Arab}.
+\end{Itemize}
+
\section*{To Do's}
To do
Modified: trunk/Master/texmf-dist/doc/latex/texnegar/texnegar-doc.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/texnegar/texnegar-luatex-glyph.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/texnegar/texnegar-luatex-leaders-glyph.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/texnegar/texnegar-luatex-leaders-hrule.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-bidi-glyph.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-bidi-leaders-glyph.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-bidi-leaders-hrule.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-xepersian-glyph.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-xepersian-leaders-glyph.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/texnegar/texnegar-xetex-xepersian-leaders-hrule.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/texnegar/texnegar.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/texnegar/xepersian-XB.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/latex/texnegar/texnegar.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/texnegar/texnegar.dtx 2021-01-31 21:35:59 UTC (rev 57580)
+++ trunk/Master/texmf-dist/source/latex/texnegar/texnegar.dtx 2021-01-31 21:36:25 UTC (rev 57581)
@@ -101,7 +101,7 @@
% }^^A
% }
%
-% \date{Released \quad 2021-01-27 \quad v0.1c}
+% \date{Released \quad 2021-01-31 \quad v0.1d}
%
% \maketitle
%
@@ -137,7 +137,7 @@
\RequirePackage{newverbs}[2010/09/02]
\RequirePackage{environ}[2014/05/04]
-\ProvidesExplPackage {texnegar} {2021-01-27} {0.1c} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
+\ProvidesExplPackage {texnegar} {2021-01-31} {0.1d} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
\sys_if_engine_luatex:T
{
@@ -165,7 +165,7 @@
%
% \begin{macrocode}
%<*texnegar-luatex-sty>
-\ProvidesExplPackage {texnegar-luatex} {2021-01-27} {0.1c} { Full implementation of kashida feature in xetex and luatex }
+\ProvidesExplPackage {texnegar-luatex} {2021-01-31} {0.1d} { Full implementation of kashida feature in xetex and luatex }
\tex_input:D { texnegar-ini.tex }
@@ -201,7 +201,7 @@
% \begin{macrocode}
%<*texnegar-xetex-sty>
\RequirePackage{zref-savepos}[2020-03-03]
-\ProvidesExplPackage {texnegar-xetex} {2021-01-27} {0.1c} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
+\ProvidesExplPackage {texnegar-xetex} {2021-01-31} {0.1d} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
\tex_input:D { texnegar-ini.tex }
@@ -218,7 +218,7 @@
%
% \begin{macrocode}
%<*texnegar-ini-tex>
-\ProvidesExplFile {texnegar-ini.tex} {2021-01-27} {0.1c} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
+\ProvidesExplFile {texnegar-ini.tex} {2021-01-31} {0.1d} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
\def\TeXNegar{\TeX Negar}
@@ -278,6 +278,10 @@
\bool_set_false:N \l_texnegar_kashida_fix_bool
+\bool_set_false:N \l_texnegar_kashida_fontfamily_bool
+\tl_new:N \l_texnegar_kashida_fontfamily_tl
+\tl_set:Nn \l_texnegar_kashida_fontfamily_tl { N/A }
+
\bool_set_false:N \l_texnegar_kashida_glyph_bool
\bool_set_false:N \l_texnegar_kashida_leaders_glyph_bool
\bool_set_false:N \l_texnegar_kashida_leaders_hrule_bool
@@ -409,6 +413,22 @@
\keys_define:nn { texnegar }
{
+ Kashidafontfamily .code:n =
+ {
+ \tl_set:Nn \l_tmpa_tl { #1 }
+ \tl_case:Nn \l_tmpa_tl
+ {
+ \tl_if_empty:NTF \l_tmpa_tl
+ {
+ \bool_set_false:N \l_texnegar_kashida_fontfamily_bool
+ }
+ {
+ \bool_set_true:N \l_texnegar_kashida_fontfamily_bool
+ \tl_set:Nx \l_texnegar_kashida_fontfamily_tl { \l_tmpa_tl }
+ }
+ }
+ } ,
+
Minimal .code:n =
{
\tl_set:Nn \l_tmpa_tl { #1 }
@@ -643,7 +663,7 @@
% \subsection{File: \texttt{texnegar-common-kashida.tex}}
% \begin{macrocode}
%<*texnegar-common-kashida-tex>
-\ProvidesExplFile {texnegar-common-kashida.tex} {2021-01-27} {0.1c} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
+\ProvidesExplFile {texnegar-common-kashida.tex} {2021-01-31} {0.1d} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
\bool_if:NT \l_texnegar_ligature_bool
{
@@ -720,7 +740,7 @@
%
% \begin{macrocode}
%<*texnegar-xetex-kashida-tex>
-\ProvidesExplFile {texnegar-xetex-kashida.tex} {2021-01-27} {0.1c} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
+\ProvidesExplFile {texnegar-xetex-kashida.tex} {2021-01-31} {0.1d} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
\newXeTeXintercharclass \c_texnegar_d_charclass % dual-joiner class
\newXeTeXintercharclass \c_texnegar_l_charclass % lam
@@ -941,8 +961,8 @@
-- local texnegar_char_table = texnegar_char_table
-- texnegar_char_table.module = {
-- name = "texnegar_char_table",
--- version = "0.1c",
--- date = "2021-01-27",
+-- version = "0.1d",
+-- date = "2021-01-31",
-- description = "Full implementation of kashida feature in XeLaTex and LuaLaTeX",
-- author = "Hossein Movahhedian",
-- copyright = "Hossein Movahhedian",
@@ -1166,8 +1186,8 @@
-- local texnegar = texnegar
-- texnegar.module = {
-- name = "texnegar",
--- version = "0.1c",
--- date = "2021-01-27",
+-- version = "0.1d",
+-- date = "2021-01-31",
-- description = "Full implementation of kashida feature in XeLaTex and LuaLaTeX",
-- author = "Hossein Movahhedian",
-- copyright = "Hossein Movahhedian",
@@ -1180,6 +1200,8 @@
-- texnegar.warning = warn or (function (s) luatexbase.module_warning("texnegar", s) end)
-- texnegar.error = err or (function (s) luatexbase.module_error("texnegar", s) end)
+local l_texnegar_kashida_fontfamily_bool = token.create("l_texnegar_kashida_fontfamily_bool")
+
local debug_getinfo = debug.getinfo
local string_format = string.format
@@ -1218,10 +1240,6 @@
".*_(ini)t?$", ".*_(ini)t?_.*",
".*_(med)i?$", ".*_(med)i?_.*",
".*_(fin)a?$", ".*_(fin)a?_.*",
-
- ".*_(AltIni)t?[0-9]?$", ".*_(AltIni)t?[0-9]?_.*",
- ".*_(AltMed)i?[0-9]?$", ".*_(AltMed)i?[0-9]?_.*",
- ".*_(AltFin)a?[0-9]?$", ".*_(AltFin)a?[0-9]?_.*",
}
function GetFontsChars()
@@ -1261,20 +1279,25 @@
char_name = f.glyphs[f_id.characters[glyph_idx].index].name
char_unicode = f.glyphs[f_id.characters[glyph_idx].index].unicode
char_class = f.glyphs[f_id.characters[glyph_idx].index].class
- if not tbl_fonts_chars[f_fontname][glyph_idx] then
- if string.match(f_fontname, "^(Amiri).*") == "Amiri" and char_name == 'uni0640.long1' then
- current_kashida_unicode = glyph_idx
- end
- tbl_fonts_chars[f_fontname][glyph_idx] = {char_name, char_unicode, char_class}
- for _, pattern in ipairs( pattern_list ) do
- local pos_alt = string.match(char_name, pattern)
- if pos_alt == 'ini' or pos_alt == 'AltIni' then
- tbl_fonts_chars_init[f_fontname][glyph_idx] = {char_name, char_unicode, char_class}
- elseif pos_alt == 'med' or pos_alt == 'AltMed' then
- tbl_fonts_chars_medi[f_fontname][glyph_idx] = {char_name, char_unicode, char_class}
- elseif pos_alt == 'fin' or pos_alt == 'AltFin' then
- tbl_fonts_chars_fina[f_fontname][glyph_idx] = {char_name, char_unicode, char_class}
+
+ kashida_fontfamily = token.get_macro("l_texnegar_kashida_fontfamily_tl")
+ fontfamily_match = string.match(f_fontname, "^(" .. kashida_fontfamily .. ").*")
+ if fontfamily_match == kashida_fontfamily then
+ if not tbl_fonts_chars[f_fontname][glyph_idx] then
+ if string.match(f_fontname, "^(Amiri).*") == "Amiri" and char_name == 'uni0640.long1' then
+ current_kashida_unicode = glyph_idx
end
+ tbl_fonts_chars[f_fontname][glyph_idx] = {char_name, char_unicode, char_class}
+ for _, pattern in ipairs( pattern_list ) do
+ local pos_alt = string.match(char_name, pattern)
+ if pos_alt == 'ini' or pos_alt == 'AltIni' then
+ tbl_fonts_chars_init[f_fontname][glyph_idx] = {char_name, char_unicode, char_class}
+ elseif pos_alt == 'med' or pos_alt == 'AltMed' then
+ tbl_fonts_chars_medi[f_fontname][glyph_idx] = {char_name, char_unicode, char_class}
+ elseif pos_alt == 'fin' or pos_alt == 'AltFin' then
+ tbl_fonts_chars_fina[f_fontname][glyph_idx] = {char_name, char_unicode, char_class}
+ end
+ end
end
end
end
@@ -1315,8 +1338,8 @@
-- local texnegar_ini = texnegar_ini
-- texnegar_ini.module = {
-- name = "texnegar_ini",
--- version = "0.1c",
--- date = "2021-01-27",
+-- version = "0.1d",
+-- date = "2021-01-31",
-- description = "Full implementation of kashida feature in XeLaTex and LuaLaTeX",
-- author = "Hossein Movahhedian",
-- copyright = "Hossein Movahhedian",
@@ -1369,8 +1392,8 @@
-- local texnegar_luatex_kashida = texnegar_luatex_kashida
-- texnegar_luatex_kashida.module = {
-- name = "texnegar_luatex_kashida",
--- version = "0.1c",
--- date = "2021-01-27",
+-- version = "0.1d",
+-- date = "2021-01-31",
-- description = "Full implementation of kashida feature in XeLaTex and LuaLaTeX",
-- author = "Hossein Movahhedian",
-- copyright = "Hossein Movahhedian",
@@ -1471,6 +1494,7 @@
local glyph_lang = t_plb_line_glyph_node.lang
local glyph_width = t_plb_line_glyph_node.width
local glyph_data = t_plb_line_glyph_node.data
+
if not (t_CharTableInitial[glyph_char] == nil) then
t_tbl_line_fields.joinerCharInitial = t_tbl_line_fields.joinerCharInitial + 1
t_plb_line_glyph_node.data = 1
@@ -1821,7 +1845,6 @@
local tmpvl_n_id = tmpvl_n.id
local tmpvl_n_subtype = tmpvl_n.subtype
- print(string_format(" %s: 00-0 tmpvl_n: id: %d, subtype: %d", funcName, tmpvl_n_id, tmpvl_n_subtype))
for vbNode in node.traverse(tmpvl_n) do
if vbNode.id == 1 and vbNode.subtype == 0 then
for tr_vbNode in node.traverse(vbNode.head) do
@@ -1844,28 +1867,27 @@
local tbl_fonts_chars_init = { }
local tbl_fonts_chars_medi = { }
local tbl_fonts_chars_fina = { }
+
tbl_fonts_used, tbl_fonts_chars, tbl_fonts_chars_init, tbl_fonts_chars_medi, tbl_fonts_chars_fina = GetFontsChars()
- for k1, v1 in pairs(tbl_fonts_chars_init) do
- for k2, v2 in pairs(tbl_fonts_chars_init[k1]) do
- if k2 and not peCharTableInitial[k2] then
- peCharTableInitial[k2] = utf8.char(k2)
+ local f_fontname
+
+ for f_fontname, v in pairs(tbl_fonts_used) do
+ for k1, v1 in pairs(tbl_fonts_chars_init[f_fontname]) do
+ if k1 and not peCharTableInitial[k1] then
+ peCharTableInitial[k1] = utf8.char(k1)
end
end
- end
- for k1, v1 in pairs(tbl_fonts_chars_medi) do
- for k2, v2 in pairs(tbl_fonts_chars_medi[k1]) do
- if k2 and not peCharTableMedial[k2] then
- peCharTableMedial[k2] = utf8.char(k2)
+ for k1, v1 in pairs(tbl_fonts_chars_medi[f_fontname]) do
+ if k1 and not peCharTableMedial[k1] then
+ peCharTableMedial[k1] = utf8.char(k1)
end
end
- end
- for k1, v1 in pairs(tbl_fonts_chars_fina) do
- for k2, v2 in pairs(tbl_fonts_chars_fina[k1]) do
- if k2 and not peCharTableFinal[k2] then
- peCharTableFinal[k2] = utf8.char(k2)
+ for k1, v1 in pairs(tbl_fonts_chars_fina[f_fontname]) do
+ if k1 and not peCharTableFinal[k1] then
+ peCharTableFinal[k1] = utf8.char(k1)
end
end
end
Modified: trunk/Master/texmf-dist/source/latex/texnegar/texnegar.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/texnegar/texnegar.ins 2021-01-31 21:35:59 UTC (rev 57580)
+++ trunk/Master/texmf-dist/source/latex/texnegar/texnegar.ins 2021-01-31 21:36:25 UTC (rev 57581)
@@ -2,7 +2,7 @@
File: texnegar.ins
-Copyright (C) 2020 Hossein Movahhedian
+Copyright (C) 2020-2021 Hossein Movahhedian
It may be distributed and/or modified under the LaTeX Project Public License,
version 1.3c or higher (your choice). The latest version of
@@ -16,7 +16,7 @@
\preamble
-Copyright (C) 2020 Hossein Movahhedian
+Copyright (C) 2020-2021 Hossein Movahhedian
It may be distributed and/or modified under the LaTeX Project Public License,
version 1.3c or higher (your choice). The latest version of
Modified: trunk/Master/texmf-dist/tex/latex/texnegar/texnegar-char-table.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/texnegar/texnegar-char-table.lua 2021-01-31 21:35:59 UTC (rev 57580)
+++ trunk/Master/texmf-dist/tex/latex/texnegar/texnegar-char-table.lua 2021-01-31 21:36:25 UTC (rev 57581)
@@ -16,8 +16,8 @@
-- local texnegar_char_table = texnegar_char_table
-- texnegar_char_table.module = {
-- name = "texnegar_char_table",
--- version = "0.1c",
--- date = "2021-01-27",
+-- version = "0.1d",
+-- date = "2021-01-31",
-- description = "Full implementation of kashida feature in XeLaTex and LuaLaTeX",
-- author = "Hossein Movahhedian",
-- copyright = "Hossein Movahhedian",
Modified: trunk/Master/texmf-dist/tex/latex/texnegar/texnegar-common-kashida.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/texnegar/texnegar-common-kashida.tex 2021-01-31 21:35:59 UTC (rev 57580)
+++ trunk/Master/texmf-dist/tex/latex/texnegar/texnegar-common-kashida.tex 2021-01-31 21:36:25 UTC (rev 57581)
@@ -6,13 +6,13 @@
%%
%% texnegar.dtx (with options: `texnegar-common-kashida-tex')
%%
-%% Copyright (C) 2020 Hossein Movahhedian
+%% Copyright (C) 2020-2021 Hossein Movahhedian
%%
%% It may be distributed and/or modified under the LaTeX Project Public License,
%% 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-27} {0.1c} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
+\ProvidesExplFile {texnegar-common-kashida.tex} {2021-01-31} {0.1d} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
\bool_if:NT \l_texnegar_ligature_bool
{
Modified: trunk/Master/texmf-dist/tex/latex/texnegar/texnegar-ini.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/texnegar/texnegar-ini.lua 2021-01-31 21:35:59 UTC (rev 57580)
+++ trunk/Master/texmf-dist/tex/latex/texnegar/texnegar-ini.lua 2021-01-31 21:36:25 UTC (rev 57581)
@@ -16,8 +16,8 @@
-- local texnegar_ini = texnegar_ini
-- texnegar_ini.module = {
-- name = "texnegar_ini",
--- version = "0.1c",
--- date = "2021-01-27",
+-- version = "0.1d",
+-- date = "2021-01-31",
-- description = "Full implementation of kashida feature in XeLaTex and LuaLaTeX",
-- author = "Hossein Movahhedian",
-- copyright = "Hossein Movahhedian",
Modified: trunk/Master/texmf-dist/tex/latex/texnegar/texnegar-ini.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/texnegar/texnegar-ini.tex 2021-01-31 21:35:59 UTC (rev 57580)
+++ trunk/Master/texmf-dist/tex/latex/texnegar/texnegar-ini.tex 2021-01-31 21:36:25 UTC (rev 57581)
@@ -6,13 +6,13 @@
%%
%% texnegar.dtx (with options: `texnegar-ini-tex')
%%
-%% Copyright (C) 2020 Hossein Movahhedian
+%% Copyright (C) 2020-2021 Hossein Movahhedian
%%
%% It may be distributed and/or modified under the LaTeX Project Public License,
%% 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-27} {0.1c} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
+\ProvidesExplFile {texnegar-ini.tex} {2021-01-31} {0.1d} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
\def\TeXNegar{\TeX Negar}
@@ -72,6 +72,10 @@
\bool_set_false:N \l_texnegar_kashida_fix_bool
+\bool_set_false:N \l_texnegar_kashida_fontfamily_bool
+\tl_new:N \l_texnegar_kashida_fontfamily_tl
+\tl_set:Nn \l_texnegar_kashida_fontfamily_tl { N/A }
+
\bool_set_false:N \l_texnegar_kashida_glyph_bool
\bool_set_false:N \l_texnegar_kashida_leaders_glyph_bool
\bool_set_false:N \l_texnegar_kashida_leaders_hrule_bool
@@ -203,6 +207,22 @@
\keys_define:nn { texnegar }
{
+ Kashidafontfamily .code:n =
+ {
+ \tl_set:Nn \l_tmpa_tl { #1 }
+ \tl_case:Nn \l_tmpa_tl
+ {
+ \tl_if_empty:NTF \l_tmpa_tl
+ {
+ \bool_set_false:N \l_texnegar_kashida_fontfamily_bool
+ }
+ {
+ \bool_set_true:N \l_texnegar_kashida_fontfamily_bool
+ \tl_set:Nx \l_texnegar_kashida_fontfamily_tl { \l_tmpa_tl }
+ }
+ }
+ } ,
+
Minimal .code:n =
{
\tl_set:Nn \l_tmpa_tl { #1 }
Modified: trunk/Master/texmf-dist/tex/latex/texnegar/texnegar-luatex-kashida.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/texnegar/texnegar-luatex-kashida.lua 2021-01-31 21:35:59 UTC (rev 57580)
+++ trunk/Master/texmf-dist/tex/latex/texnegar/texnegar-luatex-kashida.lua 2021-01-31 21:36:25 UTC (rev 57581)
@@ -16,8 +16,8 @@
-- local texnegar_luatex_kashida = texnegar_luatex_kashida
-- texnegar_luatex_kashida.module = {
-- name = "texnegar_luatex_kashida",
--- version = "0.1c",
--- date = "2021-01-27",
+-- version = "0.1d",
+-- date = "2021-01-31",
-- description = "Full implementation of kashida feature in XeLaTex and LuaLaTeX",
-- author = "Hossein Movahhedian",
-- copyright = "Hossein Movahhedian",
@@ -118,6 +118,7 @@
local glyph_lang = t_plb_line_glyph_node.lang
local glyph_width = t_plb_line_glyph_node.width
local glyph_data = t_plb_line_glyph_node.data
+
if not (t_CharTableInitial[glyph_char] == nil) then
t_tbl_line_fields.joinerCharInitial = t_tbl_line_fields.joinerCharInitial + 1
t_plb_line_glyph_node.data = 1
@@ -468,7 +469,6 @@
local tmpvl_n_id = tmpvl_n.id
local tmpvl_n_subtype = tmpvl_n.subtype
- print(string_format(" %s: 00-0 tmpvl_n: id: %d, subtype: %d", funcName, tmpvl_n_id, tmpvl_n_subtype))
for vbNode in node.traverse(tmpvl_n) do
if vbNode.id == 1 and vbNode.subtype == 0 then
for tr_vbNode in node.traverse(vbNode.head) do
@@ -491,28 +491,27 @@
local tbl_fonts_chars_init = { }
local tbl_fonts_chars_medi = { }
local tbl_fonts_chars_fina = { }
+
tbl_fonts_used, tbl_fonts_chars, tbl_fonts_chars_init, tbl_fonts_chars_medi, tbl_fonts_chars_fina = GetFontsChars()
- for k1, v1 in pairs(tbl_fonts_chars_init) do
- for k2, v2 in pairs(tbl_fonts_chars_init[k1]) do
- if k2 and not peCharTableInitial[k2] then
- peCharTableInitial[k2] = utf8.char(k2)
+ local f_fontname
+
+ for f_fontname, v in pairs(tbl_fonts_used) do
+ for k1, v1 in pairs(tbl_fonts_chars_init[f_fontname]) do
+ if k1 and not peCharTableInitial[k1] then
+ peCharTableInitial[k1] = utf8.char(k1)
end
end
- end
- for k1, v1 in pairs(tbl_fonts_chars_medi) do
- for k2, v2 in pairs(tbl_fonts_chars_medi[k1]) do
- if k2 and not peCharTableMedial[k2] then
- peCharTableMedial[k2] = utf8.char(k2)
+ for k1, v1 in pairs(tbl_fonts_chars_medi[f_fontname]) do
+ if k1 and not peCharTableMedial[k1] then
+ peCharTableMedial[k1] = utf8.char(k1)
end
end
- end
- for k1, v1 in pairs(tbl_fonts_chars_fina) do
- for k2, v2 in pairs(tbl_fonts_chars_fina[k1]) do
- if k2 and not peCharTableFinal[k2] then
- peCharTableFinal[k2] = utf8.char(k2)
+ for k1, v1 in pairs(tbl_fonts_chars_fina[f_fontname]) do
+ if k1 and not peCharTableFinal[k1] then
+ peCharTableFinal[k1] = utf8.char(k1)
end
end
end
Modified: trunk/Master/texmf-dist/tex/latex/texnegar/texnegar-luatex.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/texnegar/texnegar-luatex.sty 2021-01-31 21:35:59 UTC (rev 57580)
+++ trunk/Master/texmf-dist/tex/latex/texnegar/texnegar-luatex.sty 2021-01-31 21:36:25 UTC (rev 57581)
@@ -6,13 +6,13 @@
%%
%% texnegar.dtx (with options: `texnegar-luatex-sty')
%%
-%% Copyright (C) 2020 Hossein Movahhedian
+%% Copyright (C) 2020-2021 Hossein Movahhedian
%%
%% It may be distributed and/or modified under the LaTeX Project Public License,
%% 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-27} {0.1c} { Full implementation of kashida feature in xetex and luatex }
+\ProvidesExplPackage {texnegar-luatex} {2021-01-31} {0.1d} { Full implementation of kashida feature in xetex and luatex }
\tex_input:D { texnegar-ini.tex }
Modified: trunk/Master/texmf-dist/tex/latex/texnegar/texnegar-xetex-kashida.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/texnegar/texnegar-xetex-kashida.tex 2021-01-31 21:35:59 UTC (rev 57580)
+++ trunk/Master/texmf-dist/tex/latex/texnegar/texnegar-xetex-kashida.tex 2021-01-31 21:36:25 UTC (rev 57581)
@@ -6,13 +6,13 @@
%%
%% texnegar.dtx (with options: `texnegar-xetex-kashida-tex')
%%
-%% Copyright (C) 2020 Hossein Movahhedian
+%% Copyright (C) 2020-2021 Hossein Movahhedian
%%
%% It may be distributed and/or modified under the LaTeX Project Public License,
%% 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-27} {0.1c} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
+\ProvidesExplFile {texnegar-xetex-kashida.tex} {2021-01-31} {0.1d} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
\newXeTeXintercharclass \c_texnegar_d_charclass % dual-joiner class
\newXeTeXintercharclass \c_texnegar_l_charclass % lam
Modified: trunk/Master/texmf-dist/tex/latex/texnegar/texnegar-xetex.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/texnegar/texnegar-xetex.sty 2021-01-31 21:35:59 UTC (rev 57580)
+++ trunk/Master/texmf-dist/tex/latex/texnegar/texnegar-xetex.sty 2021-01-31 21:36:25 UTC (rev 57581)
@@ -6,7 +6,7 @@
%%
%% texnegar.dtx (with options: `texnegar-xetex-sty')
%%
-%% Copyright (C) 2020 Hossein Movahhedian
+%% Copyright (C) 2020-2021 Hossein Movahhedian
%%
%% It may be distributed and/or modified under the LaTeX Project Public License,
%% version 1.3c or higher (your choice). The latest version of
@@ -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-27} {0.1c} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
+\ProvidesExplPackage {texnegar-xetex} {2021-01-31} {0.1d} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
\tex_input:D { texnegar-ini.tex }
Modified: trunk/Master/texmf-dist/tex/latex/texnegar/texnegar.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/texnegar/texnegar.lua 2021-01-31 21:35:59 UTC (rev 57580)
+++ trunk/Master/texmf-dist/tex/latex/texnegar/texnegar.lua 2021-01-31 21:36:25 UTC (rev 57581)
@@ -16,8 +16,8 @@
-- local texnegar = texnegar
-- texnegar.module = {
-- name = "texnegar",
--- version = "0.1c",
--- date = "2021-01-27",
+-- version = "0.1d",
+-- date = "2021-01-31",
-- description = "Full implementation of kashida feature in XeLaTex and LuaLaTeX",
-- author = "Hossein Movahhedian",
-- copyright = "Hossein Movahhedian",
@@ -30,6 +30,8 @@
-- texnegar.warning = warn or (function (s) luatexbase.module_warning("texnegar", s) end)
-- texnegar.error = err or (function (s) luatexbase.module_error("texnegar", s) end)
+local l_texnegar_kashida_fontfamily_bool = token.create("l_texnegar_kashida_fontfamily_bool")
+
local debug_getinfo = debug.getinfo
local string_format = string.format
@@ -68,10 +70,6 @@
".*_(ini)t?$", ".*_(ini)t?_.*",
".*_(med)i?$", ".*_(med)i?_.*",
".*_(fin)a?$", ".*_(fin)a?_.*",
-
- ".*_(AltIni)t?[0-9]?$", ".*_(AltIni)t?[0-9]?_.*",
- ".*_(AltMed)i?[0-9]?$", ".*_(AltMed)i?[0-9]?_.*",
- ".*_(AltFin)a?[0-9]?$", ".*_(AltFin)a?[0-9]?_.*",
}
function GetFontsChars()
@@ -111,20 +109,25 @@
char_name = f.glyphs[f_id.characters[glyph_idx].index].name
char_unicode = f.glyphs[f_id.characters[glyph_idx].index].unicode
char_class = f.glyphs[f_id.characters[glyph_idx].index].class
- if not tbl_fonts_chars[f_fontname][glyph_idx] then
- if string.match(f_fontname, "^(Amiri).*") == "Amiri" and char_name == 'uni0640.long1' then
- current_kashida_unicode = glyph_idx
- end
- tbl_fonts_chars[f_fontname][glyph_idx] = {char_name, char_unicode, char_class}
- for _, pattern in ipairs( pattern_list ) do
- local pos_alt = string.match(char_name, pattern)
- if pos_alt == 'ini' or pos_alt == 'AltIni' then
- tbl_fonts_chars_init[f_fontname][glyph_idx] = {char_name, char_unicode, char_class}
- elseif pos_alt == 'med' or pos_alt == 'AltMed' then
- tbl_fonts_chars_medi[f_fontname][glyph_idx] = {char_name, char_unicode, char_class}
- elseif pos_alt == 'fin' or pos_alt == 'AltFin' then
- tbl_fonts_chars_fina[f_fontname][glyph_idx] = {char_name, char_unicode, char_class}
+
+ kashida_fontfamily = token.get_macro("l_texnegar_kashida_fontfamily_tl")
+ fontfamily_match = string.match(f_fontname, "^(" .. kashida_fontfamily .. ").*")
+ if fontfamily_match == kashida_fontfamily then
+ if not tbl_fonts_chars[f_fontname][glyph_idx] then
+ if string.match(f_fontname, "^(Amiri).*") == "Amiri" and char_name == 'uni0640.long1' then
+ current_kashida_unicode = glyph_idx
end
+ tbl_fonts_chars[f_fontname][glyph_idx] = {char_name, char_unicode, char_class}
+ for _, pattern in ipairs( pattern_list ) do
+ local pos_alt = string.match(char_name, pattern)
+ if pos_alt == 'ini' or pos_alt == 'AltIni' then
+ tbl_fonts_chars_init[f_fontname][glyph_idx] = {char_name, char_unicode, char_class}
+ elseif pos_alt == 'med' or pos_alt == 'AltMed' then
+ tbl_fonts_chars_medi[f_fontname][glyph_idx] = {char_name, char_unicode, char_class}
+ elseif pos_alt == 'fin' or pos_alt == 'AltFin' then
+ tbl_fonts_chars_fina[f_fontname][glyph_idx] = {char_name, char_unicode, char_class}
+ end
+ end
end
end
end
Modified: trunk/Master/texmf-dist/tex/latex/texnegar/texnegar.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/texnegar/texnegar.sty 2021-01-31 21:35:59 UTC (rev 57580)
+++ trunk/Master/texmf-dist/tex/latex/texnegar/texnegar.sty 2021-01-31 21:36:25 UTC (rev 57581)
@@ -6,7 +6,7 @@
%%
%% texnegar.dtx (with options: `texnegar-sty')
%%
-%% Copyright (C) 2020 Hossein Movahhedian
+%% Copyright (C) 2020-2021 Hossein Movahhedian
%%
%% It may be distributed and/or modified under the LaTeX Project Public License,
%% version 1.3c or higher (your choice). The latest version of
@@ -21,7 +21,7 @@
\RequirePackage{newverbs}[2010/09/02]
\RequirePackage{environ}[2014/05/04]
-\ProvidesExplPackage {texnegar} {2021-01-27} {0.1c} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
+\ProvidesExplPackage {texnegar} {2021-01-31} {0.1d} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
\sys_if_engine_luatex:T
{
More information about the tex-live-commits
mailing list.