Can Anchors be Scaled or Bulk-modified?

Is there a way to scale anchors in FontCreator?

I can’t seem to find any way to automatically re-locate anchors along with Glyph Transformations. I’m thinking an option such as [X] Scale Anchors on the Scale() Glyph Transform primitive would be great.

Only other way I can think of handling this is to export the OTLFD code, process it externally, and paste the result back into the OT Designer code view. Maybe there is a better way …

Caveat: The issue should not really concern most FontCreator (FC) users. I am working on this because I often scale and italicize fonts that already have anchors and extensive OpenType directives defined that use anchors and have kerning information I wish to keep. (I also manipulate fonts outside of FC using my own programs). Just be aware that, if you run Glyph Transforms after developing OpenType layout directives, that your attachment points may need to be adjusted by hand.

… been working on this for 3 days now, and I realized that quite a few glyph transformation primitives are involved: Position, Move, Rotate, Scale, Mirror, Skew, LSB at X=0, Width, Bearings, Center Glyph, Italic, probably some of the other Effects … basically anything that can significantly change the shape or location of contours and for which you would want to programmatically adjust anchors, kerning distances, attachment points, etc.

I am thinking that only the GPOS table is involved, but maybe there is something in GSUB that could be affected.

My original idea was to export OTLFD code from FC’s OpenType Designer (“OTD”), massage it with a script, and paste it back into the OTD … I think that would have worked, but that’s a lot of cutting-and-pasting.

However, I stumbled on an approach that is completely programmatic: to use the python-based TTX tool in the FontTools package to export to a .ttx format file (a form of XML). I modifying the .ttx with a perl script (entirely text manipulation - no mucking with the font files themselves). The TTX tool can then re-ingest the modified .ttx file and compose a revised .ttf file with the updated GPOS directives. I have currently implemented scaling and oblique transformations - the only things that I currently need to do automatically.

I have done very limited testing on this approach, and it does seem to work - OpenType directives are positioning to reasonable locations. Will incorporate it into my font pipeline and test it on a range of fonts (284 input fonts at this point).

For now anchors are not changed with those transform features. We might add such enhancement if there is a need for it. We will keep an eye on this topic to see if more people would like this implemented.

Possibly a note in the manual to “Consider (re-)running Tools => AutoKern if you apply font-wide or large-scale Glyph Transformations that involve Position, Move, Rotate, …”.

Users might not notice that GPOS kerning is still using the pre-scaled values in, for example, a Glyph Transformation to handle a UnitsPerEm change.

Good idea. We will add a note.

Hello Erwin
I am running into the need to apply mass transformation to anchors.

Here are the use cases:

  • Expanded: X transformation, by a fixed quantity
  • Condensed: X transformation, by a fixed quantity
  • Wide: X transformation, scaled by a percentage
  • Narrow: X transformation, scaled by a percentage

For all of the above instances, where the Left Side Bearing is fixed, the glyph changes width by movement of points on the right. So the anchor points need to move with the glyph.

The only way this issue would not occur, is by not setting the left side bearing to zero.

We have added this request to our list of items for a future release.