statisticsPen

Pen calculating area, center of mass, variance and standard-deviation, covariance and correlation, and slant, of glyph shapes.

class fontTools.pens.statisticsPen.StatisticsPen(glyphset=None)[source]

Bases: StatisticsBase, MomentsPen

Pen calculating area, center of mass, variance and standard-deviation, covariance and correlation, and slant, of glyph shapes.

Note that if the glyph shape is self-intersecting, the values are not correct (but well-defined). Moreover, area will be negative if contour directions are clockwise.

class fontTools.pens.statisticsPen.StatisticsControlPen(glyphset=None)[source]

Bases: StatisticsBase, BasePen

Pen calculating area, center of mass, variance and standard-deviation, covariance and correlation, and slant, of glyph shapes, using the control polygon only.

Note that if the glyph shape is self-intersecting, the values are not correct (but well-defined). Moreover, area will be negative if contour directions are clockwise.