diff options
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/xepersian-hm/kashida-xepersian-hm.def')
-rw-r--r-- | Master/texmf-dist/tex/xelatex/xepersian-hm/kashida-xepersian-hm.def | 69 |
1 files changed, 33 insertions, 36 deletions
diff --git a/Master/texmf-dist/tex/xelatex/xepersian-hm/kashida-xepersian-hm.def b/Master/texmf-dist/tex/xelatex/xepersian-hm/kashida-xepersian-hm.def index 637816e1552..b4e84fca193 100644 --- a/Master/texmf-dist/tex/xelatex/xepersian-hm/kashida-xepersian-hm.def +++ b/Master/texmf-dist/tex/xelatex/xepersian-hm/kashida-xepersian-hm.def @@ -12,15 +12,13 @@ %% version 1.3c or higher (your choice). The latest version of %% this license is at: http://www.latex-project.org/lppl.txt %% -%% File: xepersian-hm.dtx \ExplSyntaxOn -\ProvidesExplFile {kashida-xepersian-hm.def} {2020-04-20} {0.5a} { Fixes~implementation~of~Kashida~in~xepersian~package } +\ProvidesExplFile {kashida-xepersian-hm.def} {2020-04-26} {0.5b} { Fixes~implementation~of~Kashida~in~xepersian~package } \int_const:Nn \c_xephm_zwj_int {"200D} % zero-width joiner \int_const:Nn \c_xephm_lrm_int {"200E} % left-right-mark \int_const:Nn \c_xephm_two_int {2} % 2 \int_const:Nn \c_xephm_four_int {4} % 4 -\int_const:Nn \c_xephm_ksh_int {"0640} % kashida \int_new:N \l_xephm_counter_int @@ -30,9 +28,6 @@ \newXeTeXintercharclass \c_xephm_a_charclass % alef \newXeTeXintercharclass \c_xephm_y_charclass % yeh -\tl_new:N \l_xephm_hskip_zero_tl -\tl_new:N \l_xephm_hskip_default_tl - \dim_new:N \l_xephm_diff_pos_dim %% Partly adapted from LaTeX2e source @@ -58,9 +53,13 @@ \fi: } -\NewDocumentCommand { \discouragebadlinebreaks } { m } +\NewDocumentCommand { \discouragebadlinebreaks } { O{\l_xephm_line_break_penalty_int} O{\c_xephm_skip_b_tl} m } { - \xephm_put_line_breaks:n { #1 } + \IfNoValueF {#1} + { \int_set:Nn \l_xephm_line_break_penalty_int {#1} } + \IfNoValueF {#2} + { \tl_set:Nn \l_xephm_skip_default_tl {#2} } + \xephm_put_line_breaks:n { #3 } } \tl_new:N \l_xephm_line_break_tl @@ -186,31 +185,31 @@ \XeTeXinterchartoks \c_xephm_y_charclass \c_xephm_y_charclass = { \bool_if:NTF \l_xephm_kashida_hm_fix_bool - { \c_xephm_zwj_int \xephm_kashida_glyph \l_xephm_hskip_default_tl \c_xephm_zwj_int } - { \c_xephm_zwj_int \xephm_kashida_glyph \l_xephm_hskip_zero_tl \c_xephm_zwj_int } + { \c_xephm_zwj_int \xephm_kashida_glyph \l_xephm_skip_default_tl \c_xephm_zwj_int } + { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } } \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_y_charclass = { \bool_if:NTF \l_xephm_kashida_hm_fix_bool - { \c_xephm_zwj_int \xephm_kashida_glyph \l_xephm_hskip_default_tl \c_xephm_zwj_int } - { \c_xephm_zwj_int \xephm_kashida_glyph \l_xephm_hskip_zero_tl \c_xephm_zwj_int } + { \c_xephm_zwj_int \xephm_kashida_glyph \l_xephm_skip_default_tl \c_xephm_zwj_int } + { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } } \XeTeXinterchartoks \c_xephm_y_charclass \c_xephm_d_charclass = - { \c_xephm_zwj_int \xephm_kashida_glyph \l_xephm_hskip_zero_tl \c_xephm_zwj_int } + { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_d_charclass = - { \c_xephm_zwj_int \xephm_kashida_glyph \l_xephm_hskip_zero_tl \c_xephm_zwj_int } + { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_d_charclass = - { \c_xephm_zwj_int \xephm_kashida_glyph \l_xephm_hskip_zero_tl \c_xephm_zwj_int } + { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_l_charclass = - { \c_xephm_zwj_int \xephm_kashida_glyph \l_xephm_hskip_zero_tl \c_xephm_zwj_int } + { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_l_charclass = - { \c_xephm_zwj_int \xephm_kashida_glyph \l_xephm_hskip_zero_tl \c_xephm_zwj_int } + { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_r_charclass = - { \c_xephm_zwj_int \xephm_kashida_glyph \l_xephm_hskip_zero_tl \c_xephm_zwj_int } + { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_a_charclass = - { \c_xephm_zwj_int \xephm_kashida_glyph \l_xephm_hskip_zero_tl \c_xephm_zwj_int } + { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_r_charclass = - { \c_xephm_zwj_int \xephm_kashida_glyph \l_xephm_hskip_zero_tl \c_xephm_zwj_int } + { \c_xephm_zwj_int \xephm_kashida_glyph \c_xephm_skip_a_tl \c_xephm_zwj_int } \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_a_charclass = { } } @@ -219,31 +218,31 @@ \XeTeXinterchartoks \c_xephm_y_charclass \c_xephm_y_charclass = { \bool_if:NTF \l_xephm_kashida_hm_fix_bool - { \xephm_kashida_hrule \l_xephm_hskip_default_tl } - { \xephm_kashida_hrule \l_xephm_hskip_zero_tl } + { \xephm_kashida_hrule \l_xephm_skip_default_tl } + { \xephm_kashida_hrule \c_xephm_skip_a_tl } } \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_y_charclass = { \bool_if:NTF \l_xephm_kashida_hm_fix_bool - { \xephm_kashida_hrule \l_xephm_hskip_default_tl } - { \xephm_kashida_hrule \l_xephm_hskip_zero_tl } + { \xephm_kashida_hrule \l_xephm_skip_default_tl } + { \xephm_kashida_hrule \c_xephm_skip_a_tl } } \XeTeXinterchartoks \c_xephm_y_charclass \c_xephm_d_charclass = - { \xephm_kashida_hrule \l_xephm_hskip_zero_tl } + { \xephm_kashida_hrule \c_xephm_skip_a_tl } \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_d_charclass = - { \xephm_kashida_hrule \l_xephm_hskip_zero_tl } + { \xephm_kashida_hrule \c_xephm_skip_a_tl } \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_d_charclass = - { \xephm_kashida_hrule \l_xephm_hskip_zero_tl } + { \xephm_kashida_hrule \c_xephm_skip_a_tl } \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_l_charclass = - { \xephm_kashida_hrule \l_xephm_hskip_zero_tl } + { \xephm_kashida_hrule \c_xephm_skip_a_tl } \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_l_charclass = - { \xephm_kashida_hrule \l_xephm_hskip_zero_tl } + { \xephm_kashida_hrule \c_xephm_skip_a_tl } \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_r_charclass = - { \xephm_kashida_hrule \l_xephm_hskip_zero_tl } + { \xephm_kashida_hrule \c_xephm_skip_a_tl } \XeTeXinterchartoks \c_xephm_d_charclass \c_xephm_a_charclass = - { \xephm_kashida_hrule \l_xephm_hskip_zero_tl } + { \xephm_kashida_hrule \c_xephm_skip_a_tl } \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_r_charclass = - { \xephm_kashida_hrule \l_xephm_hskip_zero_tl } + { \xephm_kashida_hrule \c_xephm_skip_a_tl } \XeTeXinterchartoks \c_xephm_l_charclass \c_xephm_a_charclass = { } } @@ -255,14 +254,12 @@ \tex_let:D \KashidaOn \KashidaHMFixOn \tex_let:D \KashidaOff \KashidaHMFixOff -\tl_set:Nn \l_xephm_hskip_zero_tl { 0 em plus 0.5 em } - \bool_if:NTF \l_xephm_kashida_hm_fix_bool { - \tl_if_empty:NT \l_xephm_hskip_default_tl { \tl_set:Nn \l_xephm_hskip_default_tl { 0.14 em plus 0.5 em } } + \tl_if_empty:NT \l_xephm_skip_default_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.14 em plus 0.5 em } } } { - \tl_set:NV \l_xephm_hskip_default_tl \l_xephm_hskip_zero_tl + \tl_set:NV \l_xephm_skip_default_tl \c_xephm_skip_a_tl } \ExplSyntaxOff |