Tools to work with anchors.

copyAnchors(sourceGlyph, targetGlyph, clear=True, proportional=False)

Copy all anchors from one glyph to another glyph.

  • sourceGlyph (RGlyph) – A glyph object with anchors to copy from.

  • targetGlyph (RGlyph) – A glyph object to copy the anchors to.

  • proportional (bool) – Scale the target anchors’ horizontal position based on the target glyph’s width.

  • clear (bool) – Delete all anchors in target glyph before copying.

from hTools3.modules.anchors import copyAnchors
font = CurrentFont()
g1 = font['a']
g2 = font['o']
copyAnchors(g1, g2, clear=True, proportional=True)