Mashael Aldayel (2024). Khatti: An Interactive Mobile Application for Training of Arabic Calligraphy. In: Intelligent Human Systems Integration (IHSI 2024): Integrating People and Intelligent Systems. AHFE Open Access, vol. 119, pp. 714–724. https://doi.org/10.54941/ahfe1004536
Arabic calligraphy serves as a powerful symbol of cultural identity and heritage, evolving and adapting to modern contexts, contributing to a dynamic and vibrant cultural landscape. The issue of handwritten recognition and training training in Arabic script nature has attracted many researchers from both academic and industrial fields. Khatti, an innovative mobile application, was proposed to facilitate the training and learning of Arabic calligraphy. It can help the trainee to improve their calligraphy using technology-driven approach that utilizes interactive features to clarify the details of script, fostering an intuitive learning experience, guiding beginners through the fundamentals and supporting seasoned calligraphers in honing their artistry. This paper investigates the conceptual framework and technical aspects of Khatti, highlighting its potential to revolutionize calligraphy education with the integration of machine learning algorithms. Additionally, application's potential for future development and its possible applications in artistic research and cultural preservation was discussed.
Calligraphy is one of the oldest and most valued forms of art globally. The practice and importance of calligraphy have declined in several parts of the world, but in Arabic culture, the more than 2,000-years-old tradition remains as vibrant and respected as ever. When the ubiquity of words appears to weaken their meaning in modern society, Arabic calligraphy provides a clear and enticing contrast by presenting language and writing as sacred things (Hussain et al., 2015).
Learning calligraphy is a skill; it takes a lot of patience and practice. Any- one may get frustrated when start learning, but as he/she get better and see the beautiful progress, more confidence will be gained. Learning and master- ing new skills that challenge us confirms the belief that anyone can overcome difficulties (Ali and Suresha, 2020). Unfortunately, there is no any application for online training on Arabic calligraphy. In 2021, Saudi Arabia’s culture min- istry had launched the first online platform for teaching Arabic calligraphy (alkhattat, 2020). but it depends on training courses and workshops on actual papers. Digital learning environments require enhanced applications to facil- itate engagement between trainees and tutors. Furthermore, many institutes
Khatti: An Interactive Mobile Application for Training of Arabic Calligraphy 715
that offer training for Arabic calligraphy are not free and limited by a period. Therefore, there is a need to simplify the evaluation of calligraphy skills in a smart way and train users more efficiently on Arabic calligraphy.
Khatti, an innovative mobile application, was proposed to facilitate train- ing and evaluation on handwriting and develop fine motor skills. Using an image similarity algorithm, the user can write Arabic calligraphy with a smart pen on a text pattern of a touch screen. Then, the application can evaluate with similarity scores and measure the performance of handwriting through patterns matching. In addition, this application can train the user on hand- written skills with four principal cursive styles: Naskh, Ruqa’a, Diwani, and Thuluth.
BACKGROUND
Arabic calligraphic scripts can be classified into two broad families: Rectilin- ear scripts (Kufic) and Rounded script (Cursive) as shown in figure 1.
Figure 1: Hierarchical representation of calligraphy families.
Kufic was the first Arabic script, and for 300 years, only Kufic was beau- tiful and monumental enough to compose the Qur’an. However, since the Kufic became a baseline for sacred texts, there was a need for a script that could be written faster and better suited to documents on a smaller scale, such as letters (Holland, 2018).
Afterward, Ibn Muqlah and his successors Ibn el-Bawwab and Yaqut developed and refined the rounded scripts. This script includes the six types (Aqlam el-Sitta) of the classical tradition of Islamic calligraphy The Naskh (based on most Arabic fonts), Thuluth, Muhaqqaq, Rayhani, Ruqa’ and Tawqi’ scripts (Akerman, 2021).
Rounded scripts are referred to (al-khatt al-mansûb), which is the format that conforms, that is regulated, and that is the major difference with Kufic: round scripts are formal. There are considerably basic rules for writing each letter and binding it together. Ideally, the rounded script does not appear like a human hand has written it because there is little ability for creative thinking when writing in this style (Akerman, 2021) (Hussain et al., 2015).
The background of this paper focused on the rounded Arabic script (Naskh – Ruqa’a – Diwani – Thuluth), which is widely used at the present time. Figure 2 presents an example of each script.
716 Aldayel
One of ibn Muqla’s accomplishments, other than creating guidelines for both Kufic and Thuluth scripts, he merges the two scripts to build up and design the Naskh Script. The Naskh Script is relatively easy to write and read there for the structure is clear enough to learn. It is adopted by educa- tional sectors to be taught in schools as beginners. and for now, it is used for body texts of books, histories, education, general knowledge, and scientific research, and it is the official script used in the Mus’haf (Abu-Shaqra, 2020).
Figure 2: Arabic scripts adapted from (Helaihel, 2011).
The Naskh calligraphy is considered an everyday handwritten script, due to its small letters, with less complexity and fast written script, flexibility, letter spacing, flexible guidelines, high letter clarity, rounded letterform, thin strokes, horizontals that are slightly slanted and Kashida (elongations) only applied on bowls and mid-letters (Abu-Shaqra, 2020).
The Ruqa’a script is the most straightforward Arabic calligraphy script used and created in the Ottoman Empire at that time. Ruqa’a is derived from the Arabic noun” Ruqa’a,” meaning “a patch or piece of cloth.” Since it was commonly written on small pieces of paper to petition royalty (Arabic Calligraphy, 2015).
Besides, characterized by the size of its small letters, no horizontal Kashida (elongations), round and fluid in style, most flexible guidelines, letters have short ascenders and descenders, fast written script, high connectivity, low letter detail, and clarity, thick baseline (Abu-Shaqra, 2020).
Diwaniis the most decorative among all Arabic scripts, making it difficult to read. Diwani script was a formal calligraphy style of the Ottoman empire and used for the most important documents such as the diplomatic decree and legal documents. Papers were often written with gold paint when writ- ten in Diwani, And the most famous calligrapher of this calligraphy style was Shaykh Hamidullah. The Diwani script persisted used for this day for different applications (Šurkovi´c and Historian, 2010).
The Diwani calligraphy is a cursive script based on the Ta’liq type, written on a baseline that is less drastically pending, while vertical and sloping are its letter connections. It is characterized by dramatically curved non-dotted let- ters, which is an unusual style are joined together (Arabic Calligraphy, 2015). This allows the script to have high connectivity, meaning preceding letters in a word have no certain position but could go vertically above the succeeding letter or under (Abu-Shaqra, 2020).
Khatti: An Interactive Mobile Application for Training of Arabic Calligraphy 717
Thuluth script is the hardest to write among all Arabic scripts though it is one of the most commonly used today, is it characterized by curved and associated letters written with spikes heads, sometimes intersects. Thuluth is famed for its fancy graphics and charming plasticity (Abu-Shaqra, 2020) (Hussain et al., 2015).
The Thuluth calligraphy is characterized by high letter connectivity, exten- sive use of diacritics, and curved letters with barbed heads. The letters are associated and sometimes intersect, resulting in a cursive flow that is expansive and complex (Arabic Calligraphy, 2015).
LITERATURE REVIEW
Template matching is one of the fundamental image recognition techniques that involves comparing a predefined target image (template) with smaller regions of a reference image. Often implemented through a sliding window approach, the template is systematically shifted across the reference image, calculating a similarity metric at each position to quantify the degree of cor- respondence. Popular distance metrics employed include Euclidean distance, city block distance, and various correlation measures. Based on the chosen metric, the resulting score signifies the level of similarity between the template and the underlying image patch (Memon et al., 2020).
Template matching encompasses two primary methods: rigid and deformable template matching. Rigid template matching assumes a fixed template shape and seeks exact or near-exact matches within the reference image. It is particularly effective for objects exhibiting consistent geometric properties. Deformable template matching allows the template to undergo slight deformations in shape and size, accommodating for natural variations or artistic interpretations within the reference image. This flexibility proves advantageous for objects prone to inherent transformations or expressive renderings (Memon et al., 2020).
In (Meshesha and Jawahar, 2008), authors propose a multi-step approach that involves segmenting the document images into word images and extracting visual descriptors from the word images. The authors employ a combination of local and global features to represent the word images effectively.
Application for Arabic calligraphy can be divided based on the platform into the digital learning environment and smartphone applications (table 1). Digital learning environments such as Alkhattat can facilitate engagement between trainees and tutors. Last year, Saudi Arabia’s culture ministry launched the first online platform for teaching Arabic calligraphy. (alkhattat, 2020) but it depends on training courses and workshops on actual papers. Like other commercial institutes, this platform offers training for Arabic calligraphy that is not free and limited by a period.
For smartphone applications, only one similar application was found which is (Mashq- to train calligraphy) (‘Mashq2016,’) for training on Arabic calligraphy with a touch screen and smart pen. Moreover, there are few appli- cations for teaching Arabic writing and spelling, such as Atqen project, which developed by students at King Saud University, to teach children how to write
718 Aldayel
only Arabic alphabetic in a different position. In the following paragraph, the related works was discussed.
Platform Digital learning environment Entering word No Yes No No Yes Yes Yes
No No No No Yes No Yes Training with touch pen Both No Both Both Both No sentence Training letters or sentence
Yes No Yes Yes Yes No Yes Teaching calligraphy via videos No Yes No No No No Yes Save work on an application
Update (Edit) work No Yes No No Yes No Yes No No No No No No Yes Evaluate handwriting
Ana muhtaref alkhat (‘Ana Muhtarif Al Khat’, 2016) is a mobile appli- cation for creating Arabic calligraphy artwork and designs. It offers 21 embedded Diwan fonts including Diwan, Naskh, Mishafi, Diwan, Thuluth, Diwan, and Farsi. It also provides few shaping options for each word segment including alternative shapes, wide forms and removes dots.
Arabicc is a mobile application and website that help to teach Arabic cal- ligraphy through the description of the letter by download notes to match over the grey shade. It provides a video of how to write the litter, shows steps of writing the litter, supports multiple languages, and sharing options via email, Twitter, and more.
Al-Khattat (alkhattat, 2020) is an electronic platform to teach Arabic cal- ligraphy and decoration online, by a group of professional calligraphers through training courses. It shows videos of learning how to write Arabic calligraphy.
Kaif tuhassen khattak is a mobile application and website to improve the Ruqa’a calligraphy by download books to match over the grey shade. It shows videos of learning how to write in Ruqa’a calligraphy. It books an appointment with an Arabic calligraphy trainer.
Mashq- to train calligraphy (‘Mashq,’ 2016) is a mobile application that represents an electronic panel that helps those who want to learn calligraphy. It provides four different styles can practice: Naskh, Ruqa’a, Thuluth Jali, and Nastaleeq. It is about simulating the calligraphy pen with changing the angle through the provided seek-bar or by choosing a two-pointer icon.
Kaligrafi (‘Kaligrafi’, 2019) is a mobile application the different Arabic writing styles that match the writing you wrote are displayed in the input field provided.
Khatti: An Interactive Mobile Application for Training of Arabic Calligraphy 719
METHODOLOGY OF DEEP SIMILARITY LEARNING The Khatti application core functionality revolves around comparing user handwriting with Arabic calligraphy. This comparison relies on deep similar- ity learning, a method that analyzes two images and assigns a score indicating their visual similarity. Essentially, it measures the degree of similarity between images and outputs a score between 0 and 1, with higher values signifying greater contextual similarity. A score of 1 represents identical images (Ma et al., 2021) (Martino, 2020).
Figure 3 illustrates the typical deep similarity learning process. First stage involves an encoder, extracting relevant characteristics and converting the input images into feature vectors. These vectors, numerical representations of the images, are then compared using distance metrics like Manhattan or Euclidean. These metrics measures the distance between the vectors in a high- dimensional space. Finally, based on the chosen metric, a similarity score is generated, reflecting the degree of similarity between the vectors. Higher scores signify a closer match between the original images, while lower scores indicate disagreement (Ma et al., 2021) (Martino, 2020).
Figure 3: Data processing pipeline for similarity learning adapted from (Martino, 2020).
In the development of the Khatti application, image similarity processing was addressed by leveraging the availability of free and open-source soft- ware resources. An API (Application Programming Interface) was sought that would achieve the desired functionality while ensuring compatibility with the application development environment. The Cloudmersive API was ultimately chosen and its integration is detailed in the implementation section. Figure 4 presents the stages involved in developing the Khatti application.
Figure 4: Development of “Khatty” application.
Figure available in the original PDF paper.
1. Data Collection
This section shows the characteristic of the target user and questionnaire used to gathered requirements from the target audience.
Khatti is designed for individuals aged 10 and above who possess basic Arabic literacy skills (reading and writing). Additionally, users require an
720 Aldayel
iPad with a compatible smart. To gather user needs, a survey was distributed to 100 individuals. Results revealed that:
Age: 43% were aged 10-18, while 57% were 19 and above.
Handwriting Evaluation: 35% faced challenges in evaluating their Arabic script, 14% had no issues, and 51% did not actively seek such evaluation.
Touch Pen Preference: 37% preferred using a touch pen for handwriting practice, 23% did not, and 40% were neutral.
App Interest: 90% expressed interest in trying an app that evaluates and improves their handwriting, while 10% were not interested.
Calligraphy Preferences: Ruqa’a was the most popular script (75%), fol- lowed by Naskh (62%), Diwani (47%), Farsi (41%), and Thuluth (34%) as shown in Figure 5.
Figure 5: Chosen calligraphies in the survey result.
2. System Design
Khatti application employs a modular three-tier architecture designed to prioritize flexibility and independent maintainability. This architectural choice facilitates the seamless integration of future functionalities while enabling efficient modification of existing features. The three-tier architec- ture includes presentation, logic and data tiers. First, presentation tier serves as the primary interaction point between the user and the application. This user interface, residing on an iPad and a smart pen, translates user tasks and results into readily comprehensible formats. Next, logic tier performs the core functionalities of image analysis, comparison, and decision-making. Additionally, the logic tier manages data interaction, reading and writing information to and from the data tier. Finally, data tier stores all persistent data used by the application. Predefined templates, user-saved sessions, and any other persistent information essential for Khatti’s operation are securely stored and managed within this tier.
3. System Implementation
The app was developed using XCode that is compatible with IOS plat- form. For software integration, CocoaPods was used to integrate Xcode project automatically. CocoaPods is an application-level dependency man- ager that focuses on the source-based distribution of third-party code. Table 2 describes the used libraries. For image comparison, Cloudmersive
Khatti: An Interactive Mobile Application for Training of Arabic Calligraphy 721
API (‘Cloudmersive API’, 2023) was used for implementing image similar- ity. Cloudmersive image recognition and processing API is a free online service. that can detect faces in images and works with PNG and JPEG for- mats. After authenticating with an API Key, calls can be executed in JSON format. Also, the developers may use the API to caption pictures, iden- tify faces, and resize images This API can also recognize and compare two images for similarity. It creates an image similarity score between 0.0 and 1.0 using deep learning; results closer to 1.0 imply higher similarity than the results close to 0.0. The main endpoint intended for image comparison is /image/recognize/similarity/compare.
To implement Cloudmersive API in Khatti app, first the interred text is converted to a PNG image (base image). Then, the handwriting of the user will also be converted to a PNG image (comparison image), as shown in Figure 6, Finally, the recognition mood was specified in the header request to ‘Advanced’ to ensure that more accurate result will be delivered for Khatti users.
Evaluation method in Khatti app compares the template with user hand- writing, by sending those images to an API which uses deep similarity learning, it creates a score between 0.0 and 1.0, where values closer to 1.0 indicate a higher degree of similarity. Then multiply the result by 100 to be more convenient and reliable to the user.
Figure 6: Description of two different result to the same base image (black) and different comparison Image (blue).
To test Cloudmersive API, figure 6 compares two different drawings to the Arabic letter “ ”. In example A, you can see that after the two pictures have been compared, the image similarity score = 1, indicating that the text and drawing are similar. On the other hand, in Example B, the image similarity score = 0.215625, indicating that the two images are dissimilar.
4. User Interface
This section provides a sample of the user interfaces implemented in the Arabic language. Figure 7 showcases a sample user interface interaction in Arabic where the user can enter new text for training or select a sample text. Then the user select script and write over the template using a smart pen.
722 Aldayel
Table 2. Integrating library with cloudmirsive API.
Table available in the original PDF paper.
Library Description Alamofire(Alamofire, 2023) Adaptable approach for interacting with HTTP network requests based on Apple’s URL Loading System. KRProgressHUD (KRProgressHUD, 2023)
Swift-based Animated Alert View.
Swift-written progress ‘Heads-up Display’ for iOS. The loaded view is displayed with KRActivityIndicatorView. SCLAlertView (SCLAlertView, 2023) SwiftSignatureView (Misra, 2023) Lightweight and customizable solution for capturing signatures within the application. The signature can be retrieved as a UIImage. The view generates fluid, natural-looking signatures by varying the pen width based on the speed of the smart pen movement and pressure. PencilKit (PencilKit, 2023) For adding drawn content to the iPadOS or macOS application. PencilKit creates a drawing environment for the iOS application that accepts input from the smart pen and converts it into images that can display in iPadOS, iOS, or macOS.
Once the user completes the tracing, Khatti analyzes the handwriting and dis- plays a similarity score. In Figure 7, the score is 60%, indicating the closeness of the user’s handwriting to the template.
Figure 7: User interfaces.
CONCLUSION
Khatti offers a training and educating platform to help people interested in Arabic calligraphy of age from ten years and above. Users choose pre-loaded phrases or personalize their practice with their own text, tracing strokes on a virtual canvas and receiving feedback through similarity scores. Saved ses- sions allow for progress tracking and sharing, fostering a sense of community around mastering this beautiful art form. Khatti aims to engage Arabic com- munities in the digital age, offering a modern and dynamic way to refine handwriting skills.
Khatti: An Interactive Mobile Application for Training of Arabic Calligraphy 723
Khatti system was designed mainly to train four Arabic scripts and tar- get iOS users only. For future work, the application will support Android devices and more features/functionalities can be added to Khatti, such as: cre- ate user profile to present his/her handwriting works and share it with friends’ profiles. Moreover, for future work, Khatti system will support English lan- guage to facilitate its marketing and make it widely used by a larger target population.
ACKNOWLEDGMENT
The author would like to acknowledge the programming team: Norah Alrsini, Raghad Bablghaith, Maymounah Haddad and Lojain Alghamdi.
REFERENCES
Abu-Shaqra, D. (2020) Arabic Type Classification System Qualitative Classification of Historic Arabic Writing Scripts in the Contemporary Typographic Context. OCAD UNIVERSITY. Akerman, I. (2021) ‘Arabic calligraphy: Ancient craft, modern art’, Arab News.
Available at: https://www.arabnews.com/ArabicCalligraphy. Alamofire (2023). MacStadium, MIT license. Available at: https://github.com/Alamo fire/Alamofire (Accessed: 8 November 2023). Ali, A. A. A. and Suresha, M. (2020) ‘Survey on Segmentation and Recogni-
tion of Handwritten Arabic Script’, SN Computer Science, 1(4), p. 192. doi: 10.1007/s42979-020-00187-y. alkhattat (2020). Available at: https://www.alkhattat.net (Accessed: 8 August 2022). ‘Ana Muhtarif Al Khat’ (2016). Diwan Software Ltd. Available at: https://play.
google.com/store/apps/details?id=com.diwan.muhtarifalkhat&hl=en&gl=US. Arabic Calligraphy (2015). Available at: https://www.arabic-calligraphy.com/arabiccalligraphy-styles/thuluth/. ‘Cloudmersive API’ (2023). Cloudmersive, LLC. Available at: https://api.cloudmersi
ve.com/ (Accessed: 8 August 2023). Helaihel, M. D. (2011) ‘Script Style’, in Arabic Calligraphy. BibliASPA. Available at: https://bibliaspaeng.wordpress.com/culture-and-art/calligraphy/script-st yles/ (Accessed: 8 December 2023). Holland, J. (2018) A Brief History of Arabic Calligraphy, skill share blog. Available
at: https://www.skillshare.com/blog/a-brief-history-of-arabic-calligraphy/. Hussain, R. et al. (2015) ‘A comprehensive survey of handwritten document benchmarks: structure, usage and evaluation’, EURASIP Journal on Image and Video Processing, 2015(1), p. 46. doi: 10.1186/s13640-015-0102-5. ‘Kaligrafi’ (2019). Tri Handayani. Available at: https://play.google.com/ store/apps/details?id=com.trihandayani.kaligrafi&hl=en&gl=US. KRProgressHUD (2023) MIT license. Available at: https://github.com/krimpedance
/KRProgressHUD (Accessed: 7 October 2023). Ma, G. et al. (2021) ‘Deep graph similarity learning: a survey’, Data Mining and Knowledge Discovery, 35(3), pp. 688–725. doi: 10.1007/s10618-020-00733-5. Martino, T. (2020) Multimodal Similarity Learning for Duplicate Product Identifi-
Memon, J. et al. (2020) ‘Handwritten Optical Character Recognition (OCR): A Comprehensive Systematic Literature Review (SLR)’, IEEE Access, 8, pp. 142642–142668. doi: 10.1109/ACCESS.2020.3012542. Meshesha, M. and Jawahar, C. V. (2008) ‘Matching word images for content-based
retrieval from printed document images’, International Journal on Document Analysis and Recognition, 11(1), pp. 29–38. doi: 10.1007/s10032-008-0067-3. Misra, A. (2023) ‘SwiftSignatureView’. MIT license. Available at: https://github.com /alankarmisra/SwiftSignatureView. PencilKit (2023) Apple Developer. Available at: https://developer.apple.com/docume
ntation/pencilkit. SCLAlertView (2023). Available at: https://github.com/vikmeup/SCLAlertView-Sw ift. Šurkovi´c and Historian (2010) ‘Diwani style, a Calligraphic Arabic Script - Magazine | Islamic Arts Magazine’, islamic arts magazine. Available at: https://islamicartsmagazine.com/magazine/view/diwani_style_-_a_calligraphi c_variety_of_arabic_script/.
LISTED IN THE AHFE DIGITAL BOOKSTORE CATALOGUE
Explore the complete digital volume
Intelligent Human Systems Integration (IHSI 2024): Integrating People and Intelligent Systems
Read this individual research paper free through the original publisher, or explore the full digital proceedings book.
ISBN 978-1-958651-95-7
Explore this ISBN in the AHFE Bookstore ↗Listed in the July 2026 bookstore catalogue; search by ISBN to confirm current availability · Digital book purchase optional