I'll add that option for the next release. When I've it ready I'll send it to you first for testing.
Best Regards,
Paulo Soares
-----Original Message-----
From: Ayman Zarroug [SMTP:[EMAIL PROTECTED]
Sent: Tuesday, December 23, 2003 8:39
To: Paulo Soares; [EMAIL PROTECTED]
Subject: Re: [iText-questions] Problems in Arabic Diactrics (tashkeel)
Yes, you were right. When using the font arialuni.ttf, the arabic letters
and diacritics are all displayed correctly. I guess I was mistaken in
believing diacritics are not being handled. Thank you for that.
There is another issue though. We are using JasperReports to generate PDF
documents and require that numbers be displayed in arabic as well, using
hindu digits (\u0660 - \u0669). Currently, a change was made in
JasperReports that detects english numbers (arabic digits in the range
\u0030 - \u0039) and substitute the hindu equivalent. However, it would be
preferable if this were handled within iText (is this already happening?),
possibly by setting a new parameter, similar to "runDirection", that
determines whether numbers are displayed using either context, hindu or
arabic digits.
Any thoughts with regards this issue??
hope you have a merry christmas.
Ayman
----- Original Message -----
From: "Paulo Soares" <[EMAIL PROTECTED]>
To: "Ayman Zarroug" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Sunday, December 21, 2003 12:49 PM
Subject: Re: [iText-questions] Problems in Arabic Diactrics (tashkeel)
> The problem is really the font that should have an advance 0 for the
> diacriticals as the Unicode documentation requires. If you use the font
> arialuni.ttf the result will be correct.
> The fix is to set in the font the char advance of those chars to 0. This
> requires the version at itextpdf.sf.net.
> For all the chars in the range: \u064b-\u0658,\u0670, \u06d6-\u06dc,
> \u06df-\u06e4, \u06e7-\u06e8, \u06ea-\u06ed do:
>
> BaseFont.setCharAdvance(char, 0);
>
> The result will be correct
>
> Best Regards,
> Paulo Soares
>
> ----- Original Message -----
> From: "Ayman Zarroug" <[EMAIL PROTECTED]>
> To: "Paulo Soares" <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Sunday, December 21, 2003 9:14
> Subject: Re: [iText-questions] Problems in Arabic Diactrics (tashkeel)
>
>
> RE: [iText-questions] Problems in Arabic Diactrics (tashkeel)Thanks for
all
> your feedback with regards to this issue.
>
> Please find attached to this email two .pdf files:
> 1. correct_display.pdf (this pdf is generated by converting a word
> document. diacritics are correctly displayed in this file.)
> 2. itext_display.pdf (this pdf is generated by using iText Other
> fonts display similar results.)
>
> Please note that using Times, Courier, Arial and Ms Sans Serif fonts with
> iText will all generate similar results.
>
> Thanks for your time,
> Ayman
>
>
> ----- Original Message -----
> From: Paulo Soares
> To: Ayman Zarroug ; [EMAIL PROTECTED]
> Sent: Thursday, December 18, 2003 5:50 PM
> Subject: RE: [iText-questions] Problems in Arabic Diactrics (tashkeel)
>
>
> The diacritics are being taken care of. What I found out was that some
> fonts, notably times and arial from win xp, treat them as spacing chars
when
> they sould be non spacing. Quite curiosely, arial unicode works as
expected.
>
> It might be better for you to give me an unicode arabic sequence and the
> expected output result.
>
> Best Regards,
>
> Paulo Soares
>
> -----Original Message-----
>
> From: Ayman Zarroug [SMTP:[EMAIL PROTECTED]
>
> Sent: Wednesday, December 17, 2003 12:35
>
> To: Paulo Soares; [EMAIL PROTECTED]
>
> Subject: Re: [iText-questions] Problems in Arabic Diactrics
> (tashkeel)
>
> The method
"ColumnText.setArabicOptions(ColumnText.AR_COMPOSEDTASHKEEL)"
> is being called, but it doesn't resolve the problem.
>
>
>
> Just to clarify the problem, words in arabic may have diacritics
> (tashkeel), which are symbols that appear either above or below a letter.
> The diacrics should not affect the way in which 2 letters are joined.
> Currently, iText treats diactrics as a normal character that affects the
way
> letters are joined.
>
>
>
> The method "ArabicLigaturizer.ligature(nextletter, curchar)" checks
the
> current character with the next character in order to determine the join
> type. The method correctly determines when a word with diacritics is
being
> processed and returns a value of 1 to distinguish this case.
>
>
>
> In the method "ArabicLigaturizer.shape(char text[], StringBuffer
string,
> int level)" there is a sequence of if-then-else blocks that shape the
> characters based on the join type (determined by ligature method).
However,
> the case for join type 1 (diactric join) is not implemented.
>
>
>
> I think the correct behaviour for the diactric join would be:
> 1. Determine the join type based on the current character and the
> character following the diacritic.
> 2. Draw the diactric either above or below the character preceding the
> diactric (depending on which diactric).
>
>
>
> Ayman
>
> ----- Original Message -----
>
> From: Paulo Soares <mailto:[EMAIL PROTECTED]>
>
> To: Ayman Zarroug <mailto:[EMAIL PROTECTED]> ;
> [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>
>
> Sent: Tuesday, December 16, 2003 8:50 PM
>
> Subject: RE: [iText-questions] Problems in Arabic Diactrics
(tashkeel)
>
>
>
> You may try:
>
> ColumnText.setArabicOptions(ColumnText.AR_COMPOSEDTASHKEEL);
>
> If that's not satisfactory as an arabic speaker you'll be able to
give
> pointers to correct it. I can produce code but I don't know a word of
> arabic.
>
> Best Regards,
>
> Paulo Soares
>
> -----Original Message-----
>
> From: [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>
> [SMTP:[EMAIL PROTECTED] On Behalf Of Ayman
> Zarroug
>
> Sent: Tuesday, December 16, 2003 14:54
>
> To: [EMAIL PROTECTED]
>
> Subject: [iText-questions] Problems in Arabic Diactrics
> (tashkeel)
>
> So glad that arabic is now supported in iText, as this finally
allows
> us to generate PDF reports using iReport and JasperReports (though it was
> necessary to make some modifications in both iReport and JasperReports to
> get this running).
>
>
>
> The good news is that it generally works. The bad news is that
arabic
> text with diacritics are not properly displayed in PDFs. This can be seen
> by running the sample "hebrew-arabic" code provided by Paulo Soares at
> arabic_hebrew.java in itextpdf.sf.net.
>
>
>
> Tried the new release itext-paulo-127, but that doesn't seem to fix
> the problem.
>
>
>
> Looking through iText code leads me to believe that functionality to
> handle this case is not implemented.
>
>
>
> Are there any plans to solve this problem in the near future???
>
>
>
> ayman
>
>
>
>
>
>
>
>