I am trying to modify the current version of xepersian package
to suit my needs.
The following code copied from
xepersian-mathsdigitspec.sty
is supposed to check if some characters do exist in the font to be loaded.
My question is about the function \__xepersian_mathsdigitspec_char_not_exist_error
.
Is there any way to replace those repeating lines of code in the argument of the function with a (while, until, ...) LOOP
which iterates over a list of characters [06F0, ..., 066B]
?
\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 } }
}
fonttable
, as in\documentclass{article} \usepackage{fullpage} \usepackage{fonttable} \begin{document} \fonttable{cmti10} \fonttable{cmsy10} \end{document}
– Steven B. Segletes Dec 18 '18 at 11:52