I want to add some space in the following sequence in Tibetan script:
(simple glyph with a mark) space (simple glyph with a mark)
example: ཏོཡོ
This kind of sequence occurs in transliterated Sanskrit in Tibetan.
My question is, since I can not put an advance after the vowel mark, what is the best alternative?
Here is shown two possibilities in the feature snippet below, along with the rule that does not work.
So, is there a better way that I am missing?
Also, is there an advantage to using "kern" feature, instead of "abvm" feature?
Thanks for considering this.
languagesystem DFLT dflt;
languagesystem tibt dflt;
feature abvm {
lookup abvm3 {
pos tib.Ta' tib.Naro' tib.Ya' <200 0 200 0> tib.Naro'; # works
#pos tib.Ta' tib.Naro' <0 0 200 0> tib.Ya tib.Naro; # does not work
#pos tib.Ta' <0 0 200 0> tib.Naro' <-200 0 0 0> tib.Ya tib.Naro; # works also
} abvm3;
} abvm;
Comments
I would probably handle your Tibetan example by contextually adding space on the left side of the second base glyph, triggered by the preceding base+mark and the following mark. You can usefully filter mark groups in the lookup so that e.g. below-base consonant stacking forms are ignored and the spacing adjustment applies regardless of whether they are present.
I would perform the contextual spacing adjustment in either the dist feature or the kern feature (depending on whether you want the output to be editable by a user: think of the dist feature as 'required kerning' that is always applied and not editable).
It is possible to kern a base glyph off a mark glyph, but it gets complicated because you have to take the anchor distances of the mark into account. We do this in Thai fonts, but that is because the anchors are mostly on the right side of the preceding base, so the distances are predictable. In Tibetan, this is probably too complex because of the optical centering of the marks on bases of varying width.
The other thing to bear in mind is that spacing adjustments in GPOS are additive, while anchor positioning is substitutive. So the output of each dist or kern lookup is added to previous dist and kern lookups, and will be adjusted by further lookups. But the output of each abvm or other mark positioning lookup will replace that of previous lookups. Bearing this in mind, you will need to consider your spacing adjustments sequentially. There are two ways to do this: one is to start with the shorter contexts, and then extend the context in subsequent lookups, adding a bit of space each time; the other is to use a subtable structure and start with the longest contexts, so that once a context is met all the subsequent, shorter contexts are ignored.
What I've been doing is building an environment which makes it easy to generate layout rules algorithmically in Python. With that, you can enumerate each base/topmark(s)/base/topmark(s) combination, find the bounding box of the left and right clusters, and add positioning rules to ensure the kind of space you want between the clusters.