https://bugs.documentfoundation.org/show_bug.cgi?id=155707
--- Comment #16 from László Németh <nem...@numbertext.org> --- (In reply to Hossein from comment #14) > Thanks László for putting time into fixing this issue! Thanks for reporting the problem! I've seen it before, that your recent comment helped a lot to re-check and solve it! > > For the sub-issues you have listed: > > 1. DOCX export/import interoperability: I haven't tested export yet, but > import looks fine. As the code implies, exact value of 133, 200 and 300 is > compared for deciding in the export, like > rAdjust.GetPropWordSpacingMaximum() == 133. Do you think some fuzzy > comparison can be used instead? We need to test MS Word with fonts with different length U+0640 ARABIC TATWEEL to analyze the algorithm: absolute width, or relative width to the space or to the U+0640. It's an interesting question, because DTP/recent Writer uses word spacing relative to space character, but XSL/CSS standards prefer absolute width for word spacing (allowing maybe relative, too). The value 133% came from DTP default (as the upper limit for normal space), 200 and 300 from 2, 3 spaces (hoping that space and kashida characters are equal long, and using Khaled's hint and a quick visual comparison of the result). > > 2. DOCX layout interoperability: Layout looks fine for Arabic/Persian text > (page 2 of the attachment), but as you may see on page 1 of the attachment, > there is some difference between the rendering of Latin text in Word and > LibreOffice. At least in justified medium/high, paragraph does not fill the > whole area in Word. But in LibreOffice it does, after your new patch. > > This is some web page that discusses justified medium/high in Word: > https://addbalance.com/usersguide/justification.htm > Please look into this example: > https://addbalance.com/usersguide/images/justif2.gif > > The author of the above page says: > "I do not pretend to know the rationale for Justify Medium and Justify High. > Neither seems to be truly justified but give something closer to > justification with a ragged right edge." > > The above picture clarifies the correctness of what can be seen in > attachment 187768 [details] (page 1), the fact that paragraph text does not > fill the whole area. Do you have any idea why this happens? I guess, this is a feature developed only for Arabic/Persian, because the standard mentions only this for lowKashida/mediumKashisa/highKashida. > > Other than that, as you have mentioned, I will file a bug report around > matching the kashida and spacing between LibreOffice and Word. Thanks in advance! > > 3. user interface/functionality: I see some differences in the rendering > results of LibreOffice and Word. Do you think it is possible to achieve > somehow similar results in LibreOffice by modifying spacing values? If we need only the same page breaks, i.e. same length paragraphs, likely it's enough to analyze the algorithm, and set the spacing values (also grab-bagging, extending the OOXML kashida setting, if needed, i.e. when the MS Word kashida justification algorithm uses not space-relative word spacing). For the same paragraph layout, it seems, it must modify the ratio(?) of the kashida and word spacing. I haven't touched the kashida code, because drawing kashida is fully automatic now, i.e. my patch set only earlier line breaks, resulting bigger word spacing, nothing more. Longer spaces and kashidas are calculated automatically based on the position of the line break. MS Word uses the same narrow word spacing with the longer kashidas, but I'm not sure, what it's the best for the Arabic/Persian calligraphy. MS Word is not a desktop publishing tool, so it's worth to fix its approach, if needed. > > 4. user interface/functionality limited for interoperability: I agree that > we need some similar UI options. It should be both in the dialog and also > toolbars. There is a separate option (distributed) for CJK in Word, which > will is visible only when CJK is enabled, as it is only relevant for CJK. > This also discussed in the above link. I think that is filed under > tdf#154881: > > Bug 154881: I would like to have a thai distributed feature for handling > Thai text > https://bugs.documentfoundation.org/show_bug.cgi?id=154881 Jonathan's screenshot show Thai distributed justification, so maybe it's enough to fix the missing import. > > 5. Character formatting/single word usage: I should add what Khaled > mentioned in comment 7. Nastaliq family of fonts, use custom use of kashida, > which means different glyphs/ligatures in case of needing extended size. > Then, the output can be different. I need to test these cases. This is an > example Nastaliq font: > https://cdn.irannastaliq.ir/2022/05/IranNastaliq-V2.zip Thanks for testing in advance! -- You are receiving this mail because: You are the assignee for the bug.