Created attachment 90472 [details] A doc with the text that caused the bug. I have written بسم الله الرحمن الرحيم which is an Arabic text and set the font to Aldhabi which is a MS font that comes with Windows. Everything is OK until I pressed Ctrl+F10 to show non-printing characters and the text is completely messed up. Attached is a sample document for testing. Press Ctrl-F10 and check what happens!
I now found if I change the font to Scheherazade e.g, strange dashes appear between words.
hi munzir can you put screenshot for the problem? thx
(In reply to comment #1) > I now found if I change the font to Scheherazade e.g, strange dashes appear > between words. this bug already reported see Bug 64559
The problem is that Writer code assume that the text string with and without the visible space (the dot) are otherwise identical and tries to draw the text string with spaces replaced with the dot, but using the glyph positions of the original string (and the idea here, I think, is that even if there is small difference in the width of the space and the dot, the text does not reflow with non-printing characters shown). This generally works, but it breaks badly with this font because here: بسم الله الرحمن الرحيم is a single glyph (a ligature of the whole sentence), while: بسم·الله·الرحمن·الرحيم is 25 glyphs, and they all are drawn overprinting each other since they are treated as if they were a single glyph. The relevant code is in sw/source/core/txtnode/fntcache.cxx, around line 1457 pKernArray is obtained (note the rInf.GetText(), this is the original text string), then at line 1572 spaces are replaced with bullets, then at line 1798 the text is drawn using the modified text string and the *original* kern array. I’m not sure how to fix this, but I guess we will need to check the original text string *eats* the spaces when rendered and avoid drawing anything for those spaces.
Here is a hack that fixes the issue for me https://gerrit.libreoffice.org/6995.
Khaled Hosny committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=02ce734450559c9353ca7f42b2519239220dd265 fdo#72488: Broken text when showing visible space The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Excellent job Khalid, thanks a lot.
Khaled Hosny committed a patch related to this issue. It has been pushed to "libreoffice-4-1": http://cgit.freedesktop.org/libreoffice/core/commit/?id=b79b4b88c5eb6b0fe4092b5eb98f3088f316f7b2&h=libreoffice-4-1 fdo#72488: Broken text when showing visible space It will be available in LibreOffice 4.1.5. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Khaled Hosny committed a patch related to this issue. It has been pushed to "libreoffice-4-2": http://cgit.freedesktop.org/libreoffice/core/commit/?id=8351eb25302a28c70ef5b2aaa1189db949dcf443&h=libreoffice-4-2 fdo#72488: Broken text when showing visible space It will be available in LibreOffice 4.2. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.