Merge pull request #2106 from simoncozens/debugging-switch
Turn on feaLib debugging from the environment
This commit is contained in:
commit
6864100ff4
@ -2,7 +2,11 @@ from fontTools.misc.py23 import *
|
|||||||
from fontTools.misc import sstruct
|
from fontTools.misc import sstruct
|
||||||
from fontTools.misc.textTools import binary2num, safeEval
|
from fontTools.misc.textTools import binary2num, safeEval
|
||||||
from fontTools.feaLib.error import FeatureLibError
|
from fontTools.feaLib.error import FeatureLibError
|
||||||
from fontTools.feaLib.lookupDebugInfo import LookupDebugInfo, LOOKUP_DEBUG_INFO_KEY
|
from fontTools.feaLib.lookupDebugInfo import (
|
||||||
|
LookupDebugInfo,
|
||||||
|
LOOKUP_DEBUG_INFO_KEY,
|
||||||
|
LOOKUP_DEBUG_ENV_VAR,
|
||||||
|
)
|
||||||
from fontTools.feaLib.parser import Parser
|
from fontTools.feaLib.parser import Parser
|
||||||
from fontTools.feaLib.ast import FeatureFile
|
from fontTools.feaLib.ast import FeatureFile
|
||||||
from fontTools.otlLib import builder as otl
|
from fontTools.otlLib import builder as otl
|
||||||
@ -31,6 +35,7 @@ from collections import defaultdict
|
|||||||
import itertools
|
import itertools
|
||||||
import logging
|
import logging
|
||||||
import warnings
|
import warnings
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@ -210,7 +215,7 @@ class Builder(object):
|
|||||||
self.font["BASE"] = base
|
self.font["BASE"] = base
|
||||||
elif "BASE" in self.font:
|
elif "BASE" in self.font:
|
||||||
del self.font["BASE"]
|
del self.font["BASE"]
|
||||||
if debug:
|
if debug or os.environ.get(LOOKUP_DEBUG_ENV_VAR):
|
||||||
self.buildDebg()
|
self.buildDebg()
|
||||||
|
|
||||||
def get_chained_lookup_(self, location, builder_class):
|
def get_chained_lookup_(self, location, builder_class):
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
from typing import NamedTuple
|
from typing import NamedTuple
|
||||||
|
|
||||||
LOOKUP_DEBUG_INFO_KEY = "com.github.fonttools.feaLib"
|
LOOKUP_DEBUG_INFO_KEY = "com.github.fonttools.feaLib"
|
||||||
|
LOOKUP_DEBUG_ENV_VAR = "FONTTOOLS_LOOKUP_DEBUGGING"
|
||||||
|
|
||||||
class LookupDebugInfo(NamedTuple):
|
class LookupDebugInfo(NamedTuple):
|
||||||
"""Information about where a lookup came from, to be embedded in a font"""
|
"""Information about where a lookup came from, to be embedded in a font"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user