diff options
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/xepersian/xepersian-mathsdigitspec.sty')
-rw-r--r-- | Master/texmf-dist/tex/xelatex/xepersian/xepersian-mathsdigitspec.sty | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/xelatex/xepersian/xepersian-mathsdigitspec.sty b/Master/texmf-dist/tex/xelatex/xepersian/xepersian-mathsdigitspec.sty index 0fa1fbe4367..91882e8e3b1 100644 --- a/Master/texmf-dist/tex/xelatex/xepersian/xepersian-mathsdigitspec.sty +++ b/Master/texmf-dist/tex/xelatex/xepersian/xepersian-mathsdigitspec.sty @@ -17,7 +17,7 @@ %% by Vafa Khalighi. %% %% -%% \CheckSum{10947} +%% \CheckSum{10996} %% \CharacterTable %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z @@ -36,7 +36,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{xepersian-mathsdigitspec} - [2018/01/01 v1.1.5 Unicode Persian maths digits in XeLaTeX] + [2018/12/14 v1.1.6 Unicode Persian maths digits in XeLaTeX] \def\new@mathgroup{\alloc@8\mathgroup\chardef\@cclvi} \let\newfam\new@mathgroup \def\select@group#1#2#3#4{% @@ -163,6 +163,44 @@ } } +\cs_new:Npn \__xepersian_mathsdigitspec_error:nxx { \msg_error:nnxx {xepersian-mathsdigitspec} } +\cs_new:Nn \__xepersian_mathsdigitspec_msg_new:nnnn + { \msg_new:nnxx {#1} {#2} { \tl_trim_spaces:n {#3} } { \tl_trim_spaces:n {#4} } } +\char_set_catcode_space:n {32} +\__xepersian_mathsdigitspec_msg_new:nnnn {xepersian-mathsdigitspec} {char-not-exist} + { + The font "#1" does not contain U+#2. + } + { + Select another font and rerun xelatex. + } +\char_set_catcode_ignore:n {32} + +\prg_new_conditional:Nnn \__xepersian_mathsdigitspec_primitive_font_char_if_exist:n {p,TF,T,F} + { + \etex_iffontchar:D \l_fontspec_font `#1 \scan_stop: + \prg_return_true: + \else: + \prg_return_false: + \fi: + } + +\cs_new:Nn \__xepersian_mathsdigitspec_char_not_exist_error:n + { + \__xepersian_mathsdigitspec_primitive_font_char_if_exist:nF ۰ { \__xepersian_mathsdigitspec_error:nxx {char-not-exist} { #1 } { 06F0 } } + \__xepersian_mathsdigitspec_primitive_font_char_if_exist:nF ۱ { \__xepersian_mathsdigitspec_error:nxx {char-not-exist} { #1 } { 06F1 } } + \__xepersian_mathsdigitspec_primitive_font_char_if_exist:nF ۲ { \__xepersian_mathsdigitspec_error:nxx {char-not-exist} { #1 } { 06F2 } } + \__xepersian_mathsdigitspec_primitive_font_char_if_exist:nF ۳ { \__xepersian_mathsdigitspec_error:nxx {char-not-exist} { #1 } { 06F3 } } + \__xepersian_mathsdigitspec_primitive_font_char_if_exist:nF ۴ { \__xepersian_mathsdigitspec_error:nxx {char-not-exist} { #1 } { 06F4 } } + \__xepersian_mathsdigitspec_primitive_font_char_if_exist:nF ۵ { \__xepersian_mathsdigitspec_error:nxx {char-not-exist} { #1 } { 06F5 } } + \__xepersian_mathsdigitspec_primitive_font_char_if_exist:nF ۶ { \__xepersian_mathsdigitspec_error:nxx {char-not-exist} { #1 } { 06F6 } } + \__xepersian_mathsdigitspec_primitive_font_char_if_exist:nF ۷ { \__xepersian_mathsdigitspec_error:nxx {char-not-exist} { #1 } { 06F7 } } + \__xepersian_mathsdigitspec_primitive_font_char_if_exist:nF ۸ { \__xepersian_mathsdigitspec_error:nxx {char-not-exist} { #1 } { 06F8 } } + \__xepersian_mathsdigitspec_primitive_font_char_if_exist:nF ۹ { \__xepersian_mathsdigitspec_error:nxx {char-not-exist} { #1 } { 06F9 } } + \__xepersian_mathsdigitspec_primitive_font_char_if_exist:nF ٫ { \__xepersian_mathsdigitspec_error:nxx {char-not-exist} { #1 } { 066B } } + \__xepersian_mathsdigitspec_primitive_font_char_if_exist:nF ٪ { \__xepersian_mathsdigitspec_error:nxx {char-not-exist} { #1 } { 066A } } + } + \DeclareDocumentCommand \setmathdigitfont { O{} m O{} } { \__xepersian_main_setmathdigitfont:nn {#1,#3} {#2} @@ -177,6 +215,7 @@ \DeclareSymbolFont{new@mathbf@font@digits}{\g_fontspec_encoding_tl}{\g__xepersian_mathdigitsfamily_tl}{bx}{n} \DeclareSymbolFont{new@mathit@font@digits}{\g_fontspec_encoding_tl}{\g__xepersian_mathdigitsfamily_tl}{m}{it} \DeclareSymbolFont{new@mathrm@font@digits}{\g_fontspec_encoding_tl}{\g__xepersian_mathdigitsfamily_tl}{m}{n} + \__xepersian_mathsdigitspec_char_not_exist_error:n { #2 } \def\persianmathsdigits{% \SetMathCode{`0}{\mathalpha}{OPERATORS}{`0} \SetMathCode{`1}{\mathalpha}{OPERATORS}{`1} @@ -206,6 +245,7 @@ \fontspec_set_family:Nnn \g__xepersian_mathsfdigitfamily_tl {Ligatures=PersianTeX,#1} {#2} \__xepersian_setmathsfdigitfont_hook:nn {#1} {#2} \DeclareSymbolFont{new@mathsf@font@digits}{\g_fontspec_encoding_tl}{\g__xepersian_mathsfdigitfamily_tl}{m}{n} + \__xepersian_mathsdigitspec_char_not_exist_error:n { #2 } \def\persianmathsfdigits{\tl_set_eq:NN \mathsf \new@mathsf} } @@ -220,6 +260,7 @@ \fontspec_set_family:Nnn \g__xepersian_mathttdigitfamily_tl {Ligatures=PersianTeX,#1} {#2} \__xepersian_setmathttdigitfont_hook:nn {#1} {#2} \DeclareSymbolFont{new@mathtt@font@digits}{\g_fontspec_encoding_tl}{\g__xepersian_mathttdigitfamily_tl}{m}{n} + \__xepersian_mathsdigitspec_char_not_exist_error:n { #2 } \def\persianmathttdigits{\tl_set_eq:NN \mathtt \new@mathtt} } |