Converting any Arabic font to TechArabic font
December 22, 2024

Converting any Arabic font to TechArabic font

As discussed in our previous article Arabic for Science and Technologythis form of Arabic relies on a non-cursive script in which each letter retains a consistent shape regardless of its position in the sentence. In this article, I will guide you through the process of converting any Arabic font into a technical Arabic font. It is worth noting that Technical Arabic mainly focuses on writing programming codes, mathematical equations, and scientific expressions; however, it remains robust and reliable for certain descriptive passages.

In this article we have chosen Kawkab Mono fontwe’ll walk you through the process of converting it to a non-cursive format.


Why mono?

Monochrome or monospaced fonts differ from regular fonts in that each character occupies the same fixed width, whereas regular fonts have different widths for different characters. This consistency in monochrome fonts enhances readability and alignment, making it easier to scan and understand program code and mathematical equations. Consistent spacing allows for clear visual organization, which is crucial when dealing with complex syntax and structure. Therefore, in programming and mathematical writing, monochrome fonts are preferred as they minimize clutter, facilitate line-by-line debugging, and ensure that symbols and numbers are properly aligned, thereby increasing the overall clarity and precision of technical documents. .


Get font

Visit the font’s website to download the file. After extracting it, you will find a structure similar to the following:

You can choose any format that suits your needs. However, for my purposes, since I need a compressed format for modern web browsers, I will choose KawkabMono-Regular.woff2. No matter which format you choose, the same guidelines will apply.


Font editor

You can use any font editor you like; I personally use font forgingwhich you can download from the link provided.

After opening the font file in FontForge, you will see a screen similar to the following:

This article strives for brevity, so I won’t cover the basics of type design. For more detailed information, please refer to this guide.


find alternative form

Next, we need to determine the initial alternative forms for all Arabic glyphs. Our goal is to modify the font file so that it contains only the initial form of each letter, regardless of its position in the word, thereby removing all other forms.

First, select any Arabic glyph (e.g. the letters “beh”) and navigate to Elements > Glyph Info > Replacement.

Make a note of the glyph name for the “init” replacement, in this case uniFE91.

Next, go to View > Go and enter “uniFE91” to select the corresponding glyph. Double-click it to open the glyph editor.


Replace default glyphs with “Init” form

  1. Select the entire “init” form:
    You can use Edit > Select All or press Ctrl + A.

  2. Copy the “init” form:
    Go to Edit > Copy or press Ctrl + C.

  3. Close the editing window for the “init” glyph.

  4. Now, go back to the default glyph (uni0628 in our example).

  5. Double-click to open the font editing window.

  6. Select everything in this glyph:
    Use Edit > Select All again or press Ctrl + A.

  7. Delete existing content:
    Press the delete key.

  8. Paste the “init” form:
    Go to Edit > Paste or press Ctrl + V.


Repeat for all glyphs

Repeat the above steps for each glyph from uni0621 to uni064A (Alef to Yeh).


Save your changes

Once all glyphs have been replaced:

  • Go to File > Generate Font.
  • Select your desired format (for example, TrueType, OpenType).
  • Click Save and confirm any prompts.

Following these steps will allow you to effectively replace each glyph’s default form in FontForge with its “init” form.


result

Using the generated font, your code would look like this:

Observe that each letter adopts a single shape and the letters are separated but still readable. In addition, we have resolved several complex issues related to Hamza.

2024-12-22 12:48:54

Leave a Reply

Your email address will not be published. Required fields are marked *