«Khotot/Tutorial»: الفرق بين المراجعتين

من ويكي عربآيز
اذهب إلى: تصفح، ابحث
(spell cheching mainly)
سطر 10: سطر 10:
   
 
==Get font files==
 
==Get font files==
We maintain a set of SFD files (the internal database format that FF<ref>FontForge</ref> uses).
+
We maintain a set of SFD files (the internal database format that FF <ref>FontForge</ref> uses).
   
You can access the files using the web interface; http://cvs.arabeyes.org/viewcvs/art/khotot/sfd/ , or get your local cvs copy:
+
You can access the files using the web interface; http://cvs.arabeyes.org/viewcvs/art/khotot/sfd , or get your local cvs copy:
 
<pre>
 
<pre>
 
cvs -d:pserver:anoncvs@cvs.arabeyes.org:/home/arabeyes/cvs login
 
cvs -d:pserver:anoncvs@cvs.arabeyes.org:/home/arabeyes/cvs login
سطر 27: سطر 27:
 
# The very first feature is to make diacritic marks lay over base glyphs, this is achieved by making diacritic glyphs zero width glyphs.
 
# The very first feature is to make diacritic marks lay over base glyphs, this is achieved by making diacritic glyphs zero width glyphs.
 
# The ability to set the diacritic mark relative to each glyph, as compared with poorly designed fonts where all diacritic marks lay at the same level regardless to the underlying base glyph. This can be achieved by using anchor points.
 
# The ability to set the diacritic mark relative to each glyph, as compared with poorly designed fonts where all diacritic marks lay at the same level regardless to the underlying base glyph. This can be achieved by using anchor points.
# The ability to place Diacrtics properly over ligatures<ref> A ligature is a combination of two characters into one glyph, the only mandatory ligature in Arabic is Lam Alef</ref>.
+
# The ability to place Diacrtics properly over ligatures <ref>A ligature is a combination of two characters into one glyph, the only mandatory ligature in Arabic is Lam Alef.</ref>.
 
# The ability to place Diacritic marks correctly in relation to each other, what so called stacked diacritic marks, like Shadda whith Fatha over it.
 
# The ability to place Diacritic marks correctly in relation to each other, what so called stacked diacritic marks, like Shadda whith Fatha over it.
   
 
==Editing the font==
 
==Editing the font==
[[image:ff_excute.png|thumb|right|FF's Execute dialog]]
 
 
===Setting diacritic marks to Zero width===
 
===Setting diacritic marks to Zero width===
 
[[image:ff_excute.png|thumb|right|FF's Execute dialog]]
 
Open the font with FF, from font view select diacritic glyphs (from U+064B to U+0652). Go to "File -> Execute Script" Dialog, check "FF" check box, they type "SetWidth(0)".
 
Open the font with FF, from font view select diacritic glyphs (from U+064B to U+0652). Go to "File -> Execute Script" Dialog, check "FF" check box, they type "SetWidth(0)".
  +
  +
''NOTE'': Current fonts in Arabeyes CVS has this done already.
   
 
===Anchor points===
 
===Anchor points===
سطر 41: سطر 43:
 
* Mark to Mark: mark in relation to another mark, Fathah over Sahaddah for example.
 
* Mark to Mark: mark in relation to another mark, Fathah over Sahaddah for example.
   
You need to add lookuptables and subtables in order to set anchor point classes.
+
You need to add lookup tables and sub tables in order to set anchor point classes. Refer to FF manual for detailed description <ref>[http://fontforge.sourceforge.net/lookups.html FontForge Manual] - Manipulating OpenType Lookups.</ref>.
  +
  +
To automate the process of Adding lookup tables, sub tables, anchor classes and anchor points, we have a set of scripts that do assest this, get it from http://cvs.arabeyes.org/viewcvs/art/khotot/tools (or khotot/tools from cvs directly).
  +
  +
There are 2 scripts related to anchor points; <code>addlookups.pe</code> and <code>addanchors.pe</code>. Say you are working on Font.sfd file, you can run the scripts against it either from the command line:
  +
<pre>
  +
./addlookups.pe Font.sfd
  +
./addanchors.pe Font.sfd
  +
</pre>
  +
NOTE:
  +
* The scripts can accept multiple files at once; <code>./addlookups.pe *.sfd</code>
  +
* You MUST run addlookups.pe script first.
  +
* Files in Arabeyes CVS has this done already.
  +
  +
Also, you can open the font in FF, then go to "File -> Execute Script", check FF check box, then use "Call..." button to open the script and run it against the font.
  +
  +
After doing this, you'll have anchor points set for each glyph, now we need to manually adjust those anchor points to get the desired behaviour.
  +
  +
[[image:anchors.png|thumb|right|150px|Glyph view showing anchor points.]]
  +
When you open on any glyph, in the Arabic Unicode Block of course, in glyph view, you will find tow anchor points; ArabicAbove and ArabicBelow.
  +
  +
ArabicAbove anchor point is used to mach diacritic marks that lay above base glyph, like fatha, shadda and dammah. While ArabicBelow is utilized by diacritics that lay below base glyph, like kasrah.
  +
  +
[[image:anchors_liga.png|thumb|left|150px|Anchor points over lam alef ligature.]]
  +
Ligatures are special glyphs, each ligature have an anchor point of each class for each component. Lam alef has 2; one for lam and one for alef.
  +
  +
  +
  +
   
 
-----
 
-----
<references/>
+
{{references}}

نسخة 16:58، 28 يوليو 2007

< Khotot

Here we'll summarize the process of developing Arabeyes TrueType fonts.

Requirements

  • FontForge: FontForge is our main font editing and development software, it is a free software. You will need version 20070723 at least. [1]
  • ...

Get font files

We maintain a set of SFD files (the internal database format that FF [2] uses).

You can access the files using the web interface; http://cvs.arabeyes.org/viewcvs/art/khotot/sfd , or get your local cvs copy:

cvs -d:pserver:anoncvs@cvs.arabeyes.org:/home/arabeyes/cvs login

The password is 'anoncvs' (just like the login name).

 
cvs -z3 -d:pserver:anoncvs@cvs.arabeyes.org:/home/arabeyes/cvs co art/khotot

NOTE: this is about 30MB download.

Diacritic Marks (Harakat)

One of the most annoying problems is the lack of proper Arabic diacritics support in free fonts (and even most non-free fonts). For a given font, it must provide some features to support Arabic diacritics properly:

  1. The very first feature is to make diacritic marks lay over base glyphs, this is achieved by making diacritic glyphs zero width glyphs.
  2. The ability to set the diacritic mark relative to each glyph, as compared with poorly designed fonts where all diacritic marks lay at the same level regardless to the underlying base glyph. This can be achieved by using anchor points.
  3. The ability to place Diacrtics properly over ligatures [3].
  4. The ability to place Diacritic marks correctly in relation to each other, what so called stacked diacritic marks, like Shadda whith Fatha over it.

Editing the font

Setting diacritic marks to Zero width

FF's Execute dialog

Open the font with FF, from font view select diacritic glyphs (from U+064B to U+0652). Go to "File -> Execute Script" Dialog, check "FF" check box, they type "SetWidth(0)".

NOTE: Current fonts in Arabeyes CVS has this done already.

Anchor points

Anchor points are points that is used to tell font rendering engine where to put to glyphs in relation to each other [4]. For diacritic positioning we need 3 classes of anchor points:

  • Mark to Base: mark in relation to base glyph, say Dammah over Alef.
  • Mark to Ligature: mark in relation to ligature, say Fathah over Lam Alef.
  • Mark to Mark: mark in relation to another mark, Fathah over Sahaddah for example.

You need to add lookup tables and sub tables in order to set anchor point classes. Refer to FF manual for detailed description [5].

To automate the process of Adding lookup tables, sub tables, anchor classes and anchor points, we have a set of scripts that do assest this, get it from http://cvs.arabeyes.org/viewcvs/art/khotot/tools (or khotot/tools from cvs directly).

There are 2 scripts related to anchor points; addlookups.pe and addanchors.pe. Say you are working on Font.sfd file, you can run the scripts against it either from the command line:

./addlookups.pe Font.sfd
./addanchors.pe Font.sfd

NOTE:

  • The scripts can accept multiple files at once; ./addlookups.pe *.sfd
  • You MUST run addlookups.pe script first.
  • Files in Arabeyes CVS has this done already.

Also, you can open the font in FF, then go to "File -> Execute Script", check FF check box, then use "Call..." button to open the script and run it against the font.

After doing this, you'll have anchor points set for each glyph, now we need to manually adjust those anchor points to get the desired behaviour.

Glyph view showing anchor points.

When you open on any glyph, in the Arabic Unicode Block of course, in glyph view, you will find tow anchor points; ArabicAbove and ArabicBelow.

ArabicAbove anchor point is used to mach diacritic marks that lay above base glyph, like fatha, shadda and dammah. While ArabicBelow is utilized by diacritics that lay below base glyph, like kasrah.

Anchor points over lam alef ligature.

Ligatures are special glyphs, each ligature have an anchor point of each class for each component. Lam alef has 2; one for lam and one for alef.




  1. FontForge can be found in its web page, fontforge.sourceforge.net.
  2. FontForge
  3. A ligature is a combination of two characters into one glyph, the only mandatory ligature in Arabic is Lam Alef.
  4. FontForge Manual - Overview of Anchors.
  5. FontForge Manual - Manipulating OpenType Lookups.