🖋 Arabic Rendering Engine — Documentation

The ACE system includes a powerful Arabic rendering engine that converts Latinized input (ktb, ya, ta, a, i, u, etc.) into fully formatted Arabic script such as:

Latin: yaktubu
Arabic: يَكْتُبُ

This module is used by:


1️⃣ Purpose of the Arabic Renderer

The rendering engine solves four major problems:

kaAtab → كَاتَبَ
yaktubuwna → يَكْتُبُونَ

2️⃣ Latin → Arabic Letter Mapping

ACE uses the same consistent transliteration rules across the system. Each Latin token maps to an Arabic letter, including digraphs:

LatinArabic
AAع
Hح
ghغ
khخ
shش
dhذ
thث
Tط
Dض
Sص
Zظ

The parser always checks digraphs before single letters.


3️⃣ Vowel Handling

LatinArabic
aَ (fatḥa)
iِ (kasra)
uُ (ḍamma)
(blank)ْ (sukun)

Special long vowels:


4️⃣ Automatic Sukun Insertion

If two consonants occur consecutively:

ktb → كَتَبَ But yaktubu has kt → كْت (sukun inserted)

5️⃣ Automatic Shaddah

When two identical consonants occur:

dd → دّ tt → تّ ll → لّ
This includes:

6️⃣ Tajweed Coloring Rules

The renderer supports Tajweed class-based coloring:
CategoryDescriptionColor
Qalqalahق ط ب ج دBlue
Throat lettersء ه ع ح غ خRed
Tafkhīmص ض ط ظ ق غ خOrange
The CSS classes are inside `ace_styles.css`: ```css .ar-throat { color: #e11d48; } .ar-qalqalah { color: #1d4ed8; } .ar-tafkhim { color: #ea580c; }