[statisticsPen,svgPathPen] Add -y for face-index
This commit is contained in:
parent
2ef075050a
commit
050370764a
@ -141,6 +141,7 @@ def main(args):
|
||||
)
|
||||
parser.add_argument("font", metavar="font.ttf", help="Font file.")
|
||||
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(
|
||||
"--variations",
|
||||
metavar="AXIS=LOC",
|
||||
@ -152,7 +153,8 @@ def main(args):
|
||||
|
||||
options = parser.parse_args(args)
|
||||
|
||||
filename, glyphs = options.font, options.glyphs
|
||||
glyphs = options.glyphs
|
||||
fontNumber = int(options.y) if options.y is not None else 0
|
||||
|
||||
location = {}
|
||||
for tag_v in options.variations.split():
|
||||
@ -164,7 +166,7 @@ def main(args):
|
||||
|
||||
from fontTools.ttLib import TTFont
|
||||
|
||||
font = TTFont(filename)
|
||||
font = TTFont(options.font, fontNumber=fontNumber)
|
||||
if not glyphs:
|
||||
glyphs = font.getGlyphOrder()
|
||||
_test(font.getGlyphSet(location=location), font["head"].unitsPerEm, glyphs)
|
||||
|
@ -221,6 +221,7 @@ def main(args=None):
|
||||
)
|
||||
parser.add_argument("font", metavar="font.ttf", help="Font file.")
|
||||
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(
|
||||
"--variations",
|
||||
metavar="AXIS=LOC",
|
||||
@ -232,7 +233,9 @@ def main(args=None):
|
||||
|
||||
options = parser.parse_args(args)
|
||||
|
||||
font = TTFont(options.font)
|
||||
fontNumber = int(options.y) if options.y is not None else 0
|
||||
|
||||
font = TTFont(options.font, fontNumber=fontNumber)
|
||||
text = options.text
|
||||
|
||||
location = {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user