Allow features to be added to VF without building GDEF; warn when GDEF would be needed but isn't requested. This fixes #2694

This commit is contained in:
Just van Rossum 2022-07-20 11:24:37 +02:00
parent 32aa8eafcb
commit e4c5c842f1

View File

@ -224,14 +224,14 @@ class Builder(object):
del self.font[tag]
if any(tag in self.font for tag in ("GPOS", "GSUB")) and "OS/2" in self.font:
self.font["OS/2"].usMaxContext = maxCtxFont(self.font)
gdef = self.buildGDEF() # build unconditionally so we can warn below
if "GDEF" in tables:
gdef = self.buildGDEF()
if gdef:
self.font["GDEF"] = gdef
elif "GDEF" in self.font:
del self.font["GDEF"]
elif self.varstorebuilder:
raise FeatureLibError("Must save GDEF when compiling a variable font", None)
elif gdef:
log.warning("GDEF is not requested, but is needed")
if "BASE" in tables:
base = self.buildBASE()
if base: