Welcome to NeoOffice developer notes and announcements
NeoOffice
Developer notes and announcements
 
 

This website is an archive and is no longer active
NeoOffice announcements have moved to the NeoOffice News website


Support
· Forums
· NeoOffice Support
· NeoWiki


Announcements
· Twitter @NeoOffice


Downloads
· Download NeoOffice


  
NeoOffice :: View topic - Turning on invisible chars pushes Arabic text beyond margin
Turning on invisible chars pushes Arabic text beyond margin
 
   NeoOffice Forum Index -> NeoOffice Beta Releases
View previous topic :: View next topic  
Author Message
sardisson
Town Crier
Town Crier


Joined: Feb 01, 2004
Posts: 4588

PostPosted: 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
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Thu Jan 14, 2010 3:08 pm    Post subject:

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.

Patrick
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Fri Jan 15, 2010 10:51 am    Post subject:

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.

I hope that makes sense.

Patrick
Back to top
sardisson
Town Crier
Town Crier


Joined: Feb 01, 2004
Posts: 4588

PostPosted: Fri Jan 15, 2010 11:46 am    Post subject:

pluby wrote:
I hope that makes sense.

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 Smile

Smokey

_________________
"[...] whether the duck drinks hot chocolate or coffee is irrelevant." -- ovvldc and sardisson in the NeoWiki
Back to top
Display posts from previous:   
   NeoOffice Forum Index -> NeoOffice Beta Releases All times are GMT - 7 Hours
Page 1 of 1

 
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

Powered by phpBB © 2001, 2005 phpBB Group

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © Planamesa Inc.
NeoOffice is a registered trademark of Planamesa Inc. and may not be used without permission.
PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.