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 - non-breaking hyphens
non-breaking hyphens
 
   NeoOffice Forum Index -> NeoOffice Releases
View previous topic :: View next topic  
Author Message
dbachmann
Blue Pill


Joined: May 26, 2009
Posts: 2

PostPosted: Tue May 26, 2009 4:56 am    Post subject: non-breaking hyphens

I do not know whether this is a Neooffice issue or a problem of Openoffice more generally. Perhaps somebody will be able to shed light on this.

Here is the problem: Neooffice renders the non-breaking hyphen character (U+2011) with the font's hyphen-minus glyph (U+002D) even if the font does have a separate U+2011 glyph. This is apparenty a widespread "feature", c.f. http://forums.adobe.com/thread/29480

This means that the following will be rendered identically

a-b-c (hyphen-minus)
a‑b‑c (non-breaking hyphen)

This wouldn't be a problem as such. However, if the hyphenated text is italicized, Neooffice for no apparent reason inserts a small space between the hyphen glyph and the following character if the hyphen is non-breaking, but not otherwise. That is, the two strings

a-b-c (hyphen-minus)
a‑b‑c (non-breaking hyphen)

will cease to look identical, the second being spaced more widely.
Since the font glyph used is identical, it is impossible to compensate for this weird behavior by fiddling with glyph width in the italic font, and there seems to be literally no way around this problem.

For my purposes this is rather devastating, and I am currently looking at very tedious workarounds. Comments on (a) whether you can reproduce the problem and (b) whether it is Neooffice-specific or an Openoffice issue would be appreciated.
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Tue May 26, 2009 9:38 am    Post subject: Re: non-breaking hyphens

dbachmann wrote:
Here is the problem: Neooffice renders the non-breaking hyphen character (U+2011) with the font's hyphen-minus glyph (U+002D) even if the font does have a separate U+2011 glyph. This is apparenty a widespread "feature", c.f. http://forums.adobe.com/thread/29480


I put some debug statements in the NeoOffice code and I can confirm that NeoOffice's underlying code is always using the U+002D character for non-breaking hyphens.

dbachmann wrote:
....Since the font glyph used is identical, it is impossible to compensate for this weird behavior by fiddling with glyph width in the italic font, and there seems to be literally no way around this problem.


I can confirm that this same behavior occurs in OpenOffice.org 3.0.1 so I
put some debug statements in the NeoOffice code that print out the glyph widths to verify that the regular and italic glyphs are the same width. At least for Times New Roman, Mac OS X's text layout functions are returning the exact same width for both the regular and the italic glyphs.

Based on the above, the bad news is that it appears that when you have the Italic toolbar button selected, NeoOffice's underlying OpenOffice.org code is adding a little extra spacing onto the end of the glyph so this is definitely an OpenOffice.org bug.

Although not ideal, I found a workaround to avoid OpenOffice.org's extra spacing bug: highlight the italic non-breaking hyphen character and make it not italic by unclicking the Italic toolbar button.

Another workaround is to highlight all italic sections of your document, unclick the Italic toolbar button, and set the font to the italic variant of the current font. This results in the same italic font that you had before, but since you are not using the Italic toolbar button, the OpenOffice.org bug is not triggered.

Hope that helps,

Patrick
Back to top
Lorinda
Captain Mifune


Joined: Jun 20, 2006
Posts: 2051
Location: Midwest, USA

PostPosted: Tue May 26, 2009 1:40 pm    Post subject: Re: non-breaking hyphens

pluby wrote:

Another workaround is to highlight all italic sections of your document, unclick the Italic toolbar button, and set the font to the italic variant of the current font. This results in the same italic font that you had before, but since you are not using the Italic toolbar button, the OpenOffice.org bug is not triggered.

Patrick


Instead of doing this manually, I think you could use the search and replace function to replace all instances of-e.g. Font: Times New Roman, Typeface: Italic to Times New Roman Italic.

Lorinda
Back to top
Jim
Councilperson


Joined: Jun 21, 2003
Posts: 173
Location: Selmer, Tennessee

PostPosted: Wed May 27, 2009 6:39 am    Post subject: Workaround

Another workaround:
Type simply a-b-c and nevermind the non-breaking version. Select the "a-b-c", and choose Insert->Object->Formula.
See the attached file for an illustration.

In my first run, there was too much space left and right between the formula and text. Select the formula (the frame handles will illuminate) and adjust the left/right spacing to zero for smooth text flow.

You can automate the formula entry by using Tools->Customize, and select the keyboard tab. I chose command-F as my hot key. Choose "Insert" in the left pane. But there are two "Formula" entries in the right pane from which to choose. The first is already assigned to F2. You want the second one, which inserts the frame and formula.

After making this hotkey, just select your a-b-c and hit command-F. (But you'll have space between the formula frame and your text unless you select the frame, right-click, choose "object", and adjust the left-right spacing. If I had to do a lot of this, I'd record a macro for it and assign that to the hot key.)

_________________
Jim Plante
MacOS X 10.6.34, MacBook 2GHz C2Duo, 2gb, Neo 3.1.1 p 1
Back to top
dbachmann
Blue Pill


Joined: May 26, 2009
Posts: 2

PostPosted: Thu May 28, 2009 2:45 am    Post subject:

thank you for your prompt reaction.
I may submit a bug report to OOo, but of course I cannot wait for a potential bugfix to reach neooffice.

The workaround of using non-italic hyphens did suggest itself to me, but of course an italic hyphen will look slightly different from a non-italic one.
The idea of choosing the italic font directly via search-replace sounds like a viable approach.

thanks again for your help.
Back to top
Display posts from previous:   
   NeoOffice Forum Index -> NeoOffice Releases All times are GMT - 7 Hours
Page 1 of 1

 
You cannot post new topics in this forum
You cannot 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.