From 48aa7afa4ec70388bb72058edf7247cc9ed3287e Mon Sep 17 00:00:00 2001 From: Just van Rossum Date: Fri, 26 Apr 2024 08:31:09 +0200 Subject: [PATCH] Run fontmake in-process, so we have integrated logging --- src/fontra_compile/compile_fontmake_action.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/fontra_compile/compile_fontmake_action.py b/src/fontra_compile/compile_fontmake_action.py index 3b5194e..a53c0ea 100644 --- a/src/fontra_compile/compile_fontmake_action.py +++ b/src/fontra_compile/compile_fontmake_action.py @@ -1,12 +1,12 @@ import itertools import os import pathlib -import subprocess import tempfile from contextlib import aclosing, asynccontextmanager from dataclasses import dataclass, field from typing import AsyncGenerator +from fontmake.__main__ import main as fontmake_main from fontra.backends import newFileSystemBackend from fontra.backends.copy import copyFont from fontra.core.protocols import ReadableFontBackend @@ -50,8 +50,7 @@ async def process( addInstances(designspacePath) - command = [ - "fontmake", + arguments = [ "-m", os.fspath(designspacePath), "-o", @@ -61,11 +60,11 @@ async def process( ] for option, value in self.options.items(): - command.append(f"--{option}") + arguments.append(f"--{option}") if value: - command.append(value) + arguments.append(value) - subprocess.run(command, check=True) + fontmake_main(arguments) def addInstances(designspacePath):