How to use the fontmake.ttfautohint.ttfautohint function in fontmake

To help you get started, we’ve selected a few fontmake examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github googlefonts / fontmake / Lib / fontmake / font_project.py View on Github external
if not do_autohint:
                continue

            if output_path is not None:
                hinted_otf_path = output_path
            else:
                hinted_otf_path = self._output_path(
                    ufo,
                    ext,
                    is_instance,
                    interpolatable,
                    autohinted=True,
                    output_dir=output_dir,
                )
            try:
                ttfautohint(otf_path, hinted_otf_path, args=autohint)
            except TTFAError:
                # copy unhinted font to destination before re-raising error
                shutil.copyfile(otf_path, hinted_otf_path)
                raise
            finally:
                # must clean up temp file
                os.remove(otf_path)