[varLib.interpolatable] Warn if only one master was found
Motivated by https://github.com/fonttools/fonttools/issues/3666
This commit is contained in:
parent
269321387b
commit
885d7c1ecb
@ -693,7 +693,7 @@ def main(args=None):
|
|||||||
|
|
||||||
from fontTools import configLogger
|
from fontTools import configLogger
|
||||||
|
|
||||||
configLogger(level=("INFO" if args.verbose else "ERROR"))
|
configLogger(level=("INFO" if args.verbose else "WARNING"))
|
||||||
if args.debug:
|
if args.debug:
|
||||||
configLogger(level="DEBUG")
|
configLogger(level="DEBUG")
|
||||||
|
|
||||||
@ -750,13 +750,13 @@ def main(args=None):
|
|||||||
for k, vv in axis_triples.items()
|
for k, vv in axis_triples.items()
|
||||||
}
|
}
|
||||||
|
|
||||||
elif args.inputs[0].endswith(".ttf"):
|
elif args.inputs[0].endswith(".ttf") or args.inputs[0].endswith(".otf"):
|
||||||
from fontTools.ttLib import TTFont
|
from fontTools.ttLib import TTFont
|
||||||
|
# Is variable font?
|
||||||
|
|
||||||
font = TTFont(args.inputs[0])
|
font = TTFont(args.inputs[0])
|
||||||
upem = font["head"].unitsPerEm
|
upem = font["head"].unitsPerEm
|
||||||
if "gvar" in font:
|
if "gvar" in font:
|
||||||
# Is variable font
|
|
||||||
|
|
||||||
fvar = font["fvar"]
|
fvar = font["fvar"]
|
||||||
axisMapping = {}
|
axisMapping = {}
|
||||||
@ -830,6 +830,7 @@ def main(args=None):
|
|||||||
names.append(name)
|
names.append(name)
|
||||||
fonts.append(glyphsets[locTuple])
|
fonts.append(glyphsets[locTuple])
|
||||||
locations.append(dict(locTuple))
|
locations.append(dict(locTuple))
|
||||||
|
|
||||||
args.ignore_missing = True
|
args.ignore_missing = True
|
||||||
args.inputs = []
|
args.inputs = []
|
||||||
|
|
||||||
@ -854,6 +855,10 @@ def main(args=None):
|
|||||||
|
|
||||||
names.append(basename(filename).rsplit(".", 1)[0])
|
names.append(basename(filename).rsplit(".", 1)[0])
|
||||||
|
|
||||||
|
if len(fonts) < 2:
|
||||||
|
log.warning("Font file does not seem to be variable. Nothing to check.")
|
||||||
|
return
|
||||||
|
|
||||||
glyphsets = []
|
glyphsets = []
|
||||||
for font in fonts:
|
for font in fonts:
|
||||||
if hasattr(font, "getGlyphSet"):
|
if hasattr(font, "getGlyphSet"):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user