def compress(ttFont, method_python=False, **options): """ Subroutinize TTFont instance in-place using the C++ Compreffor. If 'method_python' is True, use the slower, pure-Python Compreffor. If the font already contains subroutines, it is first decompressed. """ if has_subrs(ttFont): log.warning("There are subroutines in font; must decompress it first") decompress(ttFont) if method_python: pyCompressor.compreff(ttFont, **options) else: cxxCompressor.compreff(ttFont, **options)
def compress(ttFont, method_python=False, **options): """ Subroutinize TTFont instance in-place using the C++ Compreffor. If 'method_python' is True, use the slower, pure-Python Compreffor. If the font already contains subroutines, it is first decompressed. """ if has_subrs(ttFont): log.warning( "There are subroutines in font; must decompress it first") decompress(ttFont) if method_python: pyCompressor.compreff(ttFont, **options) else: cxxCompressor.compreff(ttFont, **options)
def run_lib(self): assert os.path.exists(self.lib_path) cxxCompressor.compreff(self.font, use_lib=True, **self.options)
def run_executable(self): assert os.path.exists(self.exe_path) cxxCompressor.compreff(self.font, use_lib=False, **self.options)
def run_cxx(self): cxxCompressor.compreff(self.font, **self.options)