angledMarginPen

class robofab.pens.angledMarginPen.AngledMarginPen(glyphSet, width, italicAngle)

Angled Margin Pen

Pen to calculate the margins as if the margin lines were slanted according to the font.info.italicAngle.

Notes: - this pen works on the on-curve points, and approximates the distance to curves. - results will be float. - when used in FontLab, the resulting margins may be slightly

different from the values originally set, due to rounding errors.
  • similar to what RoboFog used to do.
  • RoboFog had a special attribute for “italicoffset”, horizontal

shift of all glyphs. This is missing in Robofab.

robofab.pens.angledMarginPen.getAngledMargins(glyph, font)

Get the angled margins for this glyph.

robofab.pens.angledMarginPen.setAngledLeftMargin(glyph, font, value)

Set the left angled margin to value, adjusted for font.info.italicAngle.

robofab.pens.angledMarginPen.setAngledRightMargin(glyph, font, value)

Set the right angled margin to value, adjusted for font.info.italicAngle.

robofab.pens.angledMarginPen.centerAngledMargins(glyph, font)

Center the glyph on angled margins.