12 Ağustos 2013 Pazartesi

Converting Arabic Multiline Text to Image [C#]

E-ink devices are being developed for better reading performance but they lack many software incapabilities. One of these incapabilities is showing arabic text properly. You sometimes need to convert Arabic text to image with your favorite font instead of leaving text rendering to the device.

In one of my projects, I implemented an algorithm to convert Arabic text to image. Here, I provide a standalone C# application (with source code) for the conversion. You can either convert the text after one paste operation or you can convert all Arabic span elements inside a HTML file. In the latter case, you need to specify those spans with "arabic" class. I don't want to work on a more clever way. You can develop according to your needs.

Some distinctive features are:
This text to image converter supports multiline and word wrap feature.
You don't need to define image height, it is calculated automatically.
Unnecessary right and left margins are also cropped.

Here are screenshots:

Here is a sample output image:

You can download the project here: