28 Agustus 2012

Fixing dagger alif in alqalam

Following the inverted damma, I found that the dagger alif is rendered incorrectly on particular letters, i.e. ا د ذ ر ز و ء. Instead of being rendered above the letter, the dagger alif is rendered after that letter. Strangely it is not recognized as diacritic/harakah, instead it is recognized as character skeleton. Thus the fix is really hacks, I haven't found what is the impact on the whole system. The hack is done on qaparse.sty and qaboxes.sty. On qaparse.sty we do the following hacks:

--- qaparse.sty 
+++ origin/qaparse.sty 
@@ -880,12 +880,10 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%% special vowels %%%%%%%%%%%%%%%%%%%%%%%%%% 
 
 \def \sv@a@a #1{% Qur'an alif
- %% \if\xpa\is@in@list \the\last@con dFraQzw>%
- %%  \if\is@in@list #1TA>\add@fathaspec%
- %%  \else\put@syl\tashiltrue\put@con\a@alif@kh\fi%
- %% \else\add@fathaspec\fi%
-        \add@fathaspec%
+ \if\xpa\is@in@list \the\last@con dFraQzw>%
+  \if\is@in@list #1TA>\add@fathaspec%
+  \else\put@syl\tashiltrue\put@con\a@alif@kh\fi%
+ \else\add@fathaspec\fi%
  \stepcounter{qm@rk}%                          % to allow multiple floors for quran marks 
 \case #1\of%
 {   \a@H {\put@con \a@H\put@syl\syl@con}%

On qaboxes.sty we do the following hacks:
--- qaboxes.sty 
+++ origin/qaboxes.sty 
@@ -518,10 +518,7 @@
 \put@hi {\char\a@hamz@s}\or                           % 27
 \put@lo {\char\a@hamz@s}\or                           % 28
 \put@aya\or                                           % 29
-% we shall hack this because it triggers alif dagger harakat error in the following char
-%    ا د ذ ر ز و ء 
-%\put@alif{\char\a@quran@alif}\or                      % 30                                   % 30
-\put@fathaspec\or
+\put@alif{\char\a@quran@alif}\or                      % 30                                   % 30
 \put@hi {\a@syeh}\or                                  % 31
 \put@hi {\char 2 }\or                           % illegal
 \else \put@hi {\char 2 }\or                           % illegal

26 Agustus 2012

Fixing inverted damma in alqalam

I found problem when typeset inverted damma in alqalam. To fix this I have to traverse across the module, because I could not find adequate  documentation about the structure, much worse I have never programmed any latex stuff.
In brief the flow is the following:
1. UTF code is processed in qutfcode.sty. Inverted damma UTF code is d997 (don't get confused with reversed damma). It was not encoded on alqalam version 427/08/17 0.2. Thus I add the encoding "\n@xp\a@u.
Note: some important arabic UTF code can be observed on utf8-chartable.de
2. The "\n@xp\a@u code then will be translated into integer in qaparse.sty. It is encoded as \c@ammad, with integer code 12.
3. Then in qaboxes.sty on function \put@voc case 12, the inverted damma character is translated as \a@ammad to be written.
4. Finally the code is mapped into the font glyph at qxarbsymb.sty.
\chardef \a@ammad = '146.
This is a simple code to view the glyph:

\documentclass{article}
\usepackage{fonttable}
\pagestyle{empty}
\begin{document}
\fonttable{qnskh14} %this is default font in alqalam
\end{document}