More documentation on default anchor positions (GlyphData.xml)

Hello, I am trying to customise some glyph composition and anchor setups. For example, I would like to set the ogonek anchor position to the rightmost baseline position for my glyph idotless. I am able to define ogonek@Baseline, but that centers the anchor in the middle. Is there some way I can get the anchor to be set to a custom (relative) x position as well? This would be fantastic. Thanks!

Maybe an identical question: I would like to do the same for anchors like topleft, bottomright, etc. – is this possible?

Bonus question: Is even possible to use more complex recipes/calculations that incorporate things like stem weight (defined in the master)?

I had a look at the code and here are a few more things possible:

@maxY
@minY
@maxX
@minX
@centerX
@centerY
// and some combinations
@maxYcenterX // has to start the "m"
@maxXcenterY

but those can’t be combined with a metric (e.g. ascender)

you can try ogonek@maxXminY

There is nothing special about anchor names. The @ processing works the same for all.

But I can see that there is room for improvements. Can you give some examples for the calculations you like to see?

Thanks a lot, this is already extremely helpful!

One case I would like to use a calculation for:

  • insert bottomright anchor at the bottom right location, horizontally minus the stem width. So, for example, in Cyrillic glyphs with a descender, I insert the bottomright anchor for the descender attachment at the left side of the rightmost stem. I realise this might not be a sensible approach, though.

I can’t get this to work with anchors like bottomright and topright. @maxXminY works great for ogonek, but when I try the same for bottomright, it doesn’t work. The anchor is placed somewhere further to the right. Same for @maxXmaxY for topright.

The processing order was not optional. Should work in the next version.

Brilliant, thanks a lot!

That is great!

Maybe those could be added to this guide as well? And perhaps even to the EditGlyphData app (I see anchors can be specified there, but not their intended relative location).

You can add this in EditGlyphData. Simply add it to the anchor name.

1 Like

and the new syntax is:
Possible keys:

  • maxY
  • minY
  • maxX
  • minX
  • centerX
  • centerY
  • width

and the metrics keys:

  • baseline
  • x-height

each can have a math operator like +10 or /2.5
Combine on for X and Y and separate them by ;

And now it will first apply the default positioning and then apply the extra keys. So you only need to specify what you like to change.

example:

  • bottom@maxX at baseline but moved to the right.
  • ogonek@baseline;maxX at baseline, to the right.
  • ogonek@baseline+5;maxX-10
  • ogonek@baseline+5;width*0.7
8 Likes

You’re an absolute wizard, thanks a gazillion!

Yes, that is really fabulous! Thanks a lot.

This is amazing!

Hi! This seems to work for base glyphs but can’t get it to work on this mark. Any idea wy?
Screenshot 2023-11-02 at 12.59.12
Screenshot 2023-11-02 at 12.59.38