aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2024-07-20 07:38:40 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2024-07-20 07:58:13 +0300
commit7d21c95992e12e49a9afe45263936a45fb902b6e (patch)
tree567f7119eaccd4c2dfd9be500066a7b904cc0279 /contrib/python
parent1eafc358f721395d1eac1a4480f51ee78c966485 (diff)
downloadydb-7d21c95992e12e49a9afe45263936a45fb902b6e.tar.gz
Intermediate changes
Diffstat (limited to 'contrib/python')
-rw-r--r--contrib/python/fonttools/.dist-info/METADATA12
-rw-r--r--contrib/python/fonttools/README.rst3
-rw-r--r--contrib/python/fonttools/fontTools/__init__.py2
-rw-r--r--contrib/python/fonttools/fontTools/feaLib/builder.py20
-rw-r--r--contrib/python/fonttools/fontTools/misc/visitor.py7
-rw-r--r--contrib/python/fonttools/fontTools/otlLib/builder.py10
-rw-r--r--contrib/python/fonttools/fontTools/otlLib/maxContextCalc.py2
-rw-r--r--contrib/python/fonttools/ya.make2
8 files changed, 41 insertions, 17 deletions
diff --git a/contrib/python/fonttools/.dist-info/METADATA b/contrib/python/fonttools/.dist-info/METADATA
index 832b0598ab..6694a8733c 100644
--- a/contrib/python/fonttools/.dist-info/METADATA
+++ b/contrib/python/fonttools/.dist-info/METADATA
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: fonttools
-Version: 4.53.0
+Version: 4.53.1
Summary: Tools to manipulate font files
Home-page: http://github.com/fonttools/fonttools
Author: Just van Rossum
@@ -306,7 +306,8 @@ How to make a new release
2) Use semantic versioning to decide whether the new release will be a 'major',
'minor' or 'patch' release. It's usually one of the latter two, depending on
whether new backward compatible APIs were added, or simply some bugs were fixed.
-3) Run ``python setup.py release`` command from the tip of the ``main`` branch.
+3) From inside a venv, first do ``pip install -r dev-requirements.txt``, then run
+ the ``python setup.py release`` command from the tip of the ``main`` branch.
By default this bumps the third or 'patch' digit only, unless you pass ``--major``
or ``--minor`` to bump respectively the first or second digit.
This bumps the package version string, extracts the changes since the latest
@@ -375,6 +376,13 @@ Have fun!
Changelog
~~~~~~~~~
+4.53.1 (released 2024-07-05)
+----------------------------
+
+- [feaLib] Improve the sharing of inline chained lookups (#3559)
+- [otlLib] Correct the calculation of OS/2.usMaxContext with reversed chaining contextual single substitutions (#3569)
+- [misc.visitor] Visitors search the inheritance chain of objects they are visiting (#3581)
+
4.53.0 (released 2024-05-31)
----------------------------
diff --git a/contrib/python/fonttools/README.rst b/contrib/python/fonttools/README.rst
index 2274fbdc69..b604ea7ca5 100644
--- a/contrib/python/fonttools/README.rst
+++ b/contrib/python/fonttools/README.rst
@@ -232,7 +232,8 @@ How to make a new release
2) Use semantic versioning to decide whether the new release will be a 'major',
'minor' or 'patch' release. It's usually one of the latter two, depending on
whether new backward compatible APIs were added, or simply some bugs were fixed.
-3) Run ``python setup.py release`` command from the tip of the ``main`` branch.
+3) From inside a venv, first do ``pip install -r dev-requirements.txt``, then run
+ the ``python setup.py release`` command from the tip of the ``main`` branch.
By default this bumps the third or 'patch' digit only, unless you pass ``--major``
or ``--minor`` to bump respectively the first or second digit.
This bumps the package version string, extracts the changes since the latest
diff --git a/contrib/python/fonttools/fontTools/__init__.py b/contrib/python/fonttools/fontTools/__init__.py
index 0de5c155e3..f2c62f124b 100644
--- a/contrib/python/fonttools/fontTools/__init__.py
+++ b/contrib/python/fonttools/fontTools/__init__.py
@@ -3,6 +3,6 @@ from fontTools.misc.loggingTools import configLogger
log = logging.getLogger(__name__)
-version = __version__ = "4.53.0"
+version = __version__ = "4.53.1"
__all__ = ["version", "log", "configLogger"]
diff --git a/contrib/python/fonttools/fontTools/feaLib/builder.py b/contrib/python/fonttools/fontTools/feaLib/builder.py
index a91381ddc1..bda855e1e9 100644
--- a/contrib/python/fonttools/fontTools/feaLib/builder.py
+++ b/contrib/python/fonttools/fontTools/feaLib/builder.py
@@ -1286,10 +1286,7 @@ class Builder(object):
self, location, prefix, glyph, suffix, replacements, forceChain=False
):
if prefix or suffix or forceChain:
- chain = self.get_lookup_(location, ChainContextSubstBuilder)
- sub = self.get_chained_lookup_(location, MultipleSubstBuilder)
- sub.mapping[glyph] = replacements
- chain.rules.append(ChainContextualRule(prefix, [{glyph}], suffix, [sub]))
+ self.add_multi_subst_chained_(location, prefix, glyph, suffix, replacements)
return
lookup = self.get_lookup_(location, MultipleSubstBuilder)
if glyph in lookup.mapping:
@@ -1369,7 +1366,7 @@ class Builder(object):
# https://github.com/fonttools/fonttools/issues/512
# https://github.com/fonttools/fonttools/issues/2150
chain = self.get_lookup_(location, ChainContextSubstBuilder)
- sub = chain.find_chainable_single_subst(mapping)
+ sub = chain.find_chainable_subst(mapping, SingleSubstBuilder)
if sub is None:
sub = self.get_chained_lookup_(location, SingleSubstBuilder)
sub.mapping.update(mapping)
@@ -1377,6 +1374,19 @@ class Builder(object):
ChainContextualRule(prefix, [list(mapping.keys())], suffix, [sub])
)
+ def add_multi_subst_chained_(self, location, prefix, glyph, suffix, replacements):
+ if not all(prefix) or not all(suffix):
+ raise FeatureLibError(
+ "Empty glyph class in contextual substitution", location
+ )
+ # https://github.com/fonttools/fonttools/issues/3551
+ chain = self.get_lookup_(location, ChainContextSubstBuilder)
+ sub = chain.find_chainable_subst({glyph: replacements}, MultipleSubstBuilder)
+ if sub is None:
+ sub = self.get_chained_lookup_(location, MultipleSubstBuilder)
+ sub.mapping[glyph] = replacements
+ chain.rules.append(ChainContextualRule(prefix, [{glyph}], suffix, [sub]))
+
# GSUB 8
def add_reverse_chain_single_subst(self, location, old_prefix, old_suffix, mapping):
if not mapping:
diff --git a/contrib/python/fonttools/fontTools/misc/visitor.py b/contrib/python/fonttools/fontTools/misc/visitor.py
index d289895467..6de432ef93 100644
--- a/contrib/python/fonttools/fontTools/misc/visitor.py
+++ b/contrib/python/fonttools/fontTools/misc/visitor.py
@@ -61,9 +61,10 @@ class Visitor(object):
if _visitors is None:
break
- m = celf._visitors.get(typ, None)
- if m is not None:
- return m
+ for base in typ.mro():
+ m = celf._visitors.get(base, None)
+ if m is not None:
+ return m
return _default
diff --git a/contrib/python/fonttools/fontTools/otlLib/builder.py b/contrib/python/fonttools/fontTools/otlLib/builder.py
index 70fd87ab57..8fc685683a 100644
--- a/contrib/python/fonttools/fontTools/otlLib/builder.py
+++ b/contrib/python/fonttools/fontTools/otlLib/builder.py
@@ -544,6 +544,10 @@ class ChainContextualBuilder(LookupBuilder):
f"{classRuleAttr}Count",
getattr(setForThisRule, f"{classRuleAttr}Count") + 1,
)
+ for i, classSet in enumerate(classSets):
+ if not getattr(classSet, classRuleAttr):
+ # class sets can be null so replace nop sets with None
+ classSets[i] = None
setattr(st, self.ruleSetAttr_(format=2, chaining=chaining), classSets)
setattr(
st, self.ruleSetAttr_(format=2, chaining=chaining) + "Count", len(classSets)
@@ -781,14 +785,14 @@ class ChainContextSubstBuilder(ChainContextualBuilder):
)
return result
- def find_chainable_single_subst(self, mapping):
- """Helper for add_single_subst_chained_()"""
+ def find_chainable_subst(self, mapping, builder_class):
+ """Helper for add_{single,multi}_subst_chained_()"""
res = None
for rule in self.rules[::-1]:
if rule.is_subtable_break:
return res
for sub in rule.lookups:
- if isinstance(sub, SingleSubstBuilder) and not any(
+ if isinstance(sub, builder_class) and not any(
g in mapping and mapping[g] != sub.mapping[g] for g in sub.mapping
):
res = sub
diff --git a/contrib/python/fonttools/fontTools/otlLib/maxContextCalc.py b/contrib/python/fonttools/fontTools/otlLib/maxContextCalc.py
index 03e7561b60..eee8d48f3c 100644
--- a/contrib/python/fonttools/fontTools/otlLib/maxContextCalc.py
+++ b/contrib/python/fonttools/fontTools/otlLib/maxContextCalc.py
@@ -92,5 +92,5 @@ def maxCtxContextualRule(maxCtx, st, chain):
if not chain:
return max(maxCtx, st.GlyphCount)
elif chain == "Reverse":
- return max(maxCtx, st.GlyphCount + st.LookAheadGlyphCount)
+ return max(maxCtx, 1 + st.LookAheadGlyphCount)
return max(maxCtx, st.InputGlyphCount + st.LookAheadGlyphCount)
diff --git a/contrib/python/fonttools/ya.make b/contrib/python/fonttools/ya.make
index 27248ee094..82ed3d848e 100644
--- a/contrib/python/fonttools/ya.make
+++ b/contrib/python/fonttools/ya.make
@@ -2,7 +2,7 @@
PY3_LIBRARY()
-VERSION(4.53.0)
+VERSION(4.53.1)
LICENSE(MIT)