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.sty108
1 files changed, 70 insertions, 38 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 1a3efc09707..6c4c5d654c0 100644
--- a/Master/texmf-dist/tex/xelatex/xepersian-hm/xepersian-hm.sty
+++ b/Master/texmf-dist/tex/xelatex/xepersian-hm/xepersian-hm.sty
@@ -4,7 +4,7 @@
%%
%% The original source files were:
%%
-%% xepersian-hm.dtx (with options: `package')
+%% xepersian-hm.dtx (with options: `xepersian-hm')
%%
%% Copyright (C) 2020 Hossein Movahhedian
%%
@@ -12,7 +12,6 @@
%% 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
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}[2020-03-06]
\@ifpackagelater{expl3}{2020-03-06}
@@ -32,7 +31,18 @@
\RequirePackage{zref-savepos}[2020-03-03]
\RequirePackage{xepersian}
\ExplSyntaxOn
-\ProvidesExplPackage {xepersian-hm} {2020-04-20} {0.5a} { Fixes~issues~in~xepersian~package }
+\ProvidesExplPackage {xepersian-hm} {2020-04-26} {0.5b} { Fixes~issues~in~xepersian~package }
+
+\tl_new:N \l_xephm_main_font_full_tl
+\tl_new:N \l_xephm_main_font_name_tl
+\int_const:Nn \c_xephm_ksh_int {"0640} % kashida
+\int_new:N \l_xephm_kashida_slot_int
+
+\tl_new:N \l_xephm_skip_default_tl
+
+\tl_const:Nn \c_xephm_skip_a_tl { 0 em plus 0.5 em }
+
+\tl_const:Nn \c_xephm_skip_b_tl { 0.14 em plus 5.5 em }
\bool_set_false:N \l_xephm_kashida_hm_fix_bool
@@ -88,6 +98,11 @@
\tl_set:Nn \l_xephm_default_tl { default }
\tl_set:Nn \l_xephm_noskip_tl { noskip }
+\msg_new:nnx { xepersian-hm } { kashida-character-is-not-available-in-the-main-font }
+ {
+ Sorry,~ kashida~ character~ is~ not~ available~ in~ the~ main~ font~!
+ }
+
\keys_define:nn { xepersian-hm }
{
Kashida .code:n =
@@ -95,8 +110,25 @@
\tl_set:Nn \l_tmpa_tl { #1 }
\tl_case:NnTF \l_tmpa_tl
{
- \l_xephm_stretch_glyph_tl { \tl_set:Nn \l_xephm_gap_filler_tl { \l_xephm_stretch_glyph_tl } }
- \l_xephm_stretch_hrule_tl { \tl_set:Nn \l_xephm_gap_filler_tl { \l_xephm_stretch_hrule_tl } }
+ \l_xephm_stretch_glyph_tl
+ {
+ \tl_set:Nn \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 }
+ \tl_set:Nx \l_xephm_main_font_name_tl { \l_xephm_main_font_full_tl }
+ \regex_replace_once:nnN { ^"([^/]+)/.* } { \1 } \l_xephm_main_font_name_tl
+ \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 } { kashida-character-is-not-available-in-the-main-font }
+ }
+ }
+ }
+ \l_xephm_stretch_hrule_tl
+ {
+ \tl_set:Nn \l_xephm_gap_filler_tl { \l_xephm_stretch_hrule_tl }
+ }
} { } { \tl_set:Nn \l_xephm_filler_default_tl { #1 } }
\bool_set_true:N \l_xephm_kashida_hm_fix_bool
\tex_input:D { kashida-xepersian-hm.def }
@@ -121,40 +153,40 @@
\tl_set:Nn \l_tmpb_tl { #1 }
\tl_case:NnTF \l_tmpb_tl
{
- \l_xephm_kayhan_tl { \tl_set:Nn \l_xephm_hskip_default_tl { 0.14 em plus 0.5 em } }
- \l_xephm_khorramshahr_tl { \tl_set:Nn \l_xephm_hskip_default_tl { 0.131 em plus 0.5 em } }
- \l_xephm_kayhannavaar_tl { \tl_set:Nn \l_xephm_hskip_default_tl { 0.129 em plus 0.5 em } }
- \l_xephm_kayhanpook_tl { \tl_set:Nn \l_xephm_hskip_default_tl { 0.133 em plus 0.5 em } }
- \l_xephm_kayhansayeh_tl { \tl_set:Nn \l_xephm_hskip_default_tl { 0.135 em plus 0.5 em } }
- \l_xephm_khoramshahr_tl { \tl_set:Nn \l_xephm_hskip_default_tl { 0.128 em plus 0.5 em } }
- \l_xephm_khorramshahr_tl { \tl_set:Nn \l_xephm_hskip_default_tl { 0.13 em plus 0.5 em } }
- \l_xephm_niloofar_tl { \tl_set:Nn \l_xephm_hskip_default_tl { 0.132 em plus 0.5 em } }
- \l_xephm_paatch_tl { \tl_set:Nn \l_xephm_hskip_default_tl { 0.127 em plus 0.5 em } }
- \l_xephm_riyaz_tl { \tl_set:Nn \l_xephm_hskip_default_tl { 0.125 em plus 0.5 em } }
- \l_xephm_roya_tl { \tl_set:Nn \l_xephm_hskip_default_tl { 0.142 em plus 0.5 em } }
- \l_xephm_shafigh_tl { \tl_set:Nn \l_xephm_hskip_default_tl { 0.143 em plus 0.5 em } }
- \l_xephm_shafighKurd_tl { \tl_set:Nn \l_xephm_hskip_default_tl { 0.126 em plus 0.5 em } }
- \l_xephm_shafighUzbek_tl { \tl_set:Nn \l_xephm_hskip_default_tl { 0.123 em plus 0.5 em } }
- \l_xephm_shiraz_tl { \tl_set:Nn \l_xephm_hskip_default_tl { 0.122 em plus 0.5 em } }
- \l_xephm_sols_tl { \tl_set:Nn \l_xephm_hskip_default_tl { 0.124 em plus 0.5 em } }
- \l_xephm_tabriz_tl { \tl_set:Nn \l_xephm_hskip_default_tl { 0.119 em plus 0.5 em } }
- \l_xephm_titr_tl { \tl_set:Nn \l_xephm_hskip_default_tl { 0.12 em plus 0.5 em } }
- \l_xephm_titre_tl { \tl_set:Nn \l_xephm_hskip_default_tl { 0.121 em plus 0.5 em } }
- \l_xephm_traffic_tl { \tl_set:Nn \l_xephm_hskip_default_tl { 0.124 em plus 0.5 em } }
- \l_xephm_vahid_tl { \tl_set:Nn \l_xephm_hskip_default_tl { 0.134 em plus 0.5 em } }
- \l_xephm_vosta_tl { \tl_set:Nn \l_xephm_hskip_default_tl { 0.136 em plus 0.5 em } }
- \l_xephm_yaghut_tl { \tl_set:Nn \l_xephm_hskip_default_tl { 0.138 em plus 0.5 em } }
- \l_xephm_yagut_tl { \tl_set:Nn \l_xephm_hskip_default_tl { 0.137 em plus 0.5 em } }
- \l_xephm_yas_tl { \tl_set:Nn \l_xephm_hskip_default_tl { 0.126 em plus 0.5 em } }
- \l_xephm_yekan_tl { \tl_set:Nn \l_xephm_hskip_default_tl { 0.141 em plus 0.5 em } }
- \l_xephm_yermook_tl { \tl_set:Nn \l_xephm_hskip_default_tl { 0.139 em plus 0.5 em } }
- \l_xephm_zar_tl { \tl_set:Nn \l_xephm_hskip_default_tl { 0.116 em plus 0.5 em } }
- \l_xephm_ziba_tl { \tl_set:Nn \l_xephm_hskip_default_tl { 0.119 em plus 0.5 em } }
- \l_xephm_default_tl { \tl_set:Nn \l_xephm_hskip_default_tl { 0.14 em plus 0.5 em } }
- \l_xephm_noskip_tl { \tl_set:Nn \l_xephm_hskip_default_tl { 0 em plus 0.5 em } }
- } { } { \tl_set:Nn \l_xephm_hskip_default_tl { #1 } }
+ \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 } }
+ } { } { \tl_set:Nn \l_xephm_skip_default_tl { #1 } }
} ,
- kashidastretch .default:n = \tl_set:Nn \l_xephm_hskip_default_tl { 0 em plus 0.5 em } ,
+ kashidastretch .default:n = \tl_set:Nn \l_xephm_skip_default_tl { 0 em plus 0.5 em } ,
}
\ProcessKeysOptions { xepersian-hm }