Description
Asked to comment, here it is:
In Single positioning lookups there are 2 times 2 possible positioning types that can be applied to a glyph.
Xplacement and Yplacement: the image of the glyph changes its position in x or y in relation to the surrounding glyphs, that stay where they are.
Xadvance and Yadvance: the glyph stays where it is, but all the following glyphs are shifted.
The 3 variants of mark attachment lookups apply an algorithm where in a context of two glyphs with matching anchors, there is an X/Yplacement applied to the second glyph with a distance of 1st
glyph anchor minus 2nd glyph anchor. Of course in most cases this works best if the second glyph is zero width. It is assumed and even forced to be always zero width. But I do not see this written in the current GPOS spec as a requirement.
The cursive attachment is very different. One way of describing its algorithm is to say that there is an X/Yadvance applied to the first glyph with a distance of 1st glyph anchor minus 2nd glyph anchor.
(Of course it can also be done with X/Yplacement AND X/Yadvance to the second glyph.)
But there is a second way to describe what happens. On the first glyph the exit anchor creates an new right sidebearing and on the second the entry anchor a left sidebearing, if we ignore Y for a moment. With cursive connection we space glyphs with an alternative for the hmtx metrics.
Within the context of cursive connection the whole concept of spacing and non-spacing glyphs becomes very fluid. The advance width of a glyph may be the advance width of the hmtx table, which may be zero of positive. The advance width may be the distance between the two anchors: a value which can be positive, zero or negative. It may be the distance between the entry anchor and the original right sidebearing: positive, zero or negative. And the distance between origin and exit anchor is also possible: positive, zero or negative. So a single glyph may be zero width, positive width or negative width depending on context. And it does not really matter if glyphs are marks or base glyphs. To position one shape in relation to another, it is the coordinates of the anchors that matter: it does not matter if these coordinates are an anchor on a base glyph or mark glyph or on a spacing glyph or a non-spacing glyph.
Now we have a proposal to add a flag to allow attachment with spacing marks. There are 3 samples given of what it can do. Then its says: add this flag and we can use spacing marks for mark attachment and cursive attachment. But it does not specify an implementation or algorithm and it does not seem to distinguish between very different lookup types.
So what is the proposed algorithm for mark attachment in terms of placement and advance? What should the flag do for cursive connection, if anything other than preventing the shaper to meddle with the hmtx-advance? And if this flag is set and the spacing glyph is not “attached” to something would it be meddled with anyway. Any solution for that?
In other words: the current specification of the SpacingAttach flag, specifies the existence of a flag, but not what it does.