Skip to content

Commit ecef04d

Browse files
committed
Update FreeType to 2.13.3
1 parent 782c51a commit ecef04d

File tree

17 files changed

+82
-1913
lines changed

17 files changed

+82
-1913
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ repos:
2020
- id: check-docstring-first
2121
exclude: lib/matplotlib/typing.py # docstring used for attribute flagged by check
2222
- id: end-of-file-fixer
23-
exclude_types: [svg]
23+
exclude_types: [diff, svg]
2424
- id: mixed-line-ending
2525
- id: name-tests-test
2626
args: ["--pytest-test-first"]
2727
- id: no-commit-to-branch # Default is master and main.
2828
- id: trailing-whitespace
29-
exclude_types: [svg]
29+
exclude_types: [diff, svg]
3030
- repo: https://github.com/pre-commit/mirrors-mypy
3131
rev: v1.15.0
3232
hooks:

extern/meson.build

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,20 @@ else
1313
# must match the value in `lib/matplotlib.__init__.py`. Also update the docs
1414
# in `docs/devel/dependencies.rst`. Bump the cache key in
1515
# `.circleci/config.yml` when changing requirements.
16-
LOCAL_FREETYPE_VERSION = '2.6.1'
16+
LOCAL_FREETYPE_VERSION = '2.13.3'
1717

1818
freetype_proj = subproject(
1919
f'freetype-@LOCAL_FREETYPE_VERSION@',
20-
default_options: ['default_library=static'])
20+
default_options: [
21+
'default_library=static',
22+
'brotli=disabled',
23+
'bzip2=disabled',
24+
'harfbuzz=disabled',
25+
'mmap=auto',
26+
'png=disabled',
27+
'tests=disabled',
28+
'zlib=internal',
29+
])
2130
freetype_dep = freetype_proj.get_variable('freetype_dep')
2231
endif
2332

lib/matplotlib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1319,7 +1319,7 @@ def _val_or_rc(val, rc_name):
13191319
def _init_tests():
13201320
# The version of FreeType to install locally for running the tests. This must match
13211321
# the value in `meson.build`.
1322-
LOCAL_FREETYPE_VERSION = '2.6.1'
1322+
LOCAL_FREETYPE_VERSION = '2.13.3'
13231323

13241324
from matplotlib import ft2font
13251325
if (ft2font.__freetype_version__ != LOCAL_FREETYPE_VERSION or

lib/matplotlib/tests/test_axes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8158,7 +8158,7 @@ def test_normal_axes():
81588158
]
81598159
for nn, b in enumerate(bbaxis):
81608160
targetbb = mtransforms.Bbox.from_bounds(*target[nn])
8161-
assert_array_almost_equal(b.bounds, targetbb.bounds, decimal=2)
8161+
assert_array_almost_equal(b.bounds, targetbb.bounds, decimal=0)
81628162

81638163
target = [
81648164
[150.0, 119.999, 930.0, 11.111],
@@ -8176,7 +8176,7 @@ def test_normal_axes():
81768176

81778177
target = [86.89, 76.89, 1019.11, 1015.61]
81788178
targetbb = mtransforms.Bbox.from_bounds(*target)
8179-
assert_array_almost_equal(bbtb.bounds, targetbb.bounds, decimal=2)
8179+
assert_array_almost_equal(bbtb.bounds, targetbb.bounds, decimal=0)
81808180

81818181
# test that get_position roundtrips to get_window_extent
81828182
axbb = ax.get_position().transformed(fig.transFigure).bounds

lib/matplotlib/tests/test_bbox_tight.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def test_bbox_inches_tight(text_placeholders):
4747

4848
@image_comparison(['bbox_inches_tight_suptile_legend'],
4949
savefig_kwarg={'bbox_inches': 'tight'},
50-
tol=0 if platform.machine() == 'x86_64' else 0.02)
50+
tol=0 if platform.machine() == 'x86_64' else 0.022)
5151
def test_bbox_inches_tight_suptile_legend():
5252
plt.plot(np.arange(10), label='a straight line')
5353
plt.legend(bbox_to_anchor=(0.9, 1), loc='upper left')

lib/matplotlib/tests/test_figure.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ def test_tightbbox():
814814
ax.set_xlim(0, 1)
815815
t = ax.text(1., 0.5, 'This dangles over end')
816816
renderer = fig.canvas.get_renderer()
817-
x1Nom0 = 8.9375 # inches
817+
x1Nom0 = 8.9875 # inches
818818
assert abs(t.get_tightbbox(renderer).x1 - x1Nom0 * fig.dpi) < 2
819819
assert abs(ax.get_tightbbox(renderer).x1 - x1Nom0 * fig.dpi) < 2
820820
assert abs(fig.get_tightbbox(renderer).x1 - x1Nom0) < 0.05
@@ -1376,7 +1376,8 @@ def test_subfigure_dpi():
13761376

13771377

13781378
@image_comparison(['test_subfigure_ss.png'], style='mpl20',
1379-
savefig_kwarg={'facecolor': 'teal'}, tol=0.02)
1379+
savefig_kwarg={'facecolor': 'teal'},
1380+
tol=0.022)
13801381
def test_subfigure_ss():
13811382
# test assigning the subfigure via subplotspec
13821383
np.random.seed(19680801)

lib/matplotlib/tests/test_ft2font.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -708,10 +708,10 @@ def test_ft2font_get_sfnt_table(font_name, header):
708708

709709
@pytest.mark.parametrize('left, right, unscaled, unfitted, default', [
710710
# These are all the same class.
711-
('A', 'A', 57, 248, 256), ('A', 'À', 57, 248, 256), ('A', 'Á', 57, 248, 256),
712-
('A', 'Â', 57, 248, 256), ('A', 'Ã', 57, 248, 256), ('A', 'Ä', 57, 248, 256),
711+
('A', 'A', 57, 247, 256), ('A', 'À', 57, 247, 256), ('A', 'Á', 57, 247, 256),
712+
('A', 'Â', 57, 247, 256), ('A', 'Ã', 57, 247, 256), ('A', 'Ä', 57, 247, 256),
713713
# And a few other random ones.
714-
('D', 'A', -36, -156, -128), ('T', '.', -243, -1056, -1024),
714+
('D', 'A', -36, -156, -128), ('T', '.', -243, -1055, -1024),
715715
('X', 'C', -149, -647, -640), ('-', 'J', 114, 495, 512),
716716
])
717717
def test_ft2font_get_kerning(left, right, unscaled, unfitted, default):

lib/matplotlib/tests/test_mathtext.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -568,14 +568,14 @@ def test_box_repr():
568568
_mathtext.DejaVuSansFonts(fm.FontProperties(), LoadFlags.NO_HINTING),
569569
fontsize=12, dpi=100))
570570
assert s == textwrap.dedent("""\
571-
Hlist<w=9.49 h=16.08 d=6.64 s=0.00>[
571+
Hlist<w=9.51 h=15.81 d=6.57 s=0.00>[
572572
Hlist<w=0.00 h=0.00 d=0.00 s=0.00>[],
573-
Hlist<w=9.49 h=16.08 d=6.64 s=0.00>[
574-
Hlist<w=9.49 h=16.08 d=6.64 s=0.00>[
575-
Vlist<w=7.40 h=22.72 d=0.00 s=6.64>[
576-
HCentered<w=7.40 h=8.67 d=0.00 s=0.00>[
573+
Hlist<w=9.51 h=15.81 d=6.57 s=0.00>[
574+
Hlist<w=9.51 h=15.81 d=6.57 s=0.00>[
575+
Vlist<w=7.43 h=22.38 d=0.00 s=6.57>[
576+
HCentered<w=7.43 h=8.51 d=0.00 s=0.00>[
577577
Glue,
578-
Hlist<w=7.40 h=8.67 d=0.00 s=0.00>[
578+
Hlist<w=7.43 h=8.51 d=0.00 s=0.00>[
579579
`1`,
580580
k2.36,
581581
],
@@ -584,9 +584,9 @@ def test_box_repr():
584584
Vbox,
585585
Hrule,
586586
Vbox,
587-
HCentered<w=7.40 h=8.84 d=0.00 s=0.00>[
587+
HCentered<w=7.43 h=8.66 d=0.00 s=0.00>[
588588
Glue,
589-
Hlist<w=7.40 h=8.84 d=0.00 s=0.00>[
589+
Hlist<w=7.43 h=8.66 d=0.00 s=0.00>[
590590
`2`,
591591
k2.02,
592592
],

lib/matplotlib/tests/test_text.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -704,8 +704,8 @@ def test_wrap(x, rotation, halign):
704704
s = 'This is a very long text that should be wrapped multiple times.'
705705
text = subfig.text(x, 0.7, s, wrap=True, rotation=rotation, ha=halign)
706706
fig.canvas.draw()
707-
assert text._get_wrapped_text() == ('This is a very long text\n'
708-
'that should be\n'
707+
assert text._get_wrapped_text() == ('This is a very long\n'
708+
'text that should be\n'
709709
'wrapped multiple\n'
710710
'times.')
711711

subprojects/freetype-2.13.3.wrap

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[wrap-file]
2+
directory = freetype-2.13.3
3+
source_url = https://download.savannah.gnu.org/releases/freetype/freetype-2.13.3.tar.xz
4+
source_fallback_url = https://downloads.sourceforge.net/project/freetype/freetype2/2.13.3/freetype-2.13.3.tar.xz
5+
source_filename = freetype-2.13.3.tar.xz
6+
source_hash = 0550350666d427c74daeb85d5ac7bb353acba5f76956395995311a9c6f063289
7+
8+
# https://gitlab.freedesktop.org/freetype/freetype/-/commit/34aed655f1696da774b5cdd4c5effb312153232f
9+
diff_files = freetype-34aed655f1696da774b5cdd4c5effb312153232f.patch
10+
11+
[provide]
12+
freetype2 = freetype_dep
13+
freetype = freetype_dep

subprojects/freetype-2.6.1.wrap

Lines changed: 0 additions & 10 deletions
This file was deleted.

subprojects/packagefiles/freetype-2.6.1-meson/LICENSE.build

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)