From 49c38f6f0873a80e632ffc34c2a9f1a993b6c96f Mon Sep 17 00:00:00 2001 From: Tuomas Salo Date: Thu, 7 Jan 2016 00:49:02 +0200 Subject: [PATCH] Allow DefineFont without DefineFontInfo --- swf/export.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/swf/export.py b/swf/export.py index cbb0b3f..25425c8 100644 --- a/swf/export.py +++ b/swf/export.py @@ -527,6 +527,17 @@ def export(self, swf, force_stroke=False): self.fonts = dict([(x.characterId,x) for x in swf.all_tags_of_type(TagDefineFont)]) self.fontInfos = dict([(x.characterId,x) for x in swf.all_tags_of_type(TagDefineFontInfo)]) + # Make sure that all fonts have a fontInfos entry + for font_id in self.fonts.keys(): + if font_id not in self.fontInfos: + info = TagDefineFontInfo() + + # For now, draw characters as paths (instead of using SVG elements) + info.useGlyphText = True + + info.codeTable = self.fonts[font_id].codeTable + self.fontInfos[font_id] = info + # GO! super(SVGExporter, self).export(swf, force_stroke)