mtiLib: check for FONTTOOLS_LOOKUP_DEBUGGING env var
We do the same for feaLib.builder to decide whether to build a Debg table or not: i.e. we check if FONTTOOLS_LOOKUP_DEBUGGING environment variable is defined and if so we go on to build one, otherwise we don't. Fixes https://github.com/fonttools/fonttools/pull/3018
This commit is contained in:
parent
ea8b9b85d7
commit
8f3d697faa
@ -13,8 +13,9 @@ from fontTools.ttLib.tables.otBase import ValueRecord, valueRecordFormatDict
|
||||
from fontTools.otlLib import builder as otl
|
||||
from contextlib import contextmanager
|
||||
from fontTools.ttLib import newTable
|
||||
from fontTools.feaLib.lookupDebugInfo import LOOKUP_DEBUG_INFO_KEY
|
||||
from fontTools.feaLib.lookupDebugInfo import LOOKUP_DEBUG_ENV_VAR, LOOKUP_DEBUG_INFO_KEY
|
||||
from operator import setitem
|
||||
import os
|
||||
import logging
|
||||
|
||||
|
||||
@ -1038,6 +1039,7 @@ def parseGSUBGPOS(lines, font, tableTag):
|
||||
self.LookupList.LookupCount = len(self.LookupList.Lookup)
|
||||
if lookupMap is not None:
|
||||
lookupMap.applyDeferredMappings()
|
||||
if os.environ.get(LOOKUP_DEBUG_ENV_VAR):
|
||||
if "Debg" not in font:
|
||||
font["Debg"] = newTable("Debg")
|
||||
font["Debg"].data = {}
|
||||
|
@ -1,5 +1,6 @@
|
||||
from fontTools.misc.xmlWriter import XMLWriter
|
||||
from fontTools.ttLib import TTFont
|
||||
from fontTools.feaLib.lookupDebugInfo import LOOKUP_DEBUG_ENV_VAR
|
||||
from fontTools import mtiLib
|
||||
import difflib
|
||||
from io import StringIO
|
||||
@ -8,6 +9,11 @@ import sys
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def set_lookup_debug_env_var(monkeypatch):
|
||||
monkeypatch.setenv(LOOKUP_DEBUG_ENV_VAR, "1")
|
||||
|
||||
|
||||
class MtiTest:
|
||||
|
||||
GLYPH_ORDER = [
|
||||
|
Loading…
x
Reference in New Issue
Block a user