Merge pull request #3309 from fonttools/pyup-scheduled-update-2023-10-23
Scheduled weekly dependency update for week 43
This commit is contained in:
commit
53e71f9eb7
@ -1,4 +1,4 @@
|
||||
sphinx==5.3.0
|
||||
sphinx_rtd_theme==1.1.1
|
||||
reportlab==3.6.13
|
||||
freetype-py==2.3.0
|
||||
sphinx==7.2.6
|
||||
sphinx_rtd_theme==1.3.0
|
||||
reportlab==4.0.6
|
||||
freetype-py==2.4.0
|
||||
|
@ -119,7 +119,6 @@ class error(Exception):
|
||||
|
||||
|
||||
class AFM(object):
|
||||
|
||||
_attrs = None
|
||||
|
||||
_keywords = [
|
||||
|
@ -1000,7 +1000,6 @@ class TopDictIndex(Index):
|
||||
|
||||
|
||||
class FDArrayIndex(Index):
|
||||
|
||||
compilerClass = FDArrayIndexCompiler
|
||||
|
||||
def toXML(self, xmlWriter):
|
||||
@ -2483,7 +2482,6 @@ def encodeNumber(num):
|
||||
|
||||
|
||||
class TopDictCompiler(DictCompiler):
|
||||
|
||||
opcodes = buildOpcodeDict(topDictOperators)
|
||||
|
||||
def getChildren(self, strings):
|
||||
@ -2590,7 +2588,6 @@ class FontDictCompiler(DictCompiler):
|
||||
|
||||
|
||||
class PrivateDictCompiler(DictCompiler):
|
||||
|
||||
maxBlendStack = maxStackLimit
|
||||
opcodes = buildOpcodeDict(privateDictOperators)
|
||||
|
||||
|
@ -513,7 +513,6 @@ def specializeCommands(
|
||||
preserveTopology=False,
|
||||
maxstack=48,
|
||||
):
|
||||
|
||||
# We perform several rounds of optimizations. They are carefully ordered and are:
|
||||
#
|
||||
# 0. Generalize commands.
|
||||
|
@ -22,7 +22,6 @@ class missingdict(dict):
|
||||
|
||||
|
||||
def cumSum(f, op=add, start=0, decreasing=False):
|
||||
|
||||
keys = sorted(f.keys())
|
||||
minx, maxx = keys[0], keys[-1]
|
||||
|
||||
@ -46,7 +45,6 @@ def cumSum(f, op=add, start=0, decreasing=False):
|
||||
|
||||
|
||||
def byteCost(widths, default, nominal):
|
||||
|
||||
if not hasattr(widths, "items"):
|
||||
d = defaultdict(int)
|
||||
for w in widths:
|
||||
|
@ -45,7 +45,6 @@ class Parser(object):
|
||||
def __init__(
|
||||
self, featurefile, glyphNames=(), followIncludes=True, includeDir=None, **kwargs
|
||||
):
|
||||
|
||||
if "glyphMap" in kwargs:
|
||||
from fontTools.misc.loggingTools import deprecateArgument
|
||||
|
||||
@ -1754,7 +1753,8 @@ class Parser(object):
|
||||
|
||||
def parse_featureNames_(self, tag):
|
||||
"""Parses a ``featureNames`` statement found in stylistic set features.
|
||||
See section `8.c <https://adobe-type-tools.github.io/afdko/OpenTypeFeatureFileSpecification.html#8.c>`_."""
|
||||
See section `8.c <https://adobe-type-tools.github.io/afdko/OpenTypeFeatureFileSpecification.html#8.c>`_.
|
||||
"""
|
||||
assert self.cur_token_ == "featureNames", self.cur_token_
|
||||
block = self.ast.NestedBlock(
|
||||
tag, self.cur_token_, location=self.cur_token_location_
|
||||
|
@ -51,7 +51,6 @@ class Merger(object):
|
||||
"""
|
||||
|
||||
def __init__(self, options=None):
|
||||
|
||||
if not options:
|
||||
options = Options()
|
||||
|
||||
|
@ -8,7 +8,6 @@ class Options(object):
|
||||
pass
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
|
||||
self.verbose = False
|
||||
self.timing = False
|
||||
self.drop_tables = []
|
||||
|
@ -9,7 +9,6 @@ class Classifier(object):
|
||||
"""
|
||||
|
||||
def __init__(self, sort=True):
|
||||
|
||||
self._things = set() # set of all things known so far
|
||||
self._sets = [] # list of class sets produced so far
|
||||
self._mapping = {} # map from things to their class set
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
__all__ = ["hashdict"]
|
||||
|
||||
|
||||
# https://stackoverflow.com/questions/1151658/python-hashable-dicts
|
||||
class hashdict(dict):
|
||||
"""
|
||||
|
@ -1092,7 +1092,6 @@ class T1OutlineExtractor(T2OutlineExtractor):
|
||||
|
||||
|
||||
class T2CharString(object):
|
||||
|
||||
operandEncoding = t2OperandEncoding
|
||||
operators, opcodes = buildOperatorDict(t2Operators)
|
||||
decompilerClass = SimpleT2Decompiler
|
||||
@ -1313,7 +1312,6 @@ class T2CharString(object):
|
||||
|
||||
|
||||
class T1CharString(T2CharString):
|
||||
|
||||
operandEncoding = t1OperandEncoding
|
||||
operators, opcodes = buildOperatorDict(t1Operators)
|
||||
|
||||
@ -1347,7 +1345,6 @@ class T1CharString(T2CharString):
|
||||
|
||||
|
||||
class DictDecompiler(object):
|
||||
|
||||
operandEncoding = cffDictOperandEncoding
|
||||
|
||||
def __init__(self, strings, parent=None):
|
||||
|
@ -100,7 +100,6 @@ class PSTokenizer(object):
|
||||
commentmatch=commentRE.match,
|
||||
endmatch=endofthingRE.match,
|
||||
):
|
||||
|
||||
self.skipwhite()
|
||||
if self.pos >= self.len:
|
||||
return None, None
|
||||
|
@ -2,7 +2,6 @@ _accessstrings = {0: "", 1: "readonly", 2: "executeonly", 3: "noaccess"}
|
||||
|
||||
|
||||
class ps_object(object):
|
||||
|
||||
literal = 1
|
||||
access = 0
|
||||
value = None
|
||||
@ -16,7 +15,6 @@ class ps_object(object):
|
||||
|
||||
|
||||
class ps_operator(ps_object):
|
||||
|
||||
literal = 0
|
||||
|
||||
def __init__(self, name, function):
|
||||
|
@ -61,7 +61,6 @@ class _BezierFuncsLazy(dict):
|
||||
|
||||
|
||||
class GreenPen(BasePen):
|
||||
|
||||
_BezierFuncs = {}
|
||||
|
||||
@classmethod
|
||||
@ -115,7 +114,6 @@ MomentXYPen = partial(GreenPen, func=x * y)
|
||||
|
||||
|
||||
def printGreenPen(penName, funcs, file=sys.stdout, docstring=None):
|
||||
|
||||
if docstring is not None:
|
||||
print('"""%s"""' % docstring)
|
||||
|
||||
@ -167,7 +165,6 @@ class %s(BasePen):
|
||||
)
|
||||
|
||||
for n in (1, 2, 3):
|
||||
|
||||
subs = {P[i][j]: [X, Y][j][i] for i in range(n + 1) for j in range(2)}
|
||||
greens = [green(f, BezierCurve[n]) for name, f in funcs]
|
||||
greens = [sp.gcd_terms(f.collect(sum(P, ()))) for f in greens] # Optimize
|
||||
|
@ -4,7 +4,6 @@ import enum
|
||||
|
||||
|
||||
class Visitor(object):
|
||||
|
||||
defaultStop = False
|
||||
|
||||
@classmethod
|
||||
@ -58,7 +57,6 @@ class Visitor(object):
|
||||
typ = type(thing)
|
||||
|
||||
for celf in celf.mro():
|
||||
|
||||
_visitors = getattr(celf, "_visitors", None)
|
||||
if _visitors is None:
|
||||
break
|
||||
|
@ -135,6 +135,7 @@ Pairs = Dict[
|
||||
Tuple[otBase.ValueRecord, otBase.ValueRecord],
|
||||
]
|
||||
|
||||
|
||||
# Adapted from https://github.com/fonttools/fonttools/blob/f64f0b42f2d1163b2d85194e0979def539f5dca3/Lib/fontTools/ttLib/tables/otTables.py#L935-L958
|
||||
def _getClassRanges(glyphIDs: Iterable[int]):
|
||||
glyphIDs = sorted(glyphIDs)
|
||||
@ -274,7 +275,7 @@ class Cluster:
|
||||
)
|
||||
merged_range_count = 0
|
||||
last = None
|
||||
for (start, end) in ranges:
|
||||
for start, end in ranges:
|
||||
if last is not None and start != last + 1:
|
||||
merged_range_count += 1
|
||||
last = end
|
||||
|
@ -199,7 +199,7 @@ class Cu2QuPointPen(BasePointToSegmentPen):
|
||||
# will be appended at the end of the contour
|
||||
last_offcurves = offcurves
|
||||
else:
|
||||
for (pt, smooth, name, kwargs) in offcurves:
|
||||
for pt, smooth, name, kwargs in offcurves:
|
||||
pen.addPoint(pt, None, smooth, name, **kwargs)
|
||||
pt, smooth, name, kwargs = points[-1]
|
||||
if pt is None:
|
||||
@ -212,7 +212,7 @@ class Cu2QuPointPen(BasePointToSegmentPen):
|
||||
pen.addPoint(pt, segment_type, smooth, name, **kwargs)
|
||||
else:
|
||||
raise AssertionError("unexpected segment type: %r" % segment_type)
|
||||
for (pt, smooth, name, kwargs) in last_offcurves:
|
||||
for pt, smooth, name, kwargs in last_offcurves:
|
||||
pen.addPoint(pt, None, smooth, name, **kwargs)
|
||||
pen.endPath()
|
||||
|
||||
|
@ -204,7 +204,6 @@ def subset_glyphs(self, s) -> bool:
|
||||
|
||||
new_docs: List[SVGDocument] = []
|
||||
for doc in self.docList:
|
||||
|
||||
glyphs = {
|
||||
glyph_order[i] for i in range(doc.startGlyphID, doc.endGlyphID + 1)
|
||||
}.intersection(s.glyphs)
|
||||
|
@ -125,7 +125,6 @@ def parse_path(pathdef, pen, current_pos=(0, 0), arc_class=EllipticalArc):
|
||||
have_arcTo = hasattr(pen, "arcTo")
|
||||
|
||||
while elements:
|
||||
|
||||
if elements[-1] in COMMANDS:
|
||||
# New command.
|
||||
last_command = command # Used by S and T
|
||||
|
@ -139,7 +139,6 @@ def visit(visitor, obj, attr, glyphs):
|
||||
|
||||
@ScalerVisitor.register_attr(ttLib.getTableClass("gvar"), "variations")
|
||||
def visit(visitor, obj, attr, variations):
|
||||
|
||||
# VarComposites are a pain to handle :-(
|
||||
glyfTable = visitor.font["glyf"]
|
||||
|
||||
|
@ -524,13 +524,11 @@ class DirectoryEntry(object):
|
||||
|
||||
|
||||
class SFNTDirectoryEntry(DirectoryEntry):
|
||||
|
||||
format = sfntDirectoryEntryFormat
|
||||
formatSize = sfntDirectoryEntrySize
|
||||
|
||||
|
||||
class WOFFDirectoryEntry(DirectoryEntry):
|
||||
|
||||
format = woffDirectoryEntryFormat
|
||||
formatSize = woffDirectoryEntrySize
|
||||
|
||||
@ -571,7 +569,6 @@ class WOFFDirectoryEntry(DirectoryEntry):
|
||||
|
||||
|
||||
class WOFFFlavorData:
|
||||
|
||||
Flavor = "woff"
|
||||
|
||||
def __init__(self, reader=None):
|
||||
|
@ -21,7 +21,6 @@ import struct
|
||||
|
||||
|
||||
class table_C_B_D_T_(E_B_D_T_.table_E_B_D_T_):
|
||||
|
||||
# Change the data locator table being referenced.
|
||||
locatorName = "CBLC"
|
||||
|
||||
@ -42,7 +41,6 @@ def _removeUnsupportedForColor(dataFunctions):
|
||||
|
||||
|
||||
class ColorBitmapGlyph(BitmapGlyph):
|
||||
|
||||
fileExtension = ".png"
|
||||
xmlDataFunctions = _removeUnsupportedForColor(BitmapGlyph.xmlDataFunctions)
|
||||
|
||||
|
@ -6,5 +6,4 @@ from . import E_B_L_C_
|
||||
|
||||
|
||||
class table_C_B_L_C_(E_B_L_C_.table_E_B_L_C_):
|
||||
|
||||
dependencies = ["CBDT"]
|
||||
|
@ -151,7 +151,7 @@ class LayerRecord(object):
|
||||
writer.newline()
|
||||
|
||||
def fromXML(self, eltname, attrs, content, ttFont):
|
||||
for (name, value) in attrs.items():
|
||||
for name, value in attrs.items():
|
||||
if name == "name":
|
||||
setattr(self, name, value)
|
||||
else:
|
||||
|
@ -11,7 +11,6 @@ import sys
|
||||
|
||||
|
||||
class table_C_P_A_L_(DefaultTable.DefaultTable):
|
||||
|
||||
NO_NAME_ID = 0xFFFF
|
||||
DEFAULT_PALETTE_TYPE = 0
|
||||
|
||||
|
@ -3,7 +3,6 @@ from fontTools.ttLib import getClassTag
|
||||
|
||||
|
||||
class DefaultTable(object):
|
||||
|
||||
dependencies = []
|
||||
|
||||
def __init__(self, tag=None):
|
||||
|
@ -38,7 +38,6 @@ ebdtComponentFormat = """
|
||||
|
||||
|
||||
class table_E_B_D_T_(DefaultTable.DefaultTable):
|
||||
|
||||
# Keep a reference to the name of the data locator table.
|
||||
locatorName = "EBLC"
|
||||
|
||||
@ -84,7 +83,6 @@ class table_E_B_D_T_(DefaultTable.DefaultTable):
|
||||
bitmapGlyphDict[curName] = curGlyph
|
||||
|
||||
def compile(self, ttFont):
|
||||
|
||||
dataList = []
|
||||
dataList.append(sstruct.pack(ebdtTableVersionFormat, self))
|
||||
dataSize = len(dataList[0])
|
||||
@ -428,7 +426,6 @@ _bitmapGlyphSubclassPrefix = "ebdt_bitmap_format_"
|
||||
|
||||
|
||||
class BitmapGlyph(object):
|
||||
|
||||
# For the external file format. This can be changed in subclasses. This way
|
||||
# when the extfile option is turned on files have the form: glyphName.ext
|
||||
# The default is just a flat binary file with no meaning.
|
||||
@ -555,6 +552,7 @@ def _createBitmapPlusMetricsMixin(metricsClass):
|
||||
BitmapPlusBigMetricsMixin = _createBitmapPlusMetricsMixin(BigGlyphMetrics)
|
||||
BitmapPlusSmallMetricsMixin = _createBitmapPlusMetricsMixin(SmallGlyphMetrics)
|
||||
|
||||
|
||||
# Data that is bit aligned can be tricky to deal with. These classes implement
|
||||
# helper functionality for dealing with the data and getting a particular row
|
||||
# of bitwise data. Also helps implement fancy data export/import in XML.
|
||||
|
@ -66,7 +66,6 @@ codeOffsetPairSize = struct.calcsize(codeOffsetPairFormat)
|
||||
|
||||
|
||||
class table_E_B_L_C_(DefaultTable.DefaultTable):
|
||||
|
||||
dependencies = ["EBDT"]
|
||||
|
||||
# This method can be overridden in subclasses to support new formats
|
||||
@ -76,7 +75,6 @@ class table_E_B_L_C_(DefaultTable.DefaultTable):
|
||||
return eblc_sub_table_classes[indexFormat]
|
||||
|
||||
def decompile(self, data, ttFont):
|
||||
|
||||
# Save the original data because offsets are from the start of the table.
|
||||
origData = data
|
||||
i = 0
|
||||
@ -138,7 +136,6 @@ class table_E_B_L_C_(DefaultTable.DefaultTable):
|
||||
curStrike.indexSubTables.append(indexSubTable)
|
||||
|
||||
def compile(self, ttFont):
|
||||
|
||||
dataList = []
|
||||
self.numSizes = len(self.strikes)
|
||||
dataList.append(sstruct.pack(eblcHeaderFormat, self))
|
||||
@ -297,7 +294,6 @@ class Strike(object):
|
||||
|
||||
|
||||
class BitmapSizeTable(object):
|
||||
|
||||
# Returns all the simple metric names that bitmap size table
|
||||
# cares about in terms of XML creation.
|
||||
def _getXMLMetricNames(self):
|
||||
@ -476,14 +472,12 @@ class EblcIndexSubTable(object):
|
||||
# are very similar. The only difference between them is the size per offset
|
||||
# value. Code put in here should handle both cases generally.
|
||||
def _createOffsetArrayIndexSubTableMixin(formatStringForDataType):
|
||||
|
||||
# Prep the data size for the offset array data format.
|
||||
dataFormat = ">" + formatStringForDataType
|
||||
offsetDataSize = struct.calcsize(dataFormat)
|
||||
|
||||
class OffsetArrayIndexSubTableMixin(object):
|
||||
def decompile(self):
|
||||
|
||||
numGlyphs = self.lastGlyphIndex - self.firstGlyphIndex + 1
|
||||
indexingOffsets = [
|
||||
glyphIndex * offsetDataSize for glyphIndex in range(numGlyphs + 2)
|
||||
@ -625,7 +619,6 @@ class eblc_index_sub_table_3(
|
||||
|
||||
class eblc_index_sub_table_4(EblcIndexSubTable):
|
||||
def decompile(self):
|
||||
|
||||
(numGlyphs,) = struct.unpack(">L", self.data[:4])
|
||||
data = self.data[4:]
|
||||
indexingOffsets = [
|
||||
|
@ -81,7 +81,6 @@ class GMAPRecord(object):
|
||||
|
||||
|
||||
class table_G_M_A_P_(DefaultTable.DefaultTable):
|
||||
|
||||
dependencies = []
|
||||
|
||||
def decompile(self, data, ttFont):
|
||||
|
@ -68,7 +68,6 @@ def getLabelString(labelID):
|
||||
|
||||
|
||||
class table_M_E_T_A_(DefaultTable.DefaultTable):
|
||||
|
||||
dependencies = []
|
||||
|
||||
def decompile(self, data, ttFont):
|
||||
|
@ -20,7 +20,6 @@ SINGFormat = """
|
||||
|
||||
|
||||
class table_S_I_N_G_(DefaultTable.DefaultTable):
|
||||
|
||||
dependencies = []
|
||||
|
||||
def decompile(self, data, ttFont):
|
||||
|
@ -16,7 +16,6 @@ def fixlongs(glyphID, textLength, textOffset):
|
||||
|
||||
|
||||
class table_T_S_I__0(DefaultTable.DefaultTable):
|
||||
|
||||
dependencies = ["TSI1"]
|
||||
|
||||
def decompile(self, data, ttFont):
|
||||
|
@ -10,7 +10,6 @@ from fontTools.misc.textTools import strjoin, tobytes, tostr
|
||||
|
||||
|
||||
class table_T_S_I__1(LogMixin, DefaultTable.DefaultTable):
|
||||
|
||||
extras = {0xFFFA: "ppgm", 0xFFFB: "cvt", 0xFFFC: "reserved", 0xFFFD: "fpgm"}
|
||||
|
||||
indextable = "TSI0"
|
||||
|
@ -11,5 +11,4 @@ superclass = ttLib.getTableClass("TSI0")
|
||||
|
||||
|
||||
class table_T_S_I__2(superclass):
|
||||
|
||||
dependencies = ["TSI3"]
|
||||
|
@ -9,7 +9,6 @@ superclass = ttLib.getTableClass("TSI1")
|
||||
|
||||
|
||||
class table_T_S_I__3(superclass):
|
||||
|
||||
extras = {
|
||||
0xFFFA: "reserved0",
|
||||
0xFFFB: "reserved1",
|
||||
|
@ -1291,7 +1291,6 @@ class cmap_format_12_or_13(CmapSubtable):
|
||||
|
||||
|
||||
class cmap_format_12(cmap_format_12_or_13):
|
||||
|
||||
_format_step = 1
|
||||
|
||||
def __init__(self, format=12):
|
||||
@ -1305,7 +1304,6 @@ class cmap_format_12(cmap_format_12_or_13):
|
||||
|
||||
|
||||
class cmap_format_13(cmap_format_12_or_13):
|
||||
|
||||
_format_step = 0
|
||||
|
||||
def __init__(self, format=13):
|
||||
|
@ -37,7 +37,6 @@ headFormat = """
|
||||
|
||||
|
||||
class table__h_e_a_d(DefaultTable.DefaultTable):
|
||||
|
||||
dependencies = ["maxp", "loca", "CFF ", "CFF2"]
|
||||
|
||||
def decompile(self, data, ttFont):
|
||||
|
@ -31,7 +31,6 @@ hheaFormat = """
|
||||
|
||||
|
||||
class table__h_h_e_a(DefaultTable.DefaultTable):
|
||||
|
||||
# Note: Keep in sync with table__v_h_e_a
|
||||
|
||||
dependencies = ["hmtx", "glyf", "CFF ", "CFF2"]
|
||||
|
@ -12,7 +12,6 @@ log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class table__h_m_t_x(DefaultTable.DefaultTable):
|
||||
|
||||
headerTag = "hhea"
|
||||
advanceName = "width"
|
||||
sideBearingName = "lsb"
|
||||
|
@ -101,7 +101,6 @@ class table__k_e_r_n(DefaultTable.DefaultTable):
|
||||
|
||||
|
||||
class KernTable_format_0(object):
|
||||
|
||||
# 'version' is kept for backward compatibility
|
||||
version = format = 0
|
||||
|
||||
|
@ -8,7 +8,6 @@ log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class table__l_o_c_a(DefaultTable.DefaultTable):
|
||||
|
||||
dependencies = ["glyf"]
|
||||
|
||||
def decompile(self, data, ttFont):
|
||||
|
@ -27,7 +27,6 @@ maxpFormat_1_0_add = """
|
||||
|
||||
|
||||
class table__m_a_x_p(DefaultTable.DefaultTable):
|
||||
|
||||
dependencies = ["glyf"]
|
||||
|
||||
def decompile(self, data, ttFont):
|
||||
|
@ -31,7 +31,6 @@ vheaFormat = """
|
||||
|
||||
|
||||
class table__v_h_e_a(DefaultTable.DefaultTable):
|
||||
|
||||
# Note: Keep in sync with table__h_h_e_a
|
||||
|
||||
dependencies = ["vmtx", "glyf", "CFF ", "CFF2"]
|
||||
|
@ -4,7 +4,6 @@ superclass = ttLib.getTableClass("hmtx")
|
||||
|
||||
|
||||
class table__v_m_t_x(superclass):
|
||||
|
||||
headerTag = "vhea"
|
||||
advanceName = "height"
|
||||
sideBearingName = "tsb"
|
||||
|
@ -538,7 +538,6 @@ class FeatureParamsCharacterVariants(FeatureParams):
|
||||
|
||||
|
||||
class Coverage(FormatSwitchingBaseTable):
|
||||
|
||||
# manual implementation to get rid of glyphID dependencies
|
||||
|
||||
def populateDefaults(self, propagator=None):
|
||||
|
@ -87,7 +87,6 @@ class TTCollection(object):
|
||||
file.close()
|
||||
|
||||
def saveXML(self, fileOrPath, newlinestr="\n", writeVersion=True, **kwargs):
|
||||
|
||||
from fontTools.misc import xmlWriter
|
||||
|
||||
writer = xmlWriter.XMLWriter(fileOrPath, newlinestr=newlinestr)
|
||||
|
@ -287,7 +287,6 @@ class TTFont(object):
|
||||
disassembleInstructions=True,
|
||||
bitmapGlyphDataFormat="raw",
|
||||
):
|
||||
|
||||
if quiet is not None:
|
||||
deprecateArgument("quiet", "configure logging instead")
|
||||
|
||||
|
@ -170,7 +170,6 @@ class _TTGlyphGlyf(_TTGlyph):
|
||||
glyph, offset = self._getGlyphAndOffset()
|
||||
|
||||
with self.glyphSet.pushDepth() as depth:
|
||||
|
||||
if depth:
|
||||
offset = 0 # Offset should only apply at top-level
|
||||
|
||||
@ -187,7 +186,6 @@ class _TTGlyphGlyf(_TTGlyph):
|
||||
glyph, offset = self._getGlyphAndOffset()
|
||||
|
||||
with self.glyphSet.pushDepth() as depth:
|
||||
|
||||
if depth:
|
||||
offset = 0 # Offset should only apply at top-level
|
||||
|
||||
@ -198,14 +196,12 @@ class _TTGlyphGlyf(_TTGlyph):
|
||||
glyph.drawPoints(pen, self.glyphSet.glyfTable, offset)
|
||||
|
||||
def _drawVarComposite(self, glyph, pen, isPointPen):
|
||||
|
||||
from fontTools.ttLib.tables._g_l_y_f import (
|
||||
VarComponentFlags,
|
||||
VAR_COMPONENT_TRANSFORM_MAPPING,
|
||||
)
|
||||
|
||||
for comp in glyph.components:
|
||||
|
||||
with self.glyphSet.pushLocation(
|
||||
comp.location, comp.flags & VarComponentFlags.RESET_UNSPECIFIED_AXES
|
||||
):
|
||||
|
@ -42,7 +42,6 @@ except ImportError:
|
||||
|
||||
|
||||
class WOFF2Reader(SFNTReader):
|
||||
|
||||
flavor = "woff2"
|
||||
|
||||
def __init__(self, file, checkChecksums=0, fontNumber=-1):
|
||||
@ -177,7 +176,6 @@ class WOFF2Reader(SFNTReader):
|
||||
|
||||
|
||||
class WOFF2Writer(SFNTWriter):
|
||||
|
||||
flavor = "woff2"
|
||||
|
||||
def __init__(
|
||||
@ -1291,7 +1289,6 @@ class WOFF2HmtxTable(getTableClass("hmtx")):
|
||||
|
||||
|
||||
class WOFF2FlavorData(WOFFFlavorData):
|
||||
|
||||
Flavor = "woff2"
|
||||
|
||||
def __init__(self, reader=None, data=None, transformedTables=None):
|
||||
|
@ -124,7 +124,6 @@ opentypeheaderRE = re.compile("""sfntVersion=['"]OTTO["']""")
|
||||
|
||||
|
||||
class Options(object):
|
||||
|
||||
listTables = False
|
||||
outputDir = None
|
||||
outputFile = None
|
||||
|
@ -248,7 +248,6 @@ class VariationModel(object):
|
||||
"""
|
||||
|
||||
def __init__(self, locations, axisOrder=None, extrapolate=False):
|
||||
|
||||
if len(set(tuple(sorted(l.items())) for l in locations)) != len(locations):
|
||||
raise VariationModelError("Locations must be unique.")
|
||||
|
||||
|
@ -30,7 +30,6 @@ tables.sort()
|
||||
|
||||
|
||||
with open(os.path.join(tablesDir, "__init__.py"), "w") as file:
|
||||
|
||||
file.write(
|
||||
'''
|
||||
# DON'T EDIT! This file is generated by MetaTools/buildTableList.py.
|
||||
|
@ -85,7 +85,7 @@ def AddGlyphVariations(font, thin, regular, black):
|
||||
continue
|
||||
thinDelta = []
|
||||
blackDelta = []
|
||||
for ((regX, regY), (blackX, blackY), (thinX, thinY)) in zip(
|
||||
for (regX, regY), (blackX, blackY), (thinX, thinY) in zip(
|
||||
regularCoord, blackCoord, thinCoord
|
||||
):
|
||||
thinDelta.append(((thinX - regX, thinY - regY)))
|
||||
|
@ -139,7 +139,6 @@ def visit(self, obj):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
from fontTools.ttLib import TTFont
|
||||
import sys
|
||||
|
||||
|
@ -4,7 +4,6 @@ from fontTools.misc.encodingTools import getEncoding
|
||||
|
||||
class EncodingTest(unittest.TestCase):
|
||||
def test_encoding_unicode(self):
|
||||
|
||||
self.assertEqual(
|
||||
getEncoding(3, 0, None), "utf_16_be"
|
||||
) # MS Symbol is Unicode as well
|
||||
|
@ -120,7 +120,7 @@ class T2CharStringTest(unittest.TestCase):
|
||||
(-456.8, "ff fe 37 33 33", -456.8000031),
|
||||
]
|
||||
|
||||
for (value, expected_hex, expected_float) in testNums:
|
||||
for value, expected_hex, expected_float in testNums:
|
||||
encoded_result = encodeFixed(value)
|
||||
|
||||
# check to see if we got the expected bytes
|
||||
|
@ -394,7 +394,6 @@ class IsCloseTests(unittest.TestCase):
|
||||
|
||||
|
||||
class TestRedirectStream:
|
||||
|
||||
redirect_stream = None
|
||||
orig_stream = None
|
||||
|
||||
@ -444,13 +443,11 @@ class TestRedirectStream:
|
||||
|
||||
|
||||
class TestRedirectStdout(TestRedirectStream, unittest.TestCase):
|
||||
|
||||
redirect_stream = redirect_stdout
|
||||
orig_stream = "stdout"
|
||||
|
||||
|
||||
class TestRedirectStderr(TestRedirectStream, unittest.TestCase):
|
||||
|
||||
redirect_stream = redirect_stderr
|
||||
orig_stream = "stderr"
|
||||
|
||||
|
@ -15,7 +15,6 @@ def set_lookup_debug_env_var(monkeypatch):
|
||||
|
||||
|
||||
class MtiTest:
|
||||
|
||||
GLYPH_ORDER = [
|
||||
".notdef",
|
||||
"a",
|
||||
@ -425,7 +424,6 @@ class MtiTest:
|
||||
return font
|
||||
|
||||
def check_mti_file(self, name, tableTag=None):
|
||||
|
||||
xml_expected_path = self.getpath(
|
||||
"%s.ttx" % name + ("." + tableTag if tableTag is not None else "")
|
||||
)
|
||||
|
@ -339,7 +339,6 @@ pen.endPath()""".splitlines(),
|
||||
|
||||
class TestCu2QuMultiPen(unittest.TestCase):
|
||||
def test_multi_pen(self):
|
||||
|
||||
pens = [RecordingPen(), RecordingPen()]
|
||||
pen = Cu2QuMultiPen(pens, 0.1)
|
||||
pen.moveTo([((0, 0),), ((0, 0),)])
|
||||
|
@ -615,11 +615,9 @@ class CubicGlyfTest:
|
||||
ppen.endPath()
|
||||
|
||||
for pen in (spen, ppen):
|
||||
|
||||
glyph = pen.glyph()
|
||||
|
||||
for i in range(2):
|
||||
|
||||
if i == 1:
|
||||
glyph.compile(None)
|
||||
|
||||
@ -797,7 +795,6 @@ class CubicGlyfTest:
|
||||
rpen.replay(ppen)
|
||||
|
||||
for pen in (spen, ppen):
|
||||
|
||||
glyph = pen.glyph(dropImpliedOnCurves=dropImpliedOnCurves)
|
||||
|
||||
assert list(glyph.coordinates) == expected_coordinates
|
||||
|
@ -75,7 +75,6 @@ class Qu2CuTest:
|
||||
],
|
||||
)
|
||||
def test_simple(self, quadratics, expected, tolerance, cubic_only):
|
||||
|
||||
expected = [
|
||||
tuple((pytest.approx(p[0]), pytest.approx(p[1])) for p in curve)
|
||||
for curve in expected
|
||||
@ -85,7 +84,6 @@ class Qu2CuTest:
|
||||
assert c == expected
|
||||
|
||||
def test_roundtrip(self):
|
||||
|
||||
DATADIR = os.path.join(os.path.dirname(__file__), "..", "cu2qu", "data")
|
||||
with open(os.path.join(DATADIR, "curves.json"), "r") as fp:
|
||||
curves = json.load(fp)
|
||||
|
@ -56,7 +56,6 @@ class ScaleUpemTest(unittest.TestCase):
|
||||
self.fail("TTX output is different from expected")
|
||||
|
||||
def test_scale_upem_ttf(self):
|
||||
|
||||
font = TTFont(self.get_path("I.ttf"))
|
||||
tables = [table_tag for table_tag in font.keys() if table_tag != "head"]
|
||||
|
||||
@ -66,7 +65,6 @@ class ScaleUpemTest(unittest.TestCase):
|
||||
self.expect_ttx(font, expected_ttx_path, tables)
|
||||
|
||||
def test_scale_upem_varComposite(self):
|
||||
|
||||
font = TTFont(self.get_path("varc-ac00-ac01.ttf"))
|
||||
tables = [table_tag for table_tag in font.keys() if table_tag != "head"]
|
||||
|
||||
@ -80,7 +78,6 @@ class ScaleUpemTest(unittest.TestCase):
|
||||
scale_upem(font, 500)
|
||||
|
||||
def test_scale_upem_otf(self):
|
||||
|
||||
# Just test that it doesn't crash
|
||||
|
||||
font = TTFont(self.get_path("TestVGID-Regular.otf"))
|
||||
|
@ -101,7 +101,6 @@ class AxisVariationTableTest(unittest.TestCase):
|
||||
|
||||
class Avar2Test(unittest.TestCase):
|
||||
def test(self):
|
||||
|
||||
axisTags = ["wght", "wdth"]
|
||||
fvar = table__f_v_a_r()
|
||||
for tag in axisTags:
|
||||
|
@ -62,7 +62,7 @@ CVAR_VARIATIONS = [
|
||||
class CVARTableTest(unittest.TestCase):
|
||||
def assertVariationsAlmostEqual(self, variations1, variations2):
|
||||
self.assertEqual(len(variations1), len(variations2))
|
||||
for (v1, v2) in zip(variations1, variations2):
|
||||
for v1, v2 in zip(variations1, variations2):
|
||||
self.assertSetEqual(set(v1.axes), set(v2.axes))
|
||||
for axisTag, support1 in v1.axes.items():
|
||||
support2 = v2.axes[axisTag]
|
||||
|
@ -137,7 +137,7 @@ class GVARTableTest(unittest.TestCase):
|
||||
for glyphName, variations1 in vars1.items():
|
||||
variations2 = vars2[glyphName]
|
||||
self.assertEqual(len(variations1), len(variations2))
|
||||
for (v1, v2) in zip(variations1, variations2):
|
||||
for v1, v2 in zip(variations1, variations2):
|
||||
self.assertSetEqual(set(v1.axes), set(v2.axes))
|
||||
for axisTag, support1 in v1.axes.items():
|
||||
support2 = v2.axes[axisTag]
|
||||
|
@ -7,7 +7,6 @@ from fontTools.ttLib import newTable
|
||||
|
||||
|
||||
class Test_l_t_a_g(unittest.TestCase):
|
||||
|
||||
DATA_ = (
|
||||
struct.pack(b">LLLHHHHHH", 1, 0, 3, 24 + 0, 2, 24 + 2, 7, 24 + 2, 2)
|
||||
+ b"enzh-Hant"
|
||||
|
@ -27,7 +27,6 @@ class TTVisitorTest(object):
|
||||
return os.path.join(path, "data", testfile)
|
||||
|
||||
def test_ttvisitor(self):
|
||||
|
||||
font = TTFont(self.getpath("TestVGID-Regular.otf"))
|
||||
visitor = TestVisitor()
|
||||
|
||||
|
@ -4712,7 +4712,6 @@ class UFO3WriteDataTestCase(unittest.TestCase):
|
||||
|
||||
|
||||
class TestLayerInfoObject:
|
||||
|
||||
color = guidelines = lib = None
|
||||
|
||||
|
||||
|
@ -125,7 +125,6 @@ class TestInfoObject:
|
||||
|
||||
|
||||
class KerningUpConversionTestCase(unittest.TestCase):
|
||||
|
||||
expectedKerning = {
|
||||
("public.kern1.BGroup", "public.kern2.CGroup"): 7,
|
||||
("public.kern1.BGroup", "public.kern2.DGroup"): 8,
|
||||
@ -239,7 +238,6 @@ class KerningUpConversionTestCase(unittest.TestCase):
|
||||
|
||||
|
||||
class KerningDownConversionTestCase(unittest.TestCase):
|
||||
|
||||
expectedKerning = {
|
||||
("public.kern1.BGroup", "public.kern2.CGroup"): 7,
|
||||
("public.kern1.BGroup", "public.kern2.DGroup"): 8,
|
||||
|
@ -111,7 +111,6 @@ def test_overlayBox():
|
||||
|
||||
|
||||
def run(test, n, quiet):
|
||||
|
||||
print()
|
||||
print("%s:" % test.__name__)
|
||||
input, output = test(n)
|
||||
|
@ -4,7 +4,6 @@ import pytest
|
||||
|
||||
|
||||
class IupTest:
|
||||
|
||||
# -----
|
||||
# Tests
|
||||
# -----
|
||||
|
@ -5,4 +5,4 @@ sphinx>=1.5.5
|
||||
mypy>=0.782
|
||||
|
||||
# Pin black as each version could change formatting, breaking CI randomly.
|
||||
black==22.12.0
|
||||
black==23.10.0
|
||||
|
@ -2,8 +2,8 @@
|
||||
# extension 'brotlipy' on PyPy
|
||||
brotli==1.1.0; platform_python_implementation != "PyPy"
|
||||
brotlicffi==1.1.0.0; platform_python_implementation == "PyPy"
|
||||
unicodedata2==15.0.0; python_version <= '3.11'
|
||||
scipy==1.10.0; platform_python_implementation != "PyPy" and python_version <= '3.8'
|
||||
unicodedata2==15.1.0; python_version <= '3.11'
|
||||
scipy==1.10.0; platform_python_implementation != "PyPy" and python_version <= '3.8' # pyup: ignore
|
||||
scipy==1.11.3; platform_python_implementation != "PyPy" and python_version >= '3.9'
|
||||
munkres==1.1.4; platform_python_implementation == "PyPy"
|
||||
zopfli==0.2.3
|
||||
@ -15,5 +15,5 @@ ufo2ft==2.33.4
|
||||
pyobjc==10.0; sys_platform == "darwin"
|
||||
freetype-py==2.4.0
|
||||
uharfbuzz==0.37.3
|
||||
glyphsLib==6.4.0 # this is only required to run Tests/varLib/interpolatable_test.py
|
||||
glyphsLib==6.4.1 # this is only required to run Tests/varLib/interpolatable_test.py
|
||||
lxml==4.9.3
|
||||
|
Loading…
x
Reference in New Issue
Block a user