Add only missing anchors

Hi, is there a way to add only the missing/necessary anchors to a font? It would be based on the actual composite glyphs in the font. This would be very handy – I find having all these unused anchors (generated by “Set Anchors”) quite distracting, and junk data is never a good idea. If I add more composite glyphs then I could simply re-run “add missing anchors” to add, well, only those additional anchors that may be needed.

Could be done by a script.

Don’t exactly see a problem with all anchors though. And anchors are not only used for compounds but also mark attachment.

I would find this very useful as well. Many fonts I create are not for distribution and they often have very limited glyph set. Therefore I often need only “top” anchors.

Having meaningless data in your workflow is most definitely a problem. Making the human ignore some data “manually” instead of handling things smartly by the computer is the wrong approach. This can also lead to errors and slips easily. All datda I work on should be relevant, everything else should go or clearly indicated as currently unused. That’s 101 of working with computers.

Surely that could be detected automatically, too?

1 Like

Having meaningless data in your workflow is most definitely a problem.

Fully agree. Working on complex scripts can involve a lot of anchors per glyph, and a lot of mark glyphs. With the current setup this will generate mark and mkmk code for every permutation of marks, which means a ton of useless code.

I’m also not convinced that composites should always inherit anchors from components. Fine if I manually place anchors on the composites, but if I don’t want any anchors on them there doesn’t seem to be a mechanism to allow that.

can you give me some example when you don’t need the anchors/mark feature form components?

Example: a does not need a “bottom” anchor if there is no component that uses this anchor (with the a).

Example 2: f does not need any anchors if there is no glyph in the font that uses the f as a component.

Unused anchors are simply those that, uhm, are not used in any of the composite glyphs in the font.

+1 from here. I often had a similar issue with that and was never too happy about the answer »leave them there, who cares«. One example from the top of my head is the germandbls, that gets auto anchors. I cannot even imagine a scenario where mark to mark anchors would be used here. But I am still open for opinions anyway :smile:

Depending on the design, a majority of the glyphs from the three Myanmar code blocks can be built from components. Some need to copy the anchors, but a lot of them don’t, as the components are flipped up-down or left-right, or appear in glyphs that also have non-component paths that need to determine anchor positions. Or components may just have more anchors when used alone, but need fewer anchors when in a composite (in a ligature of combining marks, for example). In addition, different glyphs need different behaviour: for example, vowel glyphs do not take marks but are made from components that do have anchors.

With 350 nonspacing mark glyphs in my current font (and still growing) and the same number of bases, each with up to seven anchor points, you can see there’s going to be a lot of redundant mark code.

Georg, recently, I created several fonts based on handwriting of Czech comic book artists. The fonts were intended for a localized version of one particular comic book in four languages only and the character set was very limited: dozens of alternates and ligatures but not even a complete A–Z set, five or six accents. In such case I don’t really need additional anchor above caron or anchor ogonek for instance. And this is quite a common scenario. Those font will never be released.

Also, for situations where composites contain two base components and a mark component, is there a way of switching which base the mark is anchored to?

It is the order if the components that should determine this.

And about the general discussion here: who is to say what is relevant? I can give you a few examples where designers were actively looking for a Latin font with full mark attachment support (which was a difficult task), because e.g. a manuscript transcription required placing dots and lines under certain consonants, and IIRC including a sharp s. The worst that can happen to you is that you make your font more compatible with Unicode.

If you want to avoid certain anchors altogether, however, I recommend a custom glyph data XML.

That’s what I thought, I didn’t have any luck changing the order, so maybe I’ve got my anchors in a muddle.

Quite. That’s why I think having a choice about this would be appropriate. A simple ‘inherit anchors from components’ tick box in preferences would probably suffice? I don’t think editing the XML would stop composites inheriting anchors, would it?


• Why doesn’t Glyphs 2 add anchors to mark glyphs when I use “Set Anchors”? I am using Glyphs 1 only to add anchors since Glyphs 2 adds some useless ones and misses some important ones.

• When I click on an anchor, wouldn’t it make sense to show only the respective marks for this anchor as mark cloud? Right now, if I click on any anchor this shows the marks for all anchors.

• In some glyphs (such as the b with automatically set anchors), clicking on an anchor does not show any mark cloud. Isn’t that a sign that these anchors are truely unused (not even for mark attachment)? How am I suposed to decide which is the right position?

it will use the last components that contains the anchor.

It only adds anchors to the combining anchors. That changed from Glyphs 1 where it used the ascii accents for composition. I added a compatibility fallback to pick up none combining accents when the combinings are not available. But anchors need to be added manually, or better one should switch to use combining accents.

I’ll try this.

I had several request to add anchors for all latin base glyphs. There can be some macrons and dots below in some languages. And as this costs only a few bytes and can be fixes easily (by not running the command or remove the anchors) I added them. The clouds shows only accents that are in the standard European encodings.

Could you reinstate the function where select all captures the anchors only after the third go? I often want to select outlines and components but not anchors.


Hopeful little bump?

That would be a job for a script.

Update: There is a script Select > Select All Paths and Components in my Scripts repository. You can set a shortcut in System Preferences > Keyboard > Shortcuts.