In FontLab, the Generate Glyph command creates compounds matching the anchors (top/bottom from the base, _top/_bottom from the added component). But it does not repeats any anchor in the new glyph. In other words, anchors are used to create compounds, but these compounds come without anchors.
Is there a script to automatically repeat the anchors from base component? The ideal scenario would be a script to add base anchors and let the user change its vertical position in order to enable proper diacritic stacking.
Although this is also managed by mark-to-base and mark-to-mark features, FontLab 5 does not support those. So, to adding anchors in compounds and using ccmp feature would partially workaround this limitation.
(Of course, there are Glyphs and Robofont as options, but I still do not feel comfortable with them. And FontLab VI release seems not near.)
The idea:
Comments
Ideally, anchors should be inherited from components, and mark components should have separate anchors. So instead of having single bottom and top anchors in the composite, as you propose, you would have the top and bottom anchors of the A component, and the top and _top anchors of the mark component. This would allow a) for intelligent stacking of arbitrary numbers of marks based on component order, and b) writing of anchors to GPOS <mark> and <mkmk> features.
https://github.com/kateliev/TypeDrawers/blob/master/FetchAnchorsMM.py
The script will do what you have proposed. Moreover:
- it is MM capable;
- will compensate for delta shifts (sometimes components have different placement than parents);
- will resolve duplicate anchor names by renaming the duplicates and adding the parent's name to them
- will shift anchors to new locations according to displacement dictionary
- will try to stack anchors as @John Hudson suggested, but primitevely so, because i did not get his idea exactly..., but will also compensate for mark's deltas and will rename it's anchors (thus avoiding conflicts with base glyph)
Please take a look at the customization options inside the script, or feel free to develop it further.Usage: Select the desired composite glyphs in the font window and run the script. It will fetch the anchors for each of the selected.
Anyway, I am grateful for your answer. As usual, kind and precise. Do you mind to share how you handle the <mark> and <mkmk> features? I mean, what tool do you use as FL5 does not support them.
@Vassil Kateliev, thank you very much! This is exactly (and also a lot more) than I had in mind. I will take a close look at the script as you suggested so I may learn a bit of Python.