Right to left text

Hi,


I have a couple of questions regarding right to left aligned text:

The documentation for right to left text says “Please note that currently only normal fonts such as “Times New Roman” are supported. Specific fonts such as “Traditional Arabic” are not supported.”. Which fonts are “normal fonts”? I’ve tried using Adobe Arabic but get a NullReferenceException when I set the IsUnicode property to true, is this because Adobe Arabic is a “specific font”?

I’ve also found that when paragraphs are set to RightToLeft, they totally ignore margins that I’ve set- see the attached images. In the English image, there is a margin between the top block of text and the black border, this seems to be ignored. Similarly, the two lines at the bottom also ignore the margins I’ve set. Is this meant to happen?

Hi James,

Thank you for the details.

Please share your template file with us so we can test your issue at our end to figure out the issue.
Sorry for the inconvenience,

Hi Nausherwan,


My template file is attached. I’ve managed to work around the margins for now so these aren’t so much an issue, but I’d be interested to know if I’m doing something wrong.

I’m still having a problem with fonts however. Arial works fine yet Adobe Arabic (which our client has requested) doesn’t work when I set the IsUnicode property to true. Please could you define what a “normal” font is?

Thank you

Hi,


I’m also having issues with combining LTR text segments with RTL text segments in the same paragraph. I have three segments-

seg0.Content = “أسبوز هو بائع عنصر ال”;
seg1.Content = “.NET not arabic”;
seg2.Content = “البارز”;

The Arabic segments are RTL and the English LTR. However, the output I’m getting is البارز arabic not .NET أسبوز هو بائع عنصر. It seems that the whole text paragraph is being aligned right-to-left rather than the individual segments?

Also, any update on which fonts can be used with RTL segments?

Hi,


Do you have an update on this? I need to let my client know whether RTL text will be possible or not.

James

Hi James,

Please accept our apologies for a delay in response.

jcoxhead:
I’m also having issues with combining LTR text segments with RTL text segments in the same paragraph.

I am able to reproduce your mentioned issue after an initial test. Your issue has been registered in our issue tracking system with issue id: PDFNEWNET-34438. You will be notified via this forum thread regarding any updates against the reported issue.

jcoxhead:
Please could you define what a “normal” font is.

Well, normal fonts are 14 PDF core fonts supported by Adobe Reader. Please see the following link with details: Font Handling.

jcoxhead:
I’m still having a problem with fonts however, Arial works fine yet Adobe Arabic (which our client has requested) doesn’t work when I set the IsUnicode property to true.

Please share “Adobe Arabic” font with us for testing as I am unable to find this font for testing.

Sorry for the inconvenience,

Hi Nausherwan,


Thank you for your reply. Please see the attached file for the Adobe Arabic font

Regards

Hi James,

Thank you for sharing the font files.

I have tested the issue and I am able to notice that Adobe Arabic does not work and I have registered an issue in our issue tracking system with issue id: PDFNEWNET-34445. However, I am unable to reproduce the issue as per your comment “I’ve tried using Adobe Arabic but get a NullReferenceException when I set the IsUnicode property to true”.

Please share your sample code which can be used to generate the exception so we can test it further.

Sorry for the inconvenience.

Hi Nausherwan,


Please see the code sample attached. The exception is being thrown on line 60.

Thank you


Hi James,

Thank you for sharing the sample code.

I am able to reproduce your mentioned issue after an initial test. Your issue has been registered in our issue tracking system with issue id: PDFNEWNET-34450. You will be notified via this forum thread regarding any updates against your issue.

Sorry for the inconvenience.

The issues you have found earlier (filed as PDFNEWNET-34450) have been fixed in Aspose.Pdf for .NET 7.9.0.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Hi James,

Thanks for your patience.

In order to resolve the issue PDFNEWNET-34445 reported earlier, please try using the following code snippet.

[C#]

string outFile = "c:/pdftest/ArabicFont_Test.pdf";

Document doc = new Document();
Page page = doc.Pages.Add();

// Create a text object and pass the string object carrying Arabic text in it
TextFragment text1 = new TextFragment();

// Create a segment and add it to segments collection of text object
TextSegment seg0 = new TextSegment("أسبوز هو بائع عنصر ال");

text1.Segments.Add(seg0);

// I can't find this font for free
// seg0.TextState.Font = FontRepository.OpenFont("AdobeArabic-Regular");

// Set font size
seg0.TextState.FontSize = 14;

page.Paragraphs.Add(text1);

doc.Save(outFile);

The issues you have found earlier (filed as PDFNET-34438) have been fixed in Aspose.PDF for .NET 25.10.