diff options
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.sty | 197 |
1 files changed, 127 insertions, 70 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 2f16673d9df..846617033e8 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,7 @@ \RequirePackage{zref-savepos}[2020-03-03] \RequirePackage{xepersian} \ExplSyntaxOn -\ProvidesExplPackage {xepersian-hm} {2020-05-07} {0.5d} { Fixes~issues~in~xepersian~package } +\ProvidesExplPackage {xepersian-hm} {2020-05-12} {0.5e} { Fixes~issues~in~xepersian~package } \int_const:Nn \c_xephm_ksh_int {"0640} % kashida \int_const:Nn \c_xephm_lrm_int {"200E} % left-right-mark @@ -62,11 +62,14 @@ \tl_new:N \l_xephm_skip_default_tl +\tl_new:N \l_xephm_active_ligs_tl + \tl_new:N \l_xephm_gap_filler_tl \dim_new:N \l_xephm_diff_pos_dim \bool_set_false:N \l_xephm_kashida_hm_fix_bool +\bool_set_false:N \l_xephm_ligature_bool \bool_set_false:N \l_xephm_linebreakpenalty_bool \int_set:Nn \l_xephm_min_penalty_int { 0 } @@ -78,37 +81,68 @@ \tl_set:Nn \l_xephm_stretch_glyph_tl { glyph } \tl_set:Nn \l_xephm_stretch_hrule_tl { hrule } -\tl_set:Nn \l_xephm_kayhan_tl { kayhan } -\tl_set:Nn \l_xephm_khorramshahr_tl { khorramshahr } -\tl_set:Nn \l_xephm_kayhannavaar_tl { kayhannavaar } -\tl_set:Nn \l_xephm_kayhanpook_tl { kayhanpook } -\tl_set:Nn \l_xephm_kayhansayeh_tl { kayhansayeh } -\tl_set:Nn \l_xephm_khoramshahr_tl { khoramshahr } -\tl_set:Nn \l_xephm_khorramshahr_tl { khorramshahr } -\tl_set:Nn \l_xephm_niloofar_tl { niloofar } -\tl_set:Nn \l_xephm_paatch_tl { paatch } -\tl_set:Nn \l_xephm_riyaz_tl { riyaz } -\tl_set:Nn \l_xephm_roya_tl { roya } -\tl_set:Nn \l_xephm_shafigh_tl { shafigh } -\tl_set:Nn \l_xephm_shafighKurd_tl { shafighKurd } -\tl_set:Nn \l_xephm_shafighUzbek_tl { shafighUzbek } -\tl_set:Nn \l_xephm_shiraz_tl { shiraz } -\tl_set:Nn \l_xephm_sols_tl { sols } -\tl_set:Nn \l_xephm_tabriz_tl { tabriz } -\tl_set:Nn \l_xephm_titr_tl { titr } -\tl_set:Nn \l_xephm_titre_tl { titre } -\tl_set:Nn \l_xephm_traffic_tl { traffic } -\tl_set:Nn \l_xephm_vahid_tl { vahid } -\tl_set:Nn \l_xephm_vosta_tl { vosta } -\tl_set:Nn \l_xephm_yaghut_tl { yaghut } -\tl_set:Nn \l_xephm_yagut_tl { yagut } -\tl_set:Nn \l_xephm_yas_tl { yas } -\tl_set:Nn \l_xephm_yekan_tl { yekan } -\tl_set:Nn \l_xephm_yermook_tl { yermook } -\tl_set:Nn \l_xephm_zar_tl { zar } -\tl_set:Nn \l_xephm_ziba_tl { ziba } -\tl_set:Nn \l_xephm_default_tl { default } -\tl_set:Nn \l_xephm_noskip_tl { noskip } +\tl_set:Nn \l_xephm_fnt_kayhan_tl { kayhan } +\tl_set:Nn \l_xephm_fnt_kayhannavaar_tl { kayhannavaar } +\tl_set:Nn \l_xephm_fnt_kayhanpook_tl { kayhanpook } +\tl_set:Nn \l_xephm_fnt_kayhansayeh_tl { kayhansayeh } +\tl_set:Nn \l_xephm_fnt_khoramshahr_tl { khoramshahr } +\tl_set:Nn \l_xephm_fnt_khorramshahr_tl { khorramshahr } +\tl_set:Nn \l_xephm_fnt_niloofar_tl { niloofar } +\tl_set:Nn \l_xephm_fnt_paatch_tl { paatch } +\tl_set:Nn \l_xephm_fnt_riyaz_tl { riyaz } +\tl_set:Nn \l_xephm_fnt_roya_tl { roya } +\tl_set:Nn \l_xephm_fnt_shafigh_tl { shafigh } +\tl_set:Nn \l_xephm_fnt_shafighKurd_tl { shafighKurd } +\tl_set:Nn \l_xephm_fnt_shafighUzbek_tl { shafighUzbek } +\tl_set:Nn \l_xephm_fnt_shiraz_tl { shiraz } +\tl_set:Nn \l_xephm_fnt_sols_tl { sols } +\tl_set:Nn \l_xephm_fnt_tabriz_tl { tabriz } +\tl_set:Nn \l_xephm_fnt_titr_tl { titr } +\tl_set:Nn \l_xephm_fnt_titre_tl { titre } +\tl_set:Nn \l_xephm_fnt_traffic_tl { traffic } +\tl_set:Nn \l_xephm_fnt_vahid_tl { vahid } +\tl_set:Nn \l_xephm_fnt_vosta_tl { vosta } +\tl_set:Nn \l_xephm_fnt_yaghut_tl { yaghut } +\tl_set:Nn \l_xephm_fnt_yagut_tl { yagut } +\tl_set:Nn \l_xephm_fnt_yas_tl { yas } +\tl_set:Nn \l_xephm_fnt_yekan_tl { yekan } +\tl_set:Nn \l_xephm_fnt_yermook_tl { yermook } +\tl_set:Nn \l_xephm_fnt_zar_tl { zar } +\tl_set:Nn \l_xephm_fnt_ziba_tl { ziba } +\tl_set:Nn \l_xephm_fnt_default_tl { default } +\tl_set:Nn \l_xephm_fnt_noskip_tl { noskip } + +\tl_set:Nn \l_xephm_lig_aalt_tl { aalt } % Access All Alternatives +\tl_set:Nn \l_xephm_lig_ccmp_tl { ccmp } % Glyph Composition/Decomposition +\tl_set:Nn \l_xephm_lig_dlig_tl { dlig } % Discretionary Ligatures +\tl_set:Nn \l_xephm_lig_fina_tl { fina } % Final (Terminal) Forms +\tl_set:Nn \l_xephm_lig_init_tl { init } % Initial Forms +\tl_set:Nn \l_xephm_lig_locl_tl { locl } % Localized Forms +\tl_set:Nn \l_xephm_lig_medi_tl { medi } % Medial Forms +\tl_set:Nn \l_xephm_lig_rlig_tl { rlig } % Required Ligatures +\tl_set:Nn \l_xephm_lig_default_tl { default } + +\clist_set:Nn \l_xephm_lig_aalt_clist { { } } % Access All Alternatives +\clist_set:Nn \l_xephm_lig_ccmp_clist { { } } % Glyph Composition/Decomposition +\clist_set:Nn \l_xephm_lig_dlig_clist { FDF2 = الله , FDF3 = اکبر , FDFB = جلجلاله } % Discretionary Ligatures +\clist_set:Nn \l_xephm_lig_fina_clist { { } } % Final (Terminal) Forms +\clist_set:Nn \l_xephm_lig_init_clist { { } } % Initial Forms +\clist_set:Nn \l_xephm_lig_locl_clist { { } } % Localized Forms +\clist_set:Nn \l_xephm_lig_medi_clist { { } } % Medial Forms +\clist_set:Nn \l_xephm_lig_rlig_clist { { } } % Required Ligatures +\clist_set:Nn \l_xephm_lig_default_clist { { } } + +\clist_set:Nn \l_xephm_lig_names_clist + { + \l_xephm_lig_aalt_tl , { \l_xephm_lig_aalt_clist } , + \l_xephm_lig_ccmp_tl , { \l_xephm_lig_ccmp_clist } , + \l_xephm_lig_dlig_tl , { \l_xephm_lig_dlig_clist } , + \l_xephm_lig_fina_tl , { \l_xephm_lig_fina_clist } , + \l_xephm_lig_init_tl , { \l_xephm_lig_init_clist } , + \l_xephm_lig_locl_tl , { \l_xephm_lig_locl_clist } , + \l_xephm_lig_medi_tl , { \l_xephm_lig_medi_clist } , + \l_xephm_lig_rlig_tl , { \l_xephm_lig_rlig_clist } , + } \msg_new:nnn { xepersian-hm } { kashida-character-is-not-available-in-the-main-font } { @@ -154,7 +188,6 @@ } { } { \tl_set:Nx \l_xephm_gap_filler_tl { #1 } } \tl_if_empty:NT \l_xephm_gap_filler_tl { \msg_error:nn { xepersian-hm } { specify-value-for-kashida-option } } \bool_set_true:N \l_xephm_kashida_hm_fix_bool - \tex_input:D { kashida-xepersian-hm.def } } , linebreakpenalty .code:n = @@ -162,58 +195,82 @@ \int_set:Nn \l_tmpa_int { #1 } \int_case:nnTF \l_tmpa_int { - \l_xephm_min_penalty_int { \int_set:Nn \l_xephm_line_break_penalty_int { \l_xephm_min_penalty_int } } - \l_xephm_low_penalty_int { \int_set:Nn \l_xephm_line_break_penalty_int { \l_xephm_low_penalty_int } } - \l_xephm_med_penalty_int { \int_set:Nn \l_xephm_line_break_penalty_int { \l_xephm_med_penalty_int } } + \l_xephm_min_penalty_int { \int_set:Nn \l_xephm_line_break_penalty_int { \l_xephm_min_penalty_int } } + \l_xephm_low_penalty_int { \int_set:Nn \l_xephm_line_break_penalty_int { \l_xephm_low_penalty_int } } + \l_xephm_med_penalty_int { \int_set:Nn \l_xephm_line_break_penalty_int { \l_xephm_med_penalty_int } } \l_xephm_high_penalty_int { \int_set:Nn \l_xephm_line_break_penalty_int { \l_xephm_high_penalty_int } } - \l_xephm_max_penalty_int { \int_set:Nn \l_xephm_line_break_penalty_int { \l_xephm_max_penalty_int } } + \l_xephm_max_penalty_int { \int_set:Nn \l_xephm_line_break_penalty_int { \l_xephm_max_penalty_int } } } { } { \int_set:Nn \l_xephm_line_break_penalty_int { #1 } } \bool_set_true:N \l_xephm_linebreakpenalty_bool } , kashidastretch .code:n = { - \tl_set:Nn \l_tmpb_tl { #1 } - \tl_case:NnTF \l_tmpb_tl + \tl_set:Nn \l_tmpa_tl { #1 } + \tl_case:NnTF \l_tmpa_tl { - \l_xephm_kayhan_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.14 em plus 0.5 em } } - \l_xephm_khorramshahr_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.131 em plus 0.5 em } } - \l_xephm_kayhannavaar_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.129 em plus 0.5 em } } - \l_xephm_kayhanpook_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.133 em plus 0.5 em } } - \l_xephm_kayhansayeh_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.135 em plus 0.5 em } } - \l_xephm_khoramshahr_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.128 em plus 0.5 em } } - \l_xephm_khorramshahr_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.13 em plus 0.5 em } } - \l_xephm_niloofar_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.132 em plus 0.5 em } } - \l_xephm_paatch_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.127 em plus 0.5 em } } - \l_xephm_riyaz_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.125 em plus 0.5 em } } - \l_xephm_roya_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.142 em plus 0.5 em } } - \l_xephm_shafigh_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.143 em plus 0.5 em } } - \l_xephm_shafighKurd_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.126 em plus 0.5 em } } - \l_xephm_shafighUzbek_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.123 em plus 0.5 em } } - \l_xephm_shiraz_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.122 em plus 0.5 em } } - \l_xephm_sols_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.124 em plus 0.5 em } } - \l_xephm_tabriz_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.119 em plus 0.5 em } } - \l_xephm_titr_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.12 em plus 0.5 em } } - \l_xephm_titre_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.121 em plus 0.5 em } } - \l_xephm_traffic_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.124 em plus 0.5 em } } - \l_xephm_vahid_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.134 em plus 0.5 em } } - \l_xephm_vosta_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.136 em plus 0.5 em } } - \l_xephm_yaghut_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.138 em plus 0.5 em } } - \l_xephm_yagut_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.137 em plus 0.5 em } } - \l_xephm_yas_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.126 em plus 0.5 em } } - \l_xephm_yekan_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.141 em plus 0.5 em } } - \l_xephm_yermook_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.139 em plus 0.5 em } } - \l_xephm_zar_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.116 em plus 0.5 em } } - \l_xephm_ziba_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.119 em plus 0.5 em } } - \l_xephm_default_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.14 em plus 0.5 em } } - \l_xephm_noskip_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0 em plus 0.5 em } } + \l_xephm_fnt_kayhan_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.14 em plus 0.5 em } } + \l_xephm_fnt_kayhannavaar_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.129 em plus 0.5 em } } + \l_xephm_fnt_kayhanpook_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.133 em plus 0.5 em } } + \l_xephm_fnt_kayhansayeh_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.135 em plus 0.5 em } } + \l_xephm_fnt_khoramshahr_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.128 em plus 0.5 em } } + \l_xephm_fnt_khorramshahr_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.13 em plus 0.5 em } } + \l_xephm_fnt_niloofar_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.132 em plus 0.5 em } } + \l_xephm_fnt_paatch_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.127 em plus 0.5 em } } + \l_xephm_fnt_riyaz_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.125 em plus 0.5 em } } + \l_xephm_fnt_roya_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.142 em plus 0.5 em } } + \l_xephm_fnt_shafigh_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.143 em plus 0.5 em } } + \l_xephm_fnt_shafighKurd_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.126 em plus 0.5 em } } + \l_xephm_fnt_shafighUzbek_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.123 em plus 0.5 em } } + \l_xephm_fnt_shiraz_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.122 em plus 0.5 em } } + \l_xephm_fnt_sols_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.124 em plus 0.5 em } } + \l_xephm_fnt_tabriz_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.119 em plus 0.5 em } } + \l_xephm_fnt_titr_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.12 em plus 0.5 em } } + \l_xephm_fnt_titre_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.121 em plus 0.5 em } } + \l_xephm_fnt_traffic_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.124 em plus 0.5 em } } + \l_xephm_fnt_vahid_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.134 em plus 0.5 em } } + \l_xephm_fnt_vosta_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.136 em plus 0.5 em } } + \l_xephm_fnt_yaghut_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.138 em plus 0.5 em } } + \l_xephm_fnt_yagut_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.137 em plus 0.5 em } } + \l_xephm_fnt_yas_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.126 em plus 0.5 em } } + \l_xephm_fnt_yekan_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.141 em plus 0.5 em } } + \l_xephm_fnt_yermook_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.139 em plus 0.5 em } } + \l_xephm_fnt_zar_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.116 em plus 0.5 em } } + \l_xephm_fnt_ziba_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.119 em plus 0.5 em } } + \l_xephm_fnt_default_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.14 em plus 0.5 em } } + \l_xephm_fnt_noskip_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0 em plus 0.5 em } } } { } { \tl_set:Nn \l_xephm_skip_default_tl { #1 } } } , kashidastretch .default:n = \tl_set:Nn \l_xephm_skip_default_tl { 0 em plus 0.5 em } , + + ligatures .code:n = + { + \tl_set:Nn \l_tmpa_tl { #1 } + \tl_case:NnTF \l_tmpa_tl + { + \l_xephm_lig_aalt_tl { \tl_set:Nx \l_xephm_active_ligs_tl { \l_xephm_lig_aalt_tl } } + \l_xephm_lig_ccmp_tl { \tl_set:Nx \l_xephm_active_ligs_tl { \l_xephm_lig_ccmp_tl } } + \l_xephm_lig_dlig_tl { \tl_set:Nx \l_xephm_active_ligs_tl { \l_xephm_lig_dlig_tl } } + \l_xephm_lig_fina_tl { \tl_set:Nx \l_xephm_active_ligs_tl { \l_xephm_lig_fina_tl } } + \l_xephm_lig_init_tl { \tl_set:Nx \l_xephm_active_ligs_tl { \l_xephm_lig_init_tl } } + \l_xephm_lig_locl_tl { \tl_set:Nx \l_xephm_active_ligs_tl { \l_xephm_lig_locl_tl } } + \l_xephm_lig_medi_tl { \tl_set:Nx \l_xephm_active_ligs_tl { \l_xephm_lig_medi_tl } } + \l_xephm_lig_rlig_tl { \tl_set:Nx \l_xephm_active_ligs_tl { \l_xephm_lig_rlig_tl } } + \l_xephm_lig_default_tl { \tl_set:Nx \l_xephm_active_ligs_tl { \l_xephm_lig_default_tl } } + } { } { \tl_set:Nn \l_xephm_active_ligs_tl { #1 } } + \bool_set_true:N \l_xephm_ligature_bool + } , + ligatures .default:n = \tl_set:Nn \l_xephm_active_ligs_tl { \l_xephm_lig_default_tl } , + } \ProcessKeysOptions { xepersian-hm } +\bool_if:NT \l_xephm_kashida_hm_fix_bool + { + \tex_input:D { kashida-xepersian-hm.def } + } + \ExplSyntaxOff \endinput %% |