Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better support for Arabic math #633

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions testfiles/alph-arabic-literal.luatex.tlg
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
This is a generated file for the l3build validation system.
Don't change this file in any respect.
ARABIC
Completed box being shipped out [2]
\hbox(0.0+0.0)x0.0, direction TLT
.\mathon
.\TU/XITSMath-Regular.otf(1)/m/n/10 𞸀
.\TU/XITSMath-Regular.otf(1)/m/n/10 𞸁
.\mathoff
ARABIC INITIAL
Completed box being shipped out [2]
\hbox(0.0+0.0)x0.0, direction TLT
.\mathon
.\TU/XITSMath-Regular.otf(1)/m/n/10 𞸢
.\TU/XITSMath-Regular.otf(1)/m/n/10 𞸤
.\mathoff
ARABIC TAILED
Completed box being shipped out [2]
\hbox(0.0+0.0)x0.0, direction TLT
.\mathon
.\TU/XITSMath-Regular.otf(1)/m/n/10 𞹂
.\TU/XITSMath-Regular.otf(1)/m/n/10 𞹎
.\mathoff
ARABIC LOOPED
Completed box being shipped out [2]
\hbox(0.0+0.0)x0.0, direction TLT
.\mathon
.\TU/XITSMath-Regular.otf(1)/m/n/10 𞺀
.\TU/XITSMath-Regular.otf(1)/m/n/10 𞺂
.\mathoff
ARABIC STRETCHED
Completed box being shipped out [2]
\hbox(0.0+0.0)x0.0, direction TLT
.\mathon
.\TU/XITSMath-Regular.otf(1)/m/n/10 𞹡
.\TU/XITSMath-Regular.otf(1)/m/n/10 𞹢
.\mathoff
***************
Compilation 1 of test file completed with exit status 0
21 changes: 21 additions & 0 deletions testfiles/alph-arabic-literal.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
\input{umtest-preamble}
\usepackage{unicode-math}
\setmathfont{XITSMath-Regular.otf}
\begin{document}

\MSG{ARABIC}
\SHIPOUT{$𞸀𞸁$}

\MSG{ARABIC INITIAL}
\SHIPOUT{$𞸢𞸤$}

\MSG{ARABIC TAILED}
\SHIPOUT{$𞹂𞹎$}

\MSG{ARABIC LOOPED}
\SHIPOUT{$𞺀𞺂$}

\MSG{ARABIC STRETCHED}
\SHIPOUT{$𞹡𞹢$}

\end{document}
39 changes: 39 additions & 0 deletions testfiles/alph-arabic-literal.tlg
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
This is a generated file for the l3build validation system.
Don't change this file in any respect.
ARABIC
Completed box being shipped out [2]
\hbox(0.0+0.0)x0.0
.\mathon
.\TU/XITSMath-Regular.otf(1)/m/n/10 glyph#3420
.\TU/XITSMath-Regular.otf(1)/m/n/10 glyph#3421
.\mathoff
ARABIC INITIAL
Completed box being shipped out [2]
\hbox(0.0+0.0)x0.0
.\mathon
.\TU/XITSMath-Regular.otf(1)/m/n/10 glyph#3452
.\TU/XITSMath-Regular.otf(1)/m/n/10 glyph#3453
.\mathoff
ARABIC TAILED
Completed box being shipped out [2]
\hbox(0.0+0.0)x0.0
.\mathon
.\TU/XITSMath-Regular.otf(1)/m/n/10 glyph#3471
.\TU/XITSMath-Regular.otf(1)/m/n/10 glyph#3476
.\mathoff
ARABIC LOOPED
Completed box being shipped out [2]
\hbox(0.0+0.0)x0.0
.\mathon
.\TU/XITSMath-Regular.otf(1)/m/n/10 glyph#3509
.\TU/XITSMath-Regular.otf(1)/m/n/10 glyph#3511
.\mathoff
ARABIC STRETCHED
Completed box being shipped out [2]
\hbox(0.0+0.0)x0.0
.\mathon
.\TU/XITSMath-Regular.otf(1)/m/n/10 glyph#3486
.\TU/XITSMath-Regular.otf(1)/m/n/10 glyph#3487
.\mathoff
***************
Compilation 1 of test file completed with exit status 0
13 changes: 13 additions & 0 deletions testfiles/arabic-comma.luatex.tlg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
This is a generated file for the l3build validation system.
Don't change this file in any respect.
ARABIC COMMA
Completed box being shipped out [2]
\hbox(0.0+0.0)x0.0, direction TLT
.\mathon
.\TU/XITSMath-Regular.otf(1)/m/n/10 𝑥
.\TU/XITSMath-Regular.otf(1)/m/n/10 ،
.\glue(\thinmuskip) 1.66663
.\TU/XITSMath-Regular.otf(1)/m/n/10 𝑦
.\mathoff
***************
Compilation 1 of test file completed with exit status 0
9 changes: 9 additions & 0 deletions testfiles/arabic-comma.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
\input{umtest-preamble}
\usepackage{unicode-math}
\setmathfont{XITSMath-Regular.otf}
\begin{document}

\MSG{ARABIC COMMA}
\SHIPOUT{$x،y$}

\end{document}
13 changes: 13 additions & 0 deletions testfiles/arabic-comma.tlg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
This is a generated file for the l3build validation system.
Don't change this file in any respect.
ARABIC COMMA
Completed box being shipped out [2]
\hbox(0.0+0.0)x0.0
.\mathon
.\TU/XITSMath-Regular.otf(1)/m/n/10 glyph#2524
.\TU/XITSMath-Regular.otf(1)/m/n/10 glyph#819
.\glue(\thinmuskip) 1.66681
.\TU/XITSMath-Regular.otf(1)/m/n/10 glyph#2525
.\mathoff
***************
Compilation 1 of test file completed with exit status 0
18 changes: 18 additions & 0 deletions um-code-alphabets.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@
\@@_set_mathalphabet_greek:nnn {literal} {it} {it}
}

\@@_new_alphabet_config:nnn {up} {arabic}
{
\bool_if:NTF \g_@@_literal_bool
{ \@@_set_normal_arabic:nn {up}{#1} }
{ \@@_set_normal_arabic:nn {up,it}{#1} }
\@@_set_mathalphabet_arabic:nnn {up} {up,it}{#1}
\@@_set_mathalphabet_arabic:nnn {literal} {up} {up}
\@@_set_mathalphabet_arabic:nnn {literal} {it} {it}
}

\@@_new_alphabet_config:nnn {up} {misc}
{
\bool_if:NTF \g_@@_literal_Nabla_bool
Expand Down Expand Up @@ -157,6 +167,14 @@
\@@_set_mathalphabet_greek:nnn {it} {up,it} {#1}
}

\@@_new_alphabet_config:nnn {it} {arabic}
{
\bool_if:NTF \g_@@_literal_bool
{ \@@_set_normal_arabic:nn {it} {#1} }
{ \@@_set_normal_arabic:nn {it,up} {#1} }
\@@_set_mathalphabet_arabic:nnn {it} {up,it} {#1}
}

\@@_new_alphabet_config:nnn {it} {misc}
{
\bool_if:NTF \g_@@_literal_Nabla_bool
Expand Down
52 changes: 52 additions & 0 deletions um-code-mathmap.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,16 @@
}
% \end{macrocode}
%
% \begin{macrocode}
\cs_new:Nn \@@_set_normal_arabic:nn
{
\clist_map_inline:nn {#1}
{
\@@_set_mathalphabet_arabic:nnn {normal} {##1} {#2}
}
}
% \end{macrocode}
%
%
% \subsection{Mapping chars inside a math style}
%
Expand Down Expand Up @@ -571,6 +581,48 @@
}
% \end{macrocode}
%
% \begin{macrocode}
\cs_new:Nn \@@_set_mathalphabet_arabic:nnn
{
\clist_map_inline:nn {#2}
{
\@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {arabicAlef}
\@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {arabicBeh}
\@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {arabicTeh}
\@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {arabicTheh}
\@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {arabicJeem}
\@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {arabicHah}
\@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {arabicKhah}
\@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {arabicDal}
\@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {arabicThal}
\@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {arabicReh}
\@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {arabicZain}
\@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {arabicSeen}
\@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {arabicSheen}
\@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {arabicSad}
\@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {arabicDad}
\@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {arabicTah}
\@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {arabicZah}
\@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {arabicAin}
\@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {arabicGhain}
\@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {arabicFeh}
\@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {arabicQaf}
\@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {arabicKaf}
\@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {arabicLam}
\@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {arabicMeem}
\@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {arabicNoon}
\@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {arabicHeh}
\@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {arabicWaw}
\@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {arabicYeh}
\@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {arabicDotlessBeh}
\@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {arabicDotlessQaf}
\@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {arabicDotlessFeh}
\@@_set_mathalphabet_char:nnnn {#1} {##1} {#3} {arabicDotlessNoon}

}
}
% \end{macrocode}
%
% \begin{macrocode}
%</package>
% \end{macrocode}
Expand Down
Loading