 Hello, I'm Hossain Uricha, and today I will talk about Arabic Persian text justification and overview. This is the list of contents that I want to talk about today. After a short self-introduction, I will talk about typographic alignment, and then go to the Justified Text, focusing on Arabic and Persian. Then I will talk about different approaches to text justification and then, in the end, problems and fixes are discussed. I'm Hossain Uricha, Persian Information Technology. I am the developer community architect for the Dekemen Foundation, TDF. I am a developer, university lecturer, and FOSS advocate. If you want to get started in LibRafid's development, you can contact me via email hossainatsainlibrafi.org or via IRC, with the name of Hossain, at LibRafid's dev room in LibraChat Network. So, first, typographic alignment. As you know, there are different alignments that are available in typesetting software. Left, which is very common in left-to-right languages, but in right-to-left languages like Persian and Arabic and Ordu, this is not usually something very common, but right alignment is something that is usually used. Center is something with limited applications. So, another one is the Justified Text, so in Western languages, they usually use a space to make lines larger, to fill the space that is designed for them. But in Arabic script, we have a special character or special element that is called Qashida, which is essentially horizontal line. And as you can see, on the top, in Microsoft Word, there are different options to use Justified for the paragraphs. So, you can use Justified for a low, medium, or high, and only in the first one Qashida is used. But in Librafi, we don't have the three others that only use space to justify the paragraph. So, this can cause problems. For example, in Ordu you're using Nastali phones, and in Nastali, the Qashida is something else. It's not a horizontal line. So, we have several tricks to justify the paragraphs in Arabic and Persian, but in typesetting, we can only use the horizontal line. So, if you use Justified for Ordu in Nastali phones, or you're a Nastali, you will see unwanted horizontal lines, and this is a problem. But in Arabic and Persian with other phones, if the Qashida is positioned correctly, everything will be alright. So, let's look at some of the ancient texts, some of the old texts from Quran, which is available in some museums, and you can see the links to the actual website that I have taken these examples. So, the above is from 1st century, and it's quite old, but as you can see, the Justified text is used. So, this one is from 11th century, and it's currently in British Museum, and as you can see, the text is justified, but some parts of the text goes beyond the paragraph and beyond the edges. So, this is something that can be seen in some of the computer phones, and I don't want to get more into details. This one is also from 10th century, Quran. So, as you can see, this is also justified. So, this is not Arabic script, but Kufi script, as you can see, this is something that the writers at the time were using, and this one is from 12th century, which is available in Reza Pasi Museum. So, this is something that is more similar to what we have in computer generated printed media today. So, there are Qashidas there, but there are also other tricks to increase the size of lines. So, essentially, what you see here is justified text, just a paragraph. So, essentially, you should increase the length of each line to fill the space that is designed for the paragraph. So, as you can see, essentially, all the lines have the same length with some exceptions that, for example, the end of some character goes beyond the edges. So, this is something else. And it is usually done in calligraphy. So, in modern typography, things are somehow different. So, if we talk about modern typography, other than computer, before that, we had hot metal type setting, for example, linotype or things like that. So, it is very nice that even without computers, they will using some mechanical tools to achieve justified text. For example, they used special triangles that filled the line and they put pressure on the top and the spacers actually filled the space and made the paragraph justified. But in computer software, things are somehow different. When computer software came into the type setting, the problem of justifying the text and beyond that, breaking the paragraphs into lines became actually an optimization problem. So, in a software, you try to achieve the best line break by trying to optimize some parameters, including the parameters that I have discussed here. For example, the number of characters and the number of words that you see in each line. So, you try to put more text into each line and try to fill the lines and you try to avoid lines with, for example, one, two, three characters inside that. Also, for the languages that use hyphenation, you try to use less hyphens. For example, you can go in and break several words into two parts and put hyphens there. But that is something that is undesirable. So, you're trying to use less hyphens. And then orphans. So, you should avoid small paragraphs and small lines. You should avoid a blank page with only one or two words inside that. So, having all these constraints in mind, you should try to optimize. And it is shown that this is an NP-complete problem. So, there are solutions that are practical and we will discuss later. So, these are the approaches to text justification. So, these are some of the well-known algorithms for text justification. The most famous algorithm that we know is from Camuffin Plus. They provide it in their article and then implement it in the tech type setting system. So, their algorithm actually works on the document as a whole. So, usually it is said that the output from tech is something that is very desirable and very nice to the eyes of the readers. So, they have tried to achieve the optimal solution or near-optimal solution. But in LibRafis and Microsoft Word before 2013, the WordPerfect 6.x compatibility is maintained. So, in LibRafis, the algorithm is working on line-by-line basis. And other than that, I should say that in Word 2013, a new algorithm is introduced that can shrink and as well expand. And it actually broke the compatibility with the WordPerfect 6.x. So, this is not yet implemented in LibRafis. If you want to get more information, I think you should. You can refer to these two issues that discuss the justification algorithm. And there are problems in the current LibRafis approach. So, the problem that optimization is done locally and line-by-line basis is preventing LibRafis to achieve an optimal solution. Also, as I said, this is not compatible with Microsoft Word 2013. So, other than that, if you look closely into the implementation, the code for justification is scattered among different modules, both the VCL and also the writer. So, in this way, it is difficult to debug, fix problems and improve the implementation. So, other than that, if you refer to the issue 104921, which is actually fixed now, the position of Kesheida is not communicated explicitly between VCL and writer. So, this is something that is fixed now by the patches from Hale Tosti. So, let's look at some of the problems and the fixes. So, one of the main problems with Kesheida in Arabic in LibRafis was that in certain situations, the Kesheida was not inserted correctly. So, this horizontal line, when placed incorrectly, can cause gaps and bad overlaps. So, as you can see, the characters here should be joined together, but because the horizontal line is placed incorrectly in the wrong position, the output is not okay. And this actually caused a lot of problems for the people who use Arabic version or do another Arabic script languages. The gaps or the bad black lines was not there in OpenOffice, but at some point this problem happened in OpenOffice. So, this was a regression and after that, it was fixed once, but then in LibRafis 5.3, a big change came and half-wise is used after that version as the underlying text rendering engine. So, the justified problem came back and it was there for around 10 years, but now it is actually fixed by Khaled Hosni and I thank him for doing this great job. So, this problem was one of the frequently asked problems that people from Persian and Arabic and Arabic script languages community asked to fix. So, this is fixed now and the fix will be available in the next measure version, which is LibRafis 7.5. So, I try to avoid this problem in the future and to do that, to make sure that this won't happen again, I have added a test for that and essentially in that test, I check the exact position of characters, including the normal characters and also the acrylics. So, the idea behind this test is that certain characters should join, but not too much. So, for example, if those characters are joined, for example, with 20% overlap, this is not acceptable. For example, 10% or something like that is accepted. So, in order to make sure that the test actually goes fine on different platforms, the actual font that is used is something constant. This helps us make sure that the test goes fine on different platforms, but I think we need more tests to make sure that the problem with justified text doesn't happen again. So, there are remaining problems and one of them is a glitch that happens only on certain zoom levels, like 100%, which is only reproducible on Windows in certain conditions. This is filed in TDFBagzilla and we need to test more to make sure that this happens, to understand when this happens and try to fix that. Another problem is with mixing RTL and RTL text, which is probably caused by bad footnotes. So, as you can see, the RTL text are mixed and they are entangled, so this is not okay. Also, there are problems with character joining. As you can see, there are small gaps in the text and this is actually visible in certain zoom levels, like 100%, but the text is much smaller than you can see here and I've zoomed in to show the problem. Another problem that I should mention is that by not having justified paragraphs that are justified only in the space, justified low, high, medium, we have problems with or do another nestalic form to text, so this is another problem that we have. So, in the end, I should thank, very specially, for the kind developer who fixed all these problems and he's haletosti. So, thank you for making users happy and making their life easier. Thank you very much. So, time for questions. You can ask questions and I will be happy to be able to answer your questions. Thank you very much.