From 4139d8914abe788cc396dcb6ccc7c9cdb365ee89 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 12 Jul 2022 16:39:43 -0600 Subject: [PATCH] [statisticsPen] By default report all glyphs --- Lib/fontTools/pens/statisticsPen.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Lib/fontTools/pens/statisticsPen.py b/Lib/fontTools/pens/statisticsPen.py index abd6ff5e7..ef5a827c2 100644 --- a/Lib/fontTools/pens/statisticsPen.py +++ b/Lib/fontTools/pens/statisticsPen.py @@ -82,17 +82,16 @@ def _test(glyphset, upem, glyphs): transformer = TransformPen(pen, Scale(1./upem)) glyph.draw(transformer) for item in ['area', 'momentX', 'momentY', 'momentXX', 'momentYY', 'momentXY', 'meanX', 'meanY', 'varianceX', 'varianceY', 'stddevX', 'stddevY', 'covariance', 'correlation', 'slant']: - if item[0] == '_': continue print ("%s: %g" % (item, getattr(pen, item))) def main(args): if not args: return filename, glyphs = args[0], args[1:] - if not glyphs: - glyphs = ['e', 'o', 'I', 'slash', 'E', 'zero', 'eight', 'minus', 'equal'] from fontTools.ttLib import TTFont font = TTFont(filename) + if not glyphs: + glyphs = font.getGlyphOrder() _test(font.getGlyphSet(), font['head'].unitsPerEm, glyphs) if __name__ == '__main__':