Nonbreaking Hyphen mixed with breaking spaces in ADOR

325 views
Skip to first unread message

thomaus

unread,
Dec 8, 2011, 5:57:01 PM12/8/11
to xmpie...@googlegroups.com
We have a bunch of company names going into a headline. 
Some of the company names have dashes in the name (like Co-operative). 
We don't want these words to break.
I have hyphenation off for the paragraph, but InDesign figures that a hyphen is a good spot for a break so the paragraph can break like this:

Co-
operative

If I turn on No Break for the ADOR in InDesign, spaces also won't break, and some company names don't fit the space (even with 50% shrinkage).
If I turn on the Dynamic Text Properties option called “Discretionary Hyphenation.” the same thing happens and both hyphens and spaces don't break and it doesn't fit.

I thought I could possibly find and replace the dashes with nonbreaking hyphen using Qlingo mixed with tagged text. But the nonbreaking hyphen doesn't want to play along.
According to an Adobe document on tagged text, it is supposed to be <0x2011>. To test, I stuck it in a tagged text document and when importing, I got:
<Line No>:- 4 <Error>:- Importing invalid tag "<0x2011>" as text. Copying and pasting the character makes it disappear inside uPlan.

Any ideas on how to let spaces break, but dashes not break?

couch

unread,
Dec 8, 2011, 7:13:15 PM12/8/11
to XMPie Interest Group
This expression seems to work correctly for me:

FindAndReplace(|->[company], HexToUnicode("002d"),
HexToUnicode("2011"))

thomaus

unread,
Dec 9, 2011, 10:58:38 AM12/9/11
to xmpie...@googlegroups.com
That looks like a new function. Our uPlan is 4.6.
Is that a function that I could load manually?

(We're at least a month away from upgrading.)

Bill

unread,
Dec 9, 2011, 11:02:02 AM12/9/11
to XMPie Interest Group
HexToUnicode was introduced with PersonalEffect 5.0.
Current is 5.3.1.
Perhaps you might consider designing a small JavaScript custom
function, while waiting for your next upgrade?

thomaus

unread,
Dec 9, 2011, 7:24:56 PM12/9/11
to xmpie...@googlegroups.com
In my non-knowledge of Javascript I went to Google to see if someone had done this before. Pasting in code didn't work... So then I got help from someone who knew what he was doing. 
Using the programming calculator, we converted '2011' in Hex to a decimal 8209. (That's the only character we care about.) Which made it easy to copy one line from the complicated code to do a very simple job - produce a nonbreaking hyphen.

FindAndReplace(|->[company], "-",NonBreakingHyphen())

Function: NonBreakingHyphen () {
return String.fromCharCode(8209);
}

This worked. 

Thanks for pointing in the right direction.


Reply all
Reply to author
Forward
0 new messages