Towards a Dynamic Font Respecting the Arabic Calligraphy

Towards a Dynamic Font Respecting the Arabic Calligraphy

Abdelouahad Bayar (Cadi Ayyad University, Morocco) and Khalid Sami (Cadi Ayyad University, Morocco)
DOI: 10.4018/978-1-61520-789-3.ch028
OnDemand PDF Download:
List Price: $37.50


To justify texts, Arabic calligraphers use to stretch some letters with small flowing curves; the kashida instead of inserting blanks among words. Of course, such stretchings are context dependent. An adequate tool to support such writing may be based on a continuous mathematical model. The model has to take into account the motion of the qalam. The characters may be represented as outlines. Among the curves composing the characters outlines, some intersections are to be determined dynamically. In the Naskh style, the qalam‘s head behaves as a rigid rectangle in motion with a constant inclination. To determine the curves delimiting the set of points to shade when writing, we have to find out a mathematical way to compare plane curves. Moreover, as the PostScript procedure to produce a dynamic character, should be repeated whenever the letter is to draw, the development of a font supporting a continuous stretching model, allowing stretchable letters with no overlapping outlines, without optimization would be of a high cost in CPU time. In this chapter, some stretching models are given and discussed. A method to compare curves is presented. It allows the determination of the character encoding with eventually overlapping outlines. Then a way to approximate the curves intersection coefficients is given. This is enough to remove overlapping outlines. Some evaluations in time processing to confirm the adopted optimization techniques are also exposed.
Chapter Preview


The justification of texts written in an Arabic alphabet based script, is based on stretching letters instead of the ordinary insertion of spaces (blanks) among words. This concept called the kashida is almost mandatory in cursive writings such as Arabic.

Many typesetting systems such as TeX/LaTeX (Knuth, 1984 & Lamport, 1985), WYSWYM systems such as LyX (LyX Team, 2004) and WYSIWYG systems such as TeXMacs (Joris, 2003) provide support to typeset documents in latin alphabet based scripts in a quite good quality. Some extensions of TeX and LaTeX like ArabTeX (Lagally, 2004), Ω (Haralambous, 1997) and RydArab (Lazrek, 2001) allow typesetting lines in Arabic alphabet based scripts. As the stretching of characters, according to the rules of Arabic calligraphy, is curvilinear, the encoding languages are to support what can be called “dynamic fonts” as PostScript language does (Adobe Systems Incorporated, 1999). Instructions used in coding characters in TrueType fonts (Weise, 1992) also allow such support. Unfortunately, this support is not offered by Metafont (Knuth, 1986). That's the reason why extensions of (La)TeX don’t support the dynamism needed by an Arabic font. Big improvements had been provided in the CurExt system proposed by A. Lazrek (2003). When the system is called with RydArab it allows typesetting documents with stretchable characters. With this package, the variable sized character, in the suitable size, is produced via repeated calls of Metafont in TeX. A certain number of stretchings in different sizes can so be used in a document. But in some cases, much more than this amount of stretchings can be necessary.

The dynamic fonts have been studied first by J. André and B. Borghi (1990). Daniel Berry used the concept in (André & Borghi, 1990) and developed a type 3 PostScript font to be used with the dittroff/ fforttid system to typeset documents in right-to-left alphabet based scripts (Berry, 1999). This system offers a good support for the characters dynamism even though it contains some flaws. Actually, in (Berry, 1999), the stretching is performed in the horizontal direction only and the stretching model don't take into account the motion of the nib's head. This fact leads to some lost of quality in big stretching. Solutions to fix such flaws have been proposed in (Bayar & Sami, 1999). The actual chapter extends the results already published in (Bayar, 2008).

The suitable extent to which characters in an Arabic alphabet script based text are to be stretched is context dependent. The stretching model may be continuous. In a dynamic PostScript font, the procedure to produce a character is repeated whenever the character is to be drawn. So, introducing a program to support the kashida in the font, without taking into account some optimizations, would be of a high cost in CPU. We have then to find out an alternative way to develop a stretching model. The natural way to represent stretching in PostScript can be based on parameterized cubic Bézier curves. Such model introduces a big amount of calculations in comparison to a quadratic stretching model. A study and evaluation of the cubic and quadratic models is proposed in this chapter.

Due to cursivity of the Arabic script, the qalam characteristics and the kashida, writing words based on stretched outlined letters implies taking into account some particular properties and requirements. Intersections of some curves are to be determined dynamically in the font. Unless some optimizations are done, the use of such font would slow the typesetting.

The chapter follows the plan: the second section highlights the kashida notion, the requirements of writings in outlined letters and the classification of characters in term of dynamism. The third section presents the geometrical representation and therefore the notion of qalam’s motion. In the fourth section, the stretching models are presented and compared for optimization. In the fifth section, we show how static letters are implemented in the font. The way to implement the dynamic letters, in filled in or outlined version, is the main part of the chapter. The sixth and seventh parts provide more extensions. Implementations based on the different concepts are compared and evaluated.

Complete Chapter List

Search this Book: