Rendering Arabic fonts in IM

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
ringydingydo

Rendering Arabic fonts in IM

Post by ringydingydo »

My goal is to render arabic text in the expected cursive format (and right-to-left).
I am using IM 6.0.7.
I can get both English and Arabic letters to render from a UTF-8 encoded text file.
But the Arabic is backwards since it is a RTL langage and it is not in the cursive form (See Unicode Doc: http://www.unicode.org/versions/Unicode ... pdf#G20596 for reversing and cursive rules for Arabic)

I have solved the RTL issue by typing the characters in reverse.
Is there a way to get IM to do the reversal?
Can IM render Arabic in cursive?
Can some one tell me their trick?
If IM does not, does anyone know software that will?

Thanks, dan aka ringydingydo
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Rendering Arabic fonts in IM

Post by fmw42 »

IM can reverse the input images using -reverse. see http://www.imagemagick.org/Usage/basics/#reverse

Is the font cursive? Can you verify that. If it is not cursive, then you need to find one that is cursive. I am not an expert on fonts. Hopefully Anthony or Magick can help.

Anthony has some scripts that let you review each character. See show_fonts, graphics_utf
at http://www.imagemagick.org/Usage/scripts/
ringydingydo

Re: Rendering Arabic fonts in IM

Post by ringydingydo »

Thanks fmw42, the reverse would probably fix the ordering of the text. The cursive issue is more difficult. If you look at Arabic Unicode or Arabic language in wikipedia you can see that the 'joining' of the Arabic letters is left up to the text renderer and is based on several joining rules.

Each Arabic letter in real life has 3 or 4 variations depending on how it is joined to other characters. When typed into a file the normative unicode value is placed in the file. When the renderer reads the file it is supposed to:
1. Reverse the Arabic unicode characters in memory
2. Apply the Arabic rules defined in the Unicode standard and decide what other unicode glyph to substitute in the image to achieve the proper joining or 'cursive' form.

All (Notepad and MS Word) render the correct glyphs and the files stored the normative unicode values. If there was some tool that took normative values, figured out the correct glyph (and wrote those unicode values to file then IM could render it. Or if IM implemented the Unicode rules for joining Arabic, all would be fine.

Any thoughts?
Dan
Post Reply