Import fonttools only on demand

Fixes #2017476 [Error when using 'Edit metadata' hotkey from locked details window](https://bugs.launchpad.net/calibre/+bug/2017476)
This commit is contained in:
Kovid Goyal 2023-04-24 11:48:15 +05:30
parent 8a0088f50d
commit 14e7acc6f4
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -6,10 +6,10 @@ import sys
from logging.handlers import QueueHandler
from queue import Empty, SimpleQueue
from fontTools.subset import Subsetter, load_font, log, save_font
def subset(input_file_object_or_path, output_file_object_or_path, container_type, chars_or_text=''):
from fontTools.subset import Subsetter, load_font, log, save_font
log_messages = SimpleQueue()
log_handler = QueueHandler(log_messages)
log.addHandler(log_handler)