summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex/xepersian-hm/xepersian-hm.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/xepersian-hm/xepersian-hm.sty')
-rw-r--r--Master/texmf-dist/tex/xelatex/xepersian-hm/xepersian-hm.sty35
1 files changed, 28 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/xelatex/xepersian-hm/xepersian-hm.sty b/Master/texmf-dist/tex/xelatex/xepersian-hm/xepersian-hm.sty
index ba57d9bfd3f..cc493c22a31 100644
--- a/Master/texmf-dist/tex/xelatex/xepersian-hm/xepersian-hm.sty
+++ b/Master/texmf-dist/tex/xelatex/xepersian-hm/xepersian-hm.sty
@@ -31,7 +31,9 @@
\RequirePackage{zref-savepos}[2020-03-03]
\RequirePackage{xepersian}
\ExplSyntaxOn
-\ProvidesExplPackage {xepersian-hm} {2020-05-20} {0.5f} { Fixes~issues~in~xepersian~package }
+\ProvidesExplPackage {xepersian-hm} {2020-05-31} {1.0a} { Fixes~issues~in~xepersian~package }
+
+\box_new:N \l_xephm_ksh_box
\int_const:Nn \c_xephm_ksh_int {"0640} % kashida
\int_const:Nn \c_xephm_lrm_int {"200E} % left-right-mark
@@ -60,6 +62,9 @@
\tl_new:N \l_xephm_main_font_full_tl
\tl_new:N \l_xephm_main_font_name_tl
+\tl_new:N \l_xephm_font_full_tl
+\tl_new:N \l_xephm_font_name_tl
+
\tl_new:N \l_xephm_skip_default_tl
\tl_new:N \l_xephm_active_ligs_tl
@@ -79,7 +84,8 @@
\int_set:Nn \l_xephm_max_penalty_int { 10000 }
\tl_set:Nn \l_xephm_stretch_glyph_tl { glyph }
-\tl_set:Nn \l_xephm_stretch_hrule_tl { hrule }
+\tl_set:Nn \l_xephm_stretch_leaders_glyph_tl { leaders+glyph }
+\tl_set:Nn \l_xephm_stretch_leaders_hrule_tl { leaders+hrule }
\tl_set:Nn \l_xephm_fnt_kayhan_tl { kayhan }
\tl_set:Nn \l_xephm_fnt_kayhannavaar_tl { kayhannavaar }
@@ -146,7 +152,7 @@
\msg_new:nnn { xepersian-hm } { error-kashida-character-is-not-available-in-the-main-font }
{
- Sorry,~ kashida~ character~ is~ not~ available~ in~ the~ main~ font~!
+ Sorry,~ kashida~ character~ is~ not~ available~ in~ the~ main~ font~#1!
}
\msg_new:nnn { xepersian-hm } { error-value-not-available-for-kashida-option }
@@ -165,6 +171,16 @@
and~ is~ not~ regarded~ as~ stable.
}
+\msg_new:nnn { xepersian-hm } { hm-series-font-not-found }
+ {
+ Either~ the~ font~`#1'~ is~ not~ installed~ on~ your~ system~ or~ does~ not~
+ belong~ to~ HM~Series~fonts.~
+ Please~ note~ that~ the~ option~ `Kashida=leaders+glyph'~ is~ currently~ only~
+ supported~ by~ HM~Series~fonts.~
+ If~ you~ know~ of~ any~ other~ font~ that~ supports~ this~ option,~ please~
+ let~ me~ know~ to~ add~ it~ to~ the~ list~ of~ corresponding~ fonts.~
+ }
+
\keys_define:nn { xepersian-hm }
{
Kashida .code:n =
@@ -174,7 +190,8 @@
{
\l_xephm_stretch_glyph_tl
{
- \tl_set:Nn \l_xephm_gap_filler_tl { \l_xephm_stretch_glyph_tl }
+ \msg_warning:nnn { xepersian-hm } { warning-experimental-feature } { Kashida=glyph }
+ \tl_set:Nx \l_xephm_gap_filler_tl { \l_xephm_stretch_glyph_tl }
\AtBeginDocument
{
\tl_set:Nx \l_xephm_main_font_full_tl { \tex_fontname:D \tex_the:D \tex_font:D }
@@ -183,13 +200,17 @@
\int_set:Nn \l_xephm_kashida_slot_int { \xetex_charglyph:D \c_xephm_ksh_int }
\int_compare:nT { \l_xephm_kashida_slot_int = \c_zero_int }
{
- \msg_error:nn { xepersian-hm } { error-kashida-character-is-not-available-in-the-main-font }
+ \msg_error:nnx { xepersian-hm } { error-kashida-character-is-not-available-in-the-main-font } { \l_xephm_main_font_name_tl }
}
}
}
- \l_xephm_stretch_hrule_tl
+ \l_xephm_stretch_leaders_glyph_tl
+ {
+ \tl_set:Nx \l_xephm_gap_filler_tl { \l_xephm_stretch_leaders_glyph_tl }
+ }
+ \l_xephm_stretch_leaders_hrule_tl
{
- \tl_set:Nn \l_xephm_gap_filler_tl { \l_xephm_stretch_hrule_tl }
+ \tl_set:Nx \l_xephm_gap_filler_tl { \l_xephm_stretch_leaders_hrule_tl }
}
} { } { \tl_set:Nx \l_xephm_gap_filler_tl { #1 } }
\tl_if_empty:NT \l_xephm_gap_filler_tl { \msg_error:nn { xepersian-hm } { error-specify-value-for-kashida-option } }