pdf converter, still missing motifs
[librarian.git] / librarian / epub.py
index 2584029..52294dd 100644 (file)
@@ -211,7 +211,6 @@ class TOC(object):
 
 def used_chars(element):
     """ Lists characters used in an ETree Element """
-    print (element.text or '') + (element.tail or '')
     chars = set((element.text or '') + (element.tail or ''))
     for child in element:
         chars = chars.union(used_chars(child))
@@ -400,7 +399,7 @@ def transform(provider, slug, output_file=None, output_dir=None):
 
     os.chdir(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../font-optimizer'))
     for fname in 'DejaVuSerif.ttf', 'DejaVuSerif-Bold.ttf', 'DejaVuSerif-Italic.ttf', 'DejaVuSerif-BoldItalic.ttf':
-        subprocess.check_call(['./subset.pl', '--chars', ''.join(chars), res('../fonts/' + fname), os.path.join(tmpdir, fname)])
+        subprocess.check_call(['./subset.pl', '--chars', ''.join(chars).encode('utf-8'), res('../fonts/' + fname), os.path.join(tmpdir, fname)])
         zip.write(os.path.join(tmpdir, fname), os.path.join('OPS', fname))
     rmtree(tmpdir)
     os.chdir(cwd)