FontLab: automatic anchors from base component
Igor Freiberger
Posts: 275
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:
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:
0
Comments
-
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.
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.0 -
This is how it is done in Glyphs.2
-
@Igor Freiberger here you go:
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)
Usage: Select the desired composite glyphs in the font window and run the script. It will fetch the anchors for each of the selected.2 -
@John Hudson, I believe my English was not enough to properly report the aim. Actually, I am already doing what you described, combining anchor from base to their matching pairs in combining diacritics. What I was looking for was a way to go beyond that and also add base anchors to the result compound glyph.
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.1
Categories
- All Categories
- 43 Introductions
- 3.7K Typeface Design
- 801 Font Technology
- 1K Technique and Theory
- 618 Type Business
- 444 Type Design Critiques
- 542 Type Design Software
- 30 Punchcutting
- 136 Lettering and Calligraphy
- 83 Technique and Theory
- 53 Lettering Critiques
- 483 Typography
- 301 History of Typography
- 114 Education
- 68 Resources
- 499 Announcements
- 80 Events
- 105 Job Postings
- 148 Type Releases
- 165 Miscellaneous News
- 269 About TypeDrawers
- 53 TypeDrawers Announcements
- 116 Suggestions and Bug Reports