Test the flags, not the value

Avoids an empty comment when reserved values are used.
This commit is contained in:
Simon Cozens 2020-03-12 11:51:36 +00:00
parent 8fac69b0ea
commit 681ca4ae0c

View File

@ -1572,14 +1572,14 @@ class VarDataValue(BaseConverter):
class LookupFlag(UShort):
def xmlWrite(self, xmlWriter, font, value, name, attrs):
xmlWriter.simpletag(name, attrs + [("value", value)])
if value > 0:
flags = []
if value & 0x01: flags.append("rightToLeft")
if value & 0x02: flags.append("ignoreBaseGlyphs")
if value & 0x04: flags.append("ignoreLigatures")
if value & 0x08: flags.append("ignoreMarks")
if value & 0x10: flags.append("useMarkFilteringSet")
if value & 0xff00: flags.append("markAttachmentType[%i]" % (value >> 8))
flags = []
if value & 0x01: flags.append("rightToLeft")
if value & 0x02: flags.append("ignoreBaseGlyphs")
if value & 0x04: flags.append("ignoreLigatures")
if value & 0x08: flags.append("ignoreMarks")
if value & 0x10: flags.append("useMarkFilteringSet")
if value & 0xff00: flags.append("markAttachmentType[%i]" % (value >> 8))
if flags:
xmlWriter.comment(" ".join(flags))
xmlWriter.newline()