textgen: Fix code to generate kerning test file.

This is very useful when testing changes to the kerning table and
got broken at some point by other changes.
This commit is contained in:
Simon Howard 2019-11-24 03:36:06 +00:00
parent 487bf53d85
commit 1def5d494c

View file

@ -155,12 +155,14 @@ def generate_kerning_test(font):
if font.kerning_adjust(char1, char2) != 0:
pairs.append(char1 + char2)
cmd = font.generate_graphic(" ".join(pairs), "kerning.png")
image = font.generate_graphic(" ".join(pairs))
image.save("kerning.png")
if __name__ == "__main__":
font = TextGenerator("fontchars", kerning_table=FONT_KERNING_RULES)
#generate_kerning_test(font)
generate_graphics(font, red_graphics, color=font.COLOR_RED)
generate_graphics(font, blue_graphics, color=font.COLOR_BLUE)
generate_graphics(font, white_graphics, color=font.COLOR_WHITE)