Skip to content

Commit

Permalink
Merge pull request #3438 from fonttools/pyup-scheduled-update-2024-02-05
Browse files Browse the repository at this point in the history
Scheduled weekly dependency update for week 05
  • Loading branch information
khaledhosny committed Feb 6, 2024
2 parents 216923c + cf08265 commit 534ceed
Show file tree
Hide file tree
Showing 67 changed files with 104 additions and 116 deletions.
2 changes: 1 addition & 1 deletion Doc/docs-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sphinx==7.2.6
sphinx_rtd_theme==2.0.0
reportlab==4.0.8
reportlab==4.0.9
freetype-py==2.4.0
1 change: 0 additions & 1 deletion Lib/fontTools/afmLib.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
"""


import re

# every single line starts with a "word"
Expand Down
1 change: 0 additions & 1 deletion Lib/fontTools/cffLib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2880,7 +2880,6 @@ def getNumRegions(self, vi=None): # called from misc/psCharStrings.py


class IndexedStrings(object):

"""SID -> string mapping."""

def __init__(self, file=None):
Expand Down
15 changes: 10 additions & 5 deletions Lib/fontTools/colorLib/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
colorLib.builder: Build COLR/CPAL tables from scratch
"""

import collections
import copy
import enum
Expand Down Expand Up @@ -298,11 +299,15 @@ def buildPaletteLabels(
labels: Iterable[_OptionalLocalizedString], nameTable: _n_a_m_e.table__n_a_m_e
) -> List[Optional[int]]:
return [
nameTable.addMultilingualName(l, mac=False)
if isinstance(l, dict)
else C_P_A_L_.table_C_P_A_L_.NO_NAME_ID
if l is None
else nameTable.addMultilingualName({"en": l}, mac=False)
(
nameTable.addMultilingualName(l, mac=False)
if isinstance(l, dict)
else (
C_P_A_L_.table_C_P_A_L_.NO_NAME_ID
if l is None
else nameTable.addMultilingualName({"en": l}, mac=False)
)
)
for l in labels
]

Expand Down
1 change: 1 addition & 0 deletions Lib/fontTools/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
An instance of the Config class can be attached to a TTFont object, so that
the various modules can access their configuration options from it.
"""

from textwrap import dedent

from fontTools.misc.configTools import *
Expand Down
24 changes: 12 additions & 12 deletions Lib/fontTools/designspaceLib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1434,9 +1434,9 @@ def write(self, pretty=True, encoding="UTF-8", xml_declaration=True):
):
axesElement = ET.Element("axes")
if self.documentObject.elidedFallbackName is not None:
axesElement.attrib[
"elidedfallbackname"
] = self.documentObject.elidedFallbackName
axesElement.attrib["elidedfallbackname"] = (
self.documentObject.elidedFallbackName
)
self.root.append(axesElement)
for axisObject in self.documentObject.axes:
self._addAxis(axisObject)
Expand Down Expand Up @@ -1776,17 +1776,17 @@ def _addInstance(self, instanceObject):
if instanceObject.filename is not None:
instanceElement.attrib["filename"] = instanceObject.filename
if instanceObject.postScriptFontName is not None:
instanceElement.attrib[
"postscriptfontname"
] = instanceObject.postScriptFontName
instanceElement.attrib["postscriptfontname"] = (
instanceObject.postScriptFontName
)
if instanceObject.styleMapFamilyName is not None:
instanceElement.attrib[
"stylemapfamilyname"
] = instanceObject.styleMapFamilyName
instanceElement.attrib["stylemapfamilyname"] = (
instanceObject.styleMapFamilyName
)
if instanceObject.styleMapStyleName is not None:
instanceElement.attrib[
"stylemapstylename"
] = instanceObject.styleMapStyleName
instanceElement.attrib["stylemapstylename"] = (
instanceObject.styleMapStyleName
)
if self.effectiveFormatTuple < (5, 0):
# Deprecated members as of version 5.0
if instanceObject.glyphs:
Expand Down
1 change: 1 addition & 0 deletions Lib/fontTools/designspaceLib/statNames.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
names = getStatNames(doc, instance.getFullUserLocation(doc))
print(names.styleNames)
"""

from __future__ import annotations

from dataclasses import dataclass
Expand Down
16 changes: 6 additions & 10 deletions Lib/fontTools/merge/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,20 +169,16 @@ def mergeScriptRecords(lst):
"BaselineTag": sumLists,
}

otTables.GDEF.mergeMap = (
otTables.GSUB.mergeMap
) = (
otTables.GPOS.mergeMap
) = otTables.BASE.mergeMap = otTables.JSTF.mergeMap = otTables.MATH.mergeMap = {
otTables.GDEF.mergeMap = otTables.GSUB.mergeMap = otTables.GPOS.mergeMap = (
otTables.BASE.mergeMap
) = otTables.JSTF.mergeMap = otTables.MATH.mergeMap = {
"*": mergeObjects,
"Version": max,
}

ttLib.getTableClass("GDEF").mergeMap = ttLib.getTableClass(
"GSUB"
).mergeMap = ttLib.getTableClass("GPOS").mergeMap = ttLib.getTableClass(
"BASE"
).mergeMap = ttLib.getTableClass(
ttLib.getTableClass("GDEF").mergeMap = ttLib.getTableClass("GSUB").mergeMap = (
ttLib.getTableClass("GPOS").mergeMap
) = ttLib.getTableClass("BASE").mergeMap = ttLib.getTableClass(
"JSTF"
).mergeMap = ttLib.getTableClass(
"MATH"
Expand Down
1 change: 0 additions & 1 deletion Lib/fontTools/misc/classifyTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@


class Classifier(object):

"""
Main Classifier object, used to classify things into similar sets.
"""
Expand Down
1 change: 1 addition & 0 deletions Lib/fontTools/misc/cliTools.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Collection of utilities for command-line interfaces and console scripts."""

import os
import re

Expand Down
1 change: 1 addition & 0 deletions Lib/fontTools/misc/configTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
``options`` class variable set to your instance of Options.
"""

from __future__ import annotations

import logging
Expand Down
1 change: 0 additions & 1 deletion Lib/fontTools/misc/dictTools.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Misc dict tools."""


__all__ = ["hashdict"]


Expand Down
1 change: 1 addition & 0 deletions Lib/fontTools/misc/etree.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
only availble in lxml, like OrderedDict for attributes, pretty_print and
iterwalk.
"""

from fontTools.misc.textTools import tostr


Expand Down
1 change: 0 additions & 1 deletion Lib/fontTools/misc/filenames.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
- Just van Rossum
"""


illegalCharacters = r"\" * + / : < > ? [ \ ] | \0".split(" ")
illegalCharacters += [chr(i) for i in range(1, 32)]
illegalCharacters += [chr(0x7F)]
Expand Down
1 change: 0 additions & 1 deletion Lib/fontTools/misc/textTools.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""fontTools.misc.textTools.py -- miscellaneous routines."""


import ast
import string

Expand Down
1 change: 0 additions & 1 deletion Lib/fontTools/misc/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ def _normSinCos(v):


class Transform(NamedTuple):

"""2x2 transformation matrix plus offset, a.k.a. Affine transform.
Transform instances are immutable: all transforming methods, eg.
rotate(), return a new Transform instance.
Expand Down
1 change: 0 additions & 1 deletion Lib/fontTools/misc/vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class Vector(tuple):

"""A math-like vector.
Represents an n-dimensional numeric vector. ``Vector`` objects support
Expand Down
3 changes: 0 additions & 3 deletions Lib/fontTools/pens/basePen.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ def addVarComponent(


class NullPen(AbstractPen):

"""A pen that does nothing."""

def moveTo(self, pt):
Expand Down Expand Up @@ -187,7 +186,6 @@ class MissingComponentError(KeyError):


class DecomposingPen(LoggingPen):

"""Implements a 'addComponent' method that decomposes components
(i.e. draws them onto self as simple contours).
It can also be used as a mixin class (e.g. see ContourRecordingPen).
Expand Down Expand Up @@ -229,7 +227,6 @@ def addVarComponent(self, glyphName, transformation, location):


class BasePen(DecomposingPen):

"""Base class for drawing pens. You must override _moveTo, _lineTo and
_curveToOne. You may additionally override _closePath, _endPath,
addComponent, addVarComponent, and/or _qCurveToOne. You should not
Expand Down
2 changes: 0 additions & 2 deletions Lib/fontTools/pens/boundsPen.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class ControlBoundsPen(BasePen):

"""Pen to calculate the "control bounds" of a shape. This is the
bounding box of all control points, so may be larger than the
actual bounding box if there are curves that don't have points
Expand Down Expand Up @@ -67,7 +66,6 @@ def _qCurveToOne(self, bcp, pt):


class BoundsPen(ControlBoundsPen):

"""Pen to calculate the bounds of a shape. It calculates the
correct bounds even when the shape contains curves that don't
have points on their extremes. This is somewhat slower to compute
Expand Down
1 change: 0 additions & 1 deletion Lib/fontTools/pens/filterPen.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ def addComponent(self, glyphName, transformation, **kwargs):


class FilterPen(_PassThruComponentsMixin, AbstractPen):

"""Base class for pens that apply some transformation to the coordinates
they receive and pass them to another pen.
Expand Down
1 change: 0 additions & 1 deletion Lib/fontTools/pens/pointInsidePen.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@


class PointInsidePen(BasePen):

"""This pen implements "point inside" testing: to test whether
a given point lies inside the shape (black) or outside (white).
Instances of this class can be recycled, as long as the
Expand Down
1 change: 0 additions & 1 deletion Lib/fontTools/pens/quartzPen.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@


class QuartzPen(BasePen):

"""A pen that creates a CGPath
Parameters
Expand Down
1 change: 1 addition & 0 deletions Lib/fontTools/pens/recordingPen.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Pen recording operations that can be accessed or replayed."""

from fontTools.pens.basePen import AbstractPen, DecomposingPen
from fontTools.pens.pointPen import AbstractPointPen

Expand Down
1 change: 0 additions & 1 deletion Lib/fontTools/pens/reportLabPen.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class ReportLabPen(BasePen):

"""A pen for drawing onto a ``reportlab.graphics.shapes.Path`` object."""

def __init__(self, glyphSet, path=None):
Expand Down
3 changes: 1 addition & 2 deletions Lib/fontTools/pens/statisticsPen.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Pen calculating area, center of mass, variance and standard-deviation,
covariance and correlation, and slant, of glyph shapes."""

from math import sqrt, degrees, atan
from fontTools.pens.basePen import BasePen, OpenContourError
from fontTools.pens.momentsPen import MomentsPen
Expand Down Expand Up @@ -52,7 +53,6 @@ def _update(self):


class StatisticsPen(StatisticsBase, MomentsPen):

"""Pen calculating area, center of mass, variance and
standard-deviation, covariance and correlation, and slant,
of glyph shapes.
Expand Down Expand Up @@ -91,7 +91,6 @@ def _update(self):


class StatisticsControlPen(StatisticsBase, BasePen):

"""Pen calculating area, center of mass, variance and
standard-deviation, covariance and correlation, and slant,
of glyph shapes, using the control polygon only.
Expand Down
1 change: 1 addition & 0 deletions Lib/fontTools/pens/teePen.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Pen multiplexing drawing to one or more pens."""

from fontTools.pens.basePen import AbstractPen


Expand Down
1 change: 0 additions & 1 deletion Lib/fontTools/pens/transformPen.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class TransformPen(FilterPen):

"""Pen that transforms all coordinates using a Affine transformation,
and passes them to another pen.
"""
Expand Down
1 change: 1 addition & 0 deletions Lib/fontTools/svgLib/path/arc.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
https://github.com/chromium/chromium/blob/93831f2/third_party/
blink/renderer/core/svg/svg_path_parser.cc#L169-L278
"""

from fontTools.misc.transform import Identity, Scale
from math import atan2, ceil, cos, fabs, isfinite, pi, radians, sin, sqrt, tan

Expand Down
2 changes: 1 addition & 1 deletion Lib/fontTools/t1Lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
part should be written as hexadecimal or binary, but only if kind
is 'OTHER'.
"""

import fontTools
from fontTools.misc import eexec
from fontTools.misc.macCreatorType import getMacCreatorAndType
Expand Down Expand Up @@ -49,7 +50,6 @@ class T1Error(Exception):


class T1Font(object):

"""Type 1 font class.
Uses a minimal interpeter that supports just about enough PS to parse
Expand Down
2 changes: 1 addition & 1 deletion Lib/fontTools/ttLib/macUtils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""ttLib.macUtils.py -- Various Mac-specific stuff."""

from io import BytesIO
from fontTools.misc.macRes import ResourceReader, ResourceError

Expand Down Expand Up @@ -35,7 +36,6 @@ def openTTFonts(path):


class SFNTResourceReader(BytesIO):

"""Simple read-only file wrapper for 'sfnt' resources."""

def __init__(self, path, res_name_or_index):
Expand Down
8 changes: 5 additions & 3 deletions Lib/fontTools/ttLib/removeOverlaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,11 @@ def removeOverlaps(
glyphNames = sorted(
glyphNames,
key=lambda name: (
glyfTable[name].getCompositeMaxpValues(glyfTable).maxComponentDepth
if glyfTable[name].isComposite()
else 0,
(
glyfTable[name].getCompositeMaxpValues(glyfTable).maxComponentDepth
if glyfTable[name].isComposite()
else 0
),
name,
),
)
Expand Down
1 change: 0 additions & 1 deletion Lib/fontTools/ttLib/scaleUpem.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
AAT and Graphite tables are not supported. CFF/CFF2 fonts
are de-subroutinized."""


from fontTools.ttLib.ttVisitor import TTVisitor
import fontTools.ttLib as ttLib
import fontTools.ttLib.tables.otBase as otBase
Expand Down
1 change: 0 additions & 1 deletion Lib/fontTools/ttLib/tables/C_O_L_R_.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class table_C_O_L_R_(DefaultTable.DefaultTable):

"""This table is structured so that you can treat it like a dictionary keyed by glyph name.
``ttFont['COLR'][<glyphName>]`` will return the color layers for any glyph.
Expand Down
1 change: 0 additions & 1 deletion Lib/fontTools/ttLib/tables/O_S_2f_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ def fromXML(self, name, attrs, content, ttFont):


class table_O_S_2f_2(DefaultTable.DefaultTable):

"""the OS/2 table"""

dependencies = ["head"]
Expand Down

0 comments on commit 534ceed

Please sign in to comment.