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]¶ Pen calculating area, center of mass, variance and standard-deviation, covariance and correlation, and slant, of glyph shapes.
Note that all the calculated values are ‘signed’. Ie. if the glyph shape is self-intersecting, the values are not correct (but well-defined). As such, area will be negative if contour directions are clockwise. Moreover, variance might be negative if the shapes are self-intersecting in certain ways.