InDesign & Illustrator: contextual alternates at the end of a line

Primary tabs

4 posts / 0 new
Last post
Adam Twardoch's picture
Offline
Joined: 3 Dec 2002 - 7:36pm
InDesign & Illustrator: contextual alternates at the end of a line
0

Guys,

I just ran into a problem in InDesign and Illustrator. In short: at the end of the line InDesign and Illustrator imply a space glyph. That's pretty annoying.

So I had this portion of code:

@WORDSEPA = [space period comma];
@ALLTEXT = [...all glyphs including space...];

feature calt {
lookup calt.linefina {
ignore sub @linefina0' @ALLTEXT;
sub @linefina0' by @linefina1;
} calt.linefina;

lookup calt.wordfina {
sub @wordfina0' @WORDSEPA by @wordfina1;
} calt.wordfina;
} calt;

which worked fine in TextEdit or Word 2010. At the end of a word, the @wordfina0 class was substituted by the @wordfina1 class, while at the end of a line, the @linefina0 class was substituted by the @linefina1 class. But in InDesign, the second lookup (calt.wordfina) kicked in, not the first.

So I discovered that InDesign and Illustrator (CS4 and CS5) imply a space glyph at the end of every line (including the last line in a text frame).

I developed a workaround that looks like the following:

@WORDSEPA = [space period comma];
@ALLTEXT = [...all glyphs not including space...];

feature calt {
lookup calt.linefina {
ignore sub @linefina0' @ALLTEXT;
ignore sub @linefina0' space @ALLTEXT;
sub @linefina0' by @linefina1;
} calt.linefina;

lookup calt.wordfina {
sub @wordfina0' @WORDSEPA by @wordfina1;
} calt.wordfina;
} calt;

This now works in TextEdit and Word 2010 (where the first ignore sub rule kicks in), as well as in InDesign and Illustrator (where the second ignore sub rule is used). Of course, a side-effect of this is that typing two spaces will make the calt.linefina lookup kick in instead of the calt.wordfina lookup, but I think it's an acceptable price to pay.

However, I believe this is a bug in InDesign and Illustrator (I've informed Adobe about this).

Best,
Adam

Miguel Sousa's picture
Offline
Joined: 18 May 2003 - 8:30pm
0

Is this related with this other post?
http://typophile.com/node/74468

Theunis de Jong's picture
Offline
Joined: 22 Apr 2008 - 5:06pm
0

Miguel, if you apply underlining to an entire paragraph, the "final" space at the end of each line also gets underlined ... Much to the dismay of fans of underlining.

I'm not sure if that has been true for all versions of InDesign.

Chris Lozos's picture
Offline
Joined: 25 Feb 2004 - 11:00am
0

Thanks, Wielce Szanowny Panie Adamie