Diacritic Positioning

Hi. I am busy with an Arabic font. There is a ligature that has 2 components.

I want to center the diacritic when using only one diacritic.
I added a chained context positioning and added diacritic in input and glyphs for backtrack and lookahead, but it does not work?
Can anyone help me?

This is what I want to do
lamalef.png
This is from the OpenType dialog
screen.png

This seems to be tricky, but this will work:

Within the original mark to ligature feature, do move the first mark component to the center. Write down the offset.

Now create a single adjustment lookup that uses the above offset to correct the position in case it is used with two components.

Then add a chained context positioning lookup and connect it to the single adjustment.

See:

lookup SingleAdjustmentUncenter{
  pos arabicsukuncomb <160 0 0 0>;
}

lookup ChainedContextPositioning2Comp {
  context ("jeem_yehbarree-arab.isol") arabicsukuncomb ("signsallallahoualayhewassallamcomb-arab");
  sub 0 SingleAdjustmentUncenter;
}

Input:

/jeem-arab/arabicsukuncomb/yehbarree-arab/signsallallahoualayhewassallamcomb-arab /jeem-arab/arabicsukuncomb/yehbarree-arab

Output:
ArabicLigatureCentered.png

thanks. it worked. but i created two single adjustments one 0,0 and one changed. if there is to 2 diarictics use 0,0 and when there is one the other.

I don’t understand your question, can you please explain it with some sample text, illustrations, or a reduced font project?