Ignore pos in DIST feature (exceptions)

Hi there!

Is it possible to set exceptions (ignore pos) in DIST OpenType feature? I tried to define the exception both as between classes and as an exception between class and a single glyph (look below) but in each way it doesn’t show any effects. I suppose the DIST feature doesn’t allow any exception, does it?

1st way:
lookup laoKerns2Exceptions {
ignore pos ngoNgu-lao @maiTi-lao oVowel-lao’;
pos ngoNgu-lao @maiTi-lao oVowel-lao’ <500 0 500 0>;
} laoKerns2Exceptions;

2nd way:
lookup laoKerns2Exceptions {
ignore pos ngoNgu-lao maiTi-lao oVowel-lao’;
pos ngoNgu-lao maiTi-lao oVowel-lao’ <500 0 500 0>;
} laoKerns2Exceptions;

Why DIST? Because It is concerning Lao script, with some contextual cases of marks and following tall vowels.
(The given units are exaggerated in order to make the potential effect obvious).

Thanks!
N.

The context in the ignore statement has to be different than in the actual pos statment. Otherwise it is not doing anything. Maybe you don’t need the ignore line?

Can you describe what exactly you want to do? Like: “it should replace xxx-lao with yyy-lao in front of zzz-lao, but not if it is preceded by aaa-lao”.

@GeorgSeifert, I forgot to include in this post the grounding main rule, from which to define the exceptions.
Shouldn’t be correct in general to set such main rule?
I also tried to omit the ignore line, but again there isn’t any effect.

@mekkablue, I mean a contextual repositioning, not substitution. All the base consonants could coexist with the tall vowels, but there are cases when few marks-above-the-bases (that should orthographically protrude to the ride) bring the necessity to set positive or negative kerning.

A possible situation :

Classes:

@laoBaseConsonants = [BC.001 BC.002 BC.003 BC.004 BC.005 BC.006] ;
@laoAboveMarks = [AM.001 AM.002 AM.003 AM.004 AM.005] ;
@laoTallVowels = [TV.001 TV.002 TV003 ] ; 

(the names here are given simplified in order to be easily comprehensible by anyone)

DIST feature code:

lookup KernGeneral {
    pos @laoBaseConsonants @laoAboveMarks @laoTallVowels' <25 0 25 0>;
    } KernGeneral;

lookup KernExcept {
    ignore pos BC.002 AM.001 TV.001'
    pos BC.002 AM.001 TV.001 <80 0 80 0>
    } KernExcept;

Firstly, I set similar rules in CALT feature and it gave me results. But Ben Mitchell gave me an advice to set it in DIST feature.
The previous syntax in CALT was such:

lookup KernGeneral {
    # Avoid collisions between consonants + marks  + tall vowels.
    ignore pos AM.001' TV.001';
    pos @laoBaseConsonants @laoAboveMarks 25 @laoTallVowels';
    } KernGeneral;
    
lookup KernExcept {
    # exceptions for the previous lookup
    pos @laoBaseConsonant AM.001' 80 TV.001';
    } KernExcept;

What I do not understand is why you want to use an ignore statement. It appears to be a situation for a simple contextual kerning to me. See the Contextual Kerning tutorial.

I’ll try to explain a little. Nikolay wants to kern all the tall vowels in different ways depending on the size of the above mark on the preceding base. But his design means there are some exceptions, when the marks are on different bases). So he’d like to exclude those bases from individual contextual kern lookups. Should ignore pos work? I’ve never seen it so not sure of the syntax.

1 Like

Exactly! @bendy, thank you for formulating the right question!-)

ignore pos @baseswherekerningunnecessary @marks @tallvowels';
pos @allbases @marks @tallvowels' <20 0 20 0>;

Note the placements of the tick marks '

2 Likes

But, as I said, you can’t have the same context in the ignore as in the actual pos statement.

    ignore pos BC.002 AM.001 TV.001'
    pos BC.002 AM.001 TV.001 <80 0 80 0>

If you first say: Don’t do anything for BC.002 AM.001 TV.001 and the next line you say do something for BC.002 AM.001 TV.001, nothing will happen.

2 Likes

I think that was just meant as an example, it doesn’t really make sense :slight_smile:

1 Like

I tried it in several ways (look below), sometimes within a lookup, sometimes outside it, and once again within a lookupflag 0.
But each time it did not give any outcome.

ignore pos BC.001 AM.001 TV.001';

no effect

ignore pos @BasesCiteSpecificKern AM.001 TV.001';
pos BC.001 AM.001 TV.001' <200 0 200 0> ;

Where
@BasesCiteSpecificKern = [BC.001, … ];
no effect

An attempt with only:
ignore pos @BasesCiteSpecificKern AM.001 TV.001';
no effect

Attempt with only:
pos BC.001 AM.001 TV.001' <200 0 200 0> ;
no effect

I thought you had the contextual kerning working before, aside from the exceptions. Has something else changed? Where are you testing?

The contextual kerning set in DIST is working in InDesign, aside from the exceptions.
Here is the result:

Unfortunately, on the web it does not give any clue of repositioning:
Here screen from Firefox:

Have you tried Chrome and Safari? I’m a bit stumped why that’s not working in Firefox. Are your languagesystems defined correctly?

Either language settings or you need to register the lookups for the script and languages.

1 Like

@Bendy, I tried both in Chrome, Safari and Firefox. Interestingly, only in Safari it gets right positioned.

Chrome:

Safari:

Firefox:

Here how the language system is defined:

languagesystem DFLT dflt;
languagesystem latn dflt;
languagesystem lao dflt;
languagesystem latn CAT;
languagesystem latn MOL;
languagesystem latn ROM;

@GeorgSeifert, at this state the lookups aren’t set specifically for a language. I’ll try, but from the other side it is strange, how in Safari it gets properly rendered, isn’t?

Safari is usually a bit more generous than the other browsers, it might not worry too much about script declarations. Try adding:

script lao;
language LAO;
	lookup laoKerns2;
	lookup kern1_lao;

at the end of the DIST feature, and replace the lookup names with whatever lookups you wish to activate for Lao script).

1 Like

Now I think I understand what you try to do with the Ignore statements. You would need it in the default dist lookup. But as this is generated automatically, this is not easily possible. So you add the contextual pos statement (and don’t forget the tick mark). And because the default kerning is already applied, you need to add or subtract that value from your code.

1 Like

DIST is generated automatically now? How?

For “Indic” script it is generated automatically. I may have confused that. But you could put that in the kern feature, too.
if add a kern feature and put # Automatic Code End in the first line, you manually code will be inserted into the automatically gendered code. There is # Automatic Code Start if you need your code before the automatic code.