«Developing Arabic fonts»: الفرق بين المراجعتين

من ويكي عربآيز
اذهب إلى: تصفح، ابحث
(صفحة جديدة: {{Inprogress}} <div class="english"> Arabic is said to be complex script, compared to simple scripts like Latin and Cyrillic. To render Arabic text correctly we need more sophi...)
 
ط
سطر 53: سطر 53:
   
 
==== Ligature substitution ====
 
==== Ligature substitution ====
Almost all font designers use ligature substitution because its simplicity, however it isn't always the best way. Many OpenType implementations doesn't support ligature carets taple, giving us no control on where to insert the cursor between ligature components, which makes the experience of editing text with many ligatures not so pleasant. Here we will need simple ligature substitution table, 'liga', FIXME
+
Almost all font designers use ligature substitution because its simplicity, however it isn't always the best way. Many OpenType implementations doesn't support ligature caret table, giving us no control on where to insert the cursor between ligature components, which makes the experience of editing text with many ligatures not so pleasant. Here we will need simple ligature substitution table, 'liga', FIXME
   
 
==== Contextual substitution ====
 
==== Contextual substitution ====

نسخة 11:07، 29 سبتمبر 2007

Inprogress.svg <translate>

In progress</translate>

<translate>

This page is a work in progress. Feel free to contribute. More info may be added by others.</translate>

<translate></translate>

Arabic is said to be complex script, compared to simple scripts like Latin and Cyrillic. To render Arabic text correctly we need more sophisticated font technologies, what is so called `smart fonts', like OpenType, AAT from Apple and SIL's graphite. In this tutorial, we will describe briefly features of Arabic script and the steps of developing Arabic OpenType fonts.

Features of Arabic script

Arabic is a cursive script written from right to left. Each letter has 4 basic forms (with few exceptions); initial, middle, final and isolated forms, each of these forms might take different shapes according to the context and this varies from font to another according to the calligraphic style. For those features, OpenType provides substitution tables; either single or contextual substitution.

One of the interesting features in Arabic script is ligatures, a ligature is a glyph composed of two characters or more, which wen combined together take a different shape other than the shapes of its separated component. Lam-alef is considered as a must have ligature, though a high quality font must have much more ligatures. OpenType's ligature substitution provide a way to address such feature.

Another feature of the Arabic script is the extensive use of diacritic marks known as Harakat or Tashkil, those small vocalization marks lay above or bellow base glyphs, a well designed font must provide attachment points to define the spatial relation between diacritic mark and base glyph. As Arabic diacritics may lay above each other in relation to one base glyph, it is important to address mark to mark relations. To define mark to base and mark to mark relations, we will use anchor points, a way that OpenType provides for defining glyph to glyph relations.

Arabic Unicode

Unicode defines 3 Arabic blocks, 0600-06FF (and 0750-077F) code the actual Arabic characters (i.e. what Arabic text should be encoded with), other blocks are called presentation forms, Arabic Presentation forms A (FB50-FDFF) and B (FE70-FEFF), those blocks define the different shapes of Arabic glyphs like initial, medial, final and isolated forms in addition to some ligatures. The need for presentation forms in Unicode is controversial, as text should never be encoded with those code points, freedesktop's bug #8195 shows an example of the improper use of presentation forms, not to mention the incompleteness of the clouded ligatures and the completely unnecessary ones.

Though we can develop our OpenType fonts with no use of Arabic presentation forms, we are going to use Arabic Presentation Forms B at least, because fontconfig checks for it to determine if a given font is Arabic capable or not.

Font Creation

Tools

Through out this tutorial we will use mainly fontforge as a font development tool. Fontforge is a free software application, runs on GNU/Linux and other similar Unix like systems (including Mac OS X), also runs on MS Windows systems under Cygwin. One of its the very handy features is its scripting interface, which allows writing small scripts (either in python or in fontforge's legacy scripting language) that automate tedious repeated tasks which helps greatly in minimizing the effort of font development.

Creating New font

Start fontforge with no arguments, it'll ask you for a font to open, just choose new, or pass -new option to it in the command line. Fontforge doesn't encode the new font as Unicode by default, go to Encoding -> Reencode and choose "ISO 10646-1 (Unicode, full)", this way Arabic Unicode points will be available for us to edit.

Basically, for a font to support Arabic language, we should cover FIXME code points. Refer to Unicode charts for the details of each glyph.

Initial, medial and final forms

FE70-FEFF (and part of FB50-FDFF) points cover initial, medial, final and isolated forms of The above Arabic code points, refer to FIXME for description of each glyph. FEF5-FEFC are the various forms of lam-alef ligature, though the simplest way to support lam-alef is by using those ligatures, it isn't the only way and not necessarily the best way, we will discuss this in details later.

After creation of the above glyphs, we will need to to add OpenType lookup tables that define substitution rules for those glyphs, what we'll use here is single substitution tables of the type 'init', 'med' and 'fina'.

Lam-Alef

In modern Arabic typography, lam-alef is considered the only mandatory ligature. There is basically to ways to support lam-alef in your font; ligature substitution and contextual substitution.

Ligature substitution

Almost all font designers use ligature substitution because its simplicity, however it isn't always the best way. Many OpenType implementations doesn't support ligature caret table, giving us no control on where to insert the cursor between ligature components, which makes the experience of editing text with many ligatures not so pleasant. Here we will need simple ligature substitution table, 'liga', FIXME

Contextual substitution

In my opinion, contextual substitution is superior to ligature substitution, it decreases the number of unnecessary glyphs in your font, avoid all problems that arise from using ligatures and make your font more close to the soul of Arabic calligraphy. But it needs careful analysis of Arabic calligraphy to define

properly the start and end of each glyph.