black
This commit is contained in:
parent
7c6455f35d
commit
ad6c5eb89c
@ -38,7 +38,6 @@ class StatisticsPen(MomentsPen):
|
|||||||
self.slant = 0
|
self.slant = 0
|
||||||
|
|
||||||
def __update(self):
|
def __update(self):
|
||||||
|
|
||||||
area = self.area
|
area = self.area
|
||||||
if not area:
|
if not area:
|
||||||
self.__zero()
|
self.__zero()
|
||||||
@ -143,12 +142,19 @@ def main(args):
|
|||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
"fonttools pens.statisticsPen", description="Report font glyph shape geometricsl statistics"
|
"fonttools pens.statisticsPen",
|
||||||
|
description="Report font glyph shape geometricsl statistics",
|
||||||
)
|
)
|
||||||
parser.add_argument("font", metavar="font.ttf", help="Font file.")
|
parser.add_argument("font", metavar="font.ttf", help="Font file.")
|
||||||
parser.add_argument("glyphs", metavar="glyph-name", help="Glyph names.", nargs="*")
|
parser.add_argument("glyphs", metavar="glyph-name", help="Glyph names.", nargs="*")
|
||||||
parser.add_argument("-y", metavar="<number>", help="Face index into a collection to open. Zero based.")
|
parser.add_argument(
|
||||||
parser.add_argument("-q", "--quiet", action="store_true", help="Only report font-wide statistics.")
|
"-y",
|
||||||
|
metavar="<number>",
|
||||||
|
help="Face index into a collection to open. Zero based.",
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"-q", "--quiet", action="store_true", help="Only report font-wide statistics."
|
||||||
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--variations",
|
"--variations",
|
||||||
metavar="AXIS=LOC",
|
metavar="AXIS=LOC",
|
||||||
@ -170,13 +176,17 @@ def main(args):
|
|||||||
v = int(fields[1])
|
v = int(fields[1])
|
||||||
location[tag] = v
|
location[tag] = v
|
||||||
|
|
||||||
|
|
||||||
from fontTools.ttLib import TTFont
|
from fontTools.ttLib import TTFont
|
||||||
|
|
||||||
font = TTFont(options.font, fontNumber=fontNumber)
|
font = TTFont(options.font, fontNumber=fontNumber)
|
||||||
if not glyphs:
|
if not glyphs:
|
||||||
glyphs = font.getGlyphOrder()
|
glyphs = font.getGlyphOrder()
|
||||||
_test(font.getGlyphSet(location=location), font["head"].unitsPerEm, glyphs, quiet=options.quiet)
|
_test(
|
||||||
|
font.getGlyphSet(location=location),
|
||||||
|
font["head"].unitsPerEm,
|
||||||
|
glyphs,
|
||||||
|
quiet=options.quiet,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
@ -221,7 +221,11 @@ def main(args=None):
|
|||||||
)
|
)
|
||||||
parser.add_argument("font", metavar="font.ttf", help="Font file.")
|
parser.add_argument("font", metavar="font.ttf", help="Font file.")
|
||||||
parser.add_argument("text", metavar="text", help="Text string.")
|
parser.add_argument("text", metavar="text", help="Text string.")
|
||||||
parser.add_argument("-y", metavar="<number>", help="Face index into a collection to open. Zero based.")
|
parser.add_argument(
|
||||||
|
"-y",
|
||||||
|
metavar="<number>",
|
||||||
|
help="Face index into a collection to open. Zero based.",
|
||||||
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--variations",
|
"--variations",
|
||||||
metavar="AXIS=LOC",
|
metavar="AXIS=LOC",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user