Bidirectional font problem

Hi,


I have problem with font formatting for bidirectional text. For example, I am inserting some text into new document, then I set bold to font and again write some text and unset bold. Then, when I save created file and open it with Word, it seems that the text that I wanted to be bold really looks like it’s bold, but words font settings says it’s not?! I’ve attached used code and created file. Please observe text with number 2 and number 8, it looks like bold, but word’s font settings says it’s not, then text with number 5 looks like it’s italic but word says it’s not, and, in the end, see text after number 31, it should be all underlined but it’s not. Please check this.

Best, Zeljko

Hi Zeljko,

Thanks for your inquiry. I have tested the same scenario and have faced the same MS Word behavior. This is not a bug in Aspose.Words. Aspose.Words writes the bold, italic and underline contents correctly. Please open your output document in Open Office and check the Bold, Italic and Underline settings of Arabic text.

Moreover, Aspose.Words supports all major OOXML versions. You can save the same contents into Docx and check Complex Script Bold (w:bCs) in document.xml. You can see this if you open the internal document.xml inside the DOCX file.

Hope this answers your query. Please let us know if you have any more queries.

Hi Tahir,


thanks, I’ve opened document with Open Office and checked formatting, it’s correct. But, if it is correct in Open Office and it is not correct in MS Word, doesn’t it means that there is font formatting written in a way that does not matches readable formatting for MS Word?!

Kind regards,
Zeljko

Hi Zeljko,

Thanks for your inquiry. Aspose.Words writes the bold and italic complex script correctly. Please follow the steps mentioned below to check the MS Word behavior. In this case, MS Words behavior is correct.

1) Open your document in MS Word (MS Word 2010)
2) Select the bold Arabic text
3) Press Alt + Ctrl + Shift + S to show the style window
4) In your document (newFile.doc), the style is ‘Complex Script Font: Arial, 16 pt, Bold
Based on: Default Paragraph Font’
for number 2.
5) You can also check this font settings in style inspector.

Please check the attached image for detail. Hope this answers your query. Please let us know if you have any more queries.