Contextually change LSB

How do I write feature code to contextually add to the LSB [for RightToLeft - it’s like RSB for LTR]?

I tried this:
pos bet' 500 spaceArrow1;
but it doesn’t work…

Thanks in advance!!!

You have to use something like <500 0 500 0> instead of a single number. The first two numbers are moving x+y, the second two numbers advance width x+y.

1 Like

Why do you like to do it manually instead of using regular kerning?

I added a mark to a base character in a certain context (by stylistic set), now I also want that the base glyph should have more width.

Hope you understood.

By the way, I can’t get it to work, even with this:
pos bet' <200 0 200 0> spaceArrow1;

Does it work when it’s written in SS06 together with sub rules?

You want to add to both sides of the preceding glyph? Otherwise I do not yet see why you would not do regular kerning.

How do you test? Where does it not work?
Did you prefix it with the RTL flag?

This is what I’m trying to do [pretty advanced stuff…]:

I made a stylistic set that adds the arrows between words that end & start with the same character.

The arrows are programmed as marks to be attached to the base glyph [because of the way InDesign treats space I can’t just sub the space for arrows, because they won’t be positioned properly].

Now I want to add space between the words.

Good challenge?! :face_with_monocle:

You still can do that with regular kerning. No need for context. And why not just give the arrows some space?

Because they are non spacing marks, my dear…

He meant, why do you not make them (spacing) symbols?

Because [as I wrote earlier], the arrows are added automatically between two words [by stylistic set], & if I substitute the space by the arrows they won’t stick to the characters if there is wide spaces because of justification [in InDesign]…

But they don’t need to be (nonespacing) marks to be substituted like this.

Here is an explanation:
This is how it looks if the arrows are symbols replacing the space [in InDesign]:

And this is how it looks when they’re marks attached to the base glyphs before & after the space:

This is how it’s supposed to look…

  1. Do not substitute the space. There is no guarantee the layout engine will use the space glyph at all. Actually it is unlikely. InDesign is an exception.
  2. It still do not see the necessity for a mark. You add an arrow at the end of a word, and the other at the beginning of a word. Here is a code sample that should get you started:
# put this lookup in a prefix
lookup addArrowsAtEnd {
	sub @finalLetter by @finalLetter finalArrow;
} addArrowsAtEnd;

# put this in a feature you like (ccmp, calt, etc.)
lookup contextualSubstitution {
	ignore sub @letter' @anythingButSpace;
	sub @letter' lookup addArrowsAtEnd @anythingButSpace;
} contextualSubstitution;

I don’t say that you should use the first solution. Don’t confuse ‘spacing’ glyph with replacing the space glyph.

The only problem with that is that this will disrupt all the contextual mark to base & mark to mark positioning I painstakingly wrote [about 500 lines…], so I figured that adding the arrow as another mark is best, & I succeeded in doing it, it’s already working fine [as seen in above screenshot in InDesign].
The only thing I want to do now, is to add space between the words where there are arrows…

Can somebody help me with that? So far nothing has worked [I tried putting it in calt, mkmk, ss06].

Thanks again!!!

I want to put arrows whenever the word starts with the same syllable as the end of the previous word [to seperate the pronouncing of the word, which is used in some Jewish prayer books], and that can be any letter, not only final letters.

But I figured this part out already, all I still need to figure out is how to add space between the words whenever there are arrows [which are added automatically by stylistic set]…

On solution would be to treat the right arrow like you are doing it right now. But the other side could be done as Rainer suggested and the left pointing arrow could have some width.

You can do it the same way I added the arrows. But again, I do not recommend meddling with the space character. It may work in one app, but break others.

Not if you add an IgnoreMarks lookupflag.

Edit: what Georg wrote. The first arrow replacement could disturb the order of characters (the arrow inserts itself between base and mark), so you would have to define that one as mark, you’re right.

1 Like