'Thin space' in OT-feature calt.

Henyk's picture

I have problem with automatic contextual replacement in InDesign f.e. with such code

sub space b' by b.alt;

it works only after usual or non-breaking space, but when after a 'emdash' is inserted thin space — the replacement not works automatically, then I must insert alternate manually via 'glyphs palette'. What can I do to resolve this problem? Or it's impossible?

Jackson's picture

you could write more code with the necessary lookups or switch your b and b.alt

Henyk's picture

'more code with the necessary lookups'

How exactly?

Switching alternates does not look as good decision because I already have about five alternatives for b in this font...

k.l.'s picture

I think you better go by the reverse logic. Identify the beginning of a word not by presence of space but by absence of letters:

@anyLetter = [a b c ...];
ignore sub @anyLetter b';
sub b' b.alt;

This makes it easier to deal with different spaces, punctuation marks, numbers, currency symbols, math symbols, etc.
In case you do not want to see the b-to-b.alt replacement if, for example, a period precedes the word, then simply include period in the @anyLetter class.

Henyk's picture

Thank You, k.l., it's interesting idea :)

Syndicate content Syndicate content