1 # This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
 
   2 # Copyright © Fundacja Wolne Lektury. See NOTICE for more information.
 
   5 from shutil import rmtree
 
   6 from tempfile import mkdtemp
 
   7 from fontTools.subset import main
 
  10 def strip_font(path, chars):
 
  11     tmpdir = mkdtemp('-librarian-epub')
 
  14        '--text=' + ''.join(chars),
 
  15        '--output-file=' + os.path.join(tmpdir, 'font.ttf')
 
  17     with open(os.path.join(tmpdir, 'font.ttf'), 'rb') as f: