Posted: Thu Jan 14, 2010 2:24 pm Post subject: Turning on invisible chars pushes Arabic text beyond margin
This problem seems to occur in 2.2.6 (10.3.9/PPC and 10.5.8/Intel) and 3.0.2 (10.5.8/Intel), with and without recent test patches.
1) Open عربي غريب.sxw
2) Turn on Nonprinting Characters form the View menu
3) Observe the rightmost character (ق) shift to be beyond the grey line of the right margin
This doesn't happen with all Arabic documents or Arabic fonts; this document requires the Al-Bayan font, which ships with Mac OS X (but which may be part of an optional "fonts for more languages" package that you may not have installed if you customized your OS install, e.g. "Additional Fonts" on 10.4: http://support.apple.com/kb/HT1538).
Edit: I meant to add, this is a rather minor bug, and one that's apparently been around for a while, so it really doesn't need priority care or to hold up anything; I just noticed it when testing and reported it for sake of completeness.
Smokey _________________ "[...] whether the duck drinks hot chocolate or coffee is irrelevant." -- ovvldc and sardisson in the NeoWiki
I will take a look at this. I already found the cause for this crashing bug and since I will need to modify code in the same file for this bug, I will fix this bug as well before I post a test patch. Hopefully I will have a test patch available later today or tonight California time.
I now know what is causing this behavior and I have bad news: this is actually expected behavior.
What is happening is that in the case of the Al-Bayan font, the glyph for the space character (Unicode U0020) is much narrower than glyph for the dot character (Unicode U00B7). NeoOffice's underlying OpenOffice.org code calculates the full-width justification positions of glyphs based on the width of a space glyph so when you enable display of nonprinting characters, the OpenOffice.org code finds that the length of the unjustified line is now wider due to the wider dot glyphs that have replaced the space glyphs and the new width is wider than the total margin width.
At this point, to preserve the same line break, the OpenOffice.org has only two choices:
1. Ignore the excess width of the unjustified glyphs by overlapping each glyph slightly over the next glyph
2. Let the excess width spill off the right margin edge
The OpenOffice.org code uses option 2. In theory, they probably could use option 1. However, I was able to put some test code that causes NeoOffice to emulate option 1 and in your sample document that causes the dot glyphs to collide with the other glyphs. So, it appears that the OpenOffice.org code has chosen option 2 to play it safe by ensuring that the text is readable instead of perfectly positioned when displaying nonprinting characters.
It does (and also explains why I only see it with Al-Bayan, though presumably the same glyph-width mismatch could exist in other fonts). Thanks for investigating
Smokey _________________ "[...] whether the duck drinks hot chocolate or coffee is irrelevant." -- ovvldc and sardisson in the NeoWiki
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum