Skip to content

Commit b44acf5

Browse files
committed
Merge branch 'ft213' into libraqm
2 parents 34c9a76 + 00f10b6 commit b44acf5

File tree

1,164 files changed

+39248
-38703
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,164 files changed

+39248
-38703
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
@@ -1317,7 +1317,7 @@ def _val_or_rc(val, rc_name):
13171317
def _init_tests():
13181318
# The version of FreeType to install locally for running the tests. This must match
13191319
# the value in `meson.build`.
1320-
LOCAL_FREETYPE_VERSION = '2.6.1'
1320+
LOCAL_FREETYPE_VERSION = '2.13.3'
13211321

13221322
from matplotlib import ft2font
13231323
if (ft2font.__freetype_version__ != LOCAL_FREETYPE_VERSION or

lib/matplotlib/_mathtext.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,10 @@ def to_raster(self, *, antialiased: bool) -> RasterParse:
157157

158158
for ox, oy, info in shifted.glyphs:
159159
info.font.draw_glyph_to_bitmap(
160-
image, int(ox), int(oy - info.metrics.iceberg), info.glyph,
160+
image,
161+
int(ox),
162+
int(oy - np.ceil(info.metrics.iceberg)),
163+
info.glyph,
161164
antialiased=antialiased)
162165
for x1, y1, x2, y2 in shifted.rects:
163166
height = max(int(y2 - y1) - 1, 0)
@@ -420,7 +423,9 @@ def get_kern(self, font1: str, fontclass1: str, sym1: str, fontsize1: float,
420423
info1 = self._get_info(font1, fontclass1, sym1, fontsize1, dpi)
421424
info2 = self._get_info(font2, fontclass2, sym2, fontsize2, dpi)
422425
font = info1.font
423-
return font.get_kerning(info1.num, info2.num, Kerning.DEFAULT) / 64
426+
return font.get_kerning(font.get_char_index(info1.num),
427+
font.get_char_index(info2.num),
428+
Kerning.DEFAULT) / 64
424429
return super().get_kern(font1, fontclass1, sym1, fontsize1,
425430
font2, fontclass2, sym2, fontsize2, dpi)
426431

lib/matplotlib/mpl-data/matplotlibrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,9 +301,9 @@
301301
## ("native" is a synonym.)
302302
## - force_autohint: Use FreeType's auto-hinter. ("auto" is a synonym.)
303303
## - no_hinting: Disable hinting. ("none" is a synonym.)
304-
#text.hinting: force_autohint
304+
#text.hinting: default
305305

306-
#text.hinting_factor: 8 # Specifies the amount of softness for hinting in the
306+
#text.hinting_factor: 1 # Specifies the amount of softness for hinting in the
307307
# horizontal direction. A value of 1 will hint to full
308308
# pixels. A value of 2 will hint to half pixels etc.
309309
#text.kerning_factor: 0 # Specifies the scaling factor for kerning values. This
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# This patch should go on top of the "classic" style and exists solely to avoid
22
# changing baseline images.
33

4-
text.kerning_factor : 6
5-
64
ytick.alignment: center_baseline
75

86
hatch.color: edge
7+
8+
text.hinting: default
9+
text.hinting_factor: 1

lib/matplotlib/testing/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@
1919

2020
def set_font_settings_for_testing():
2121
mpl.rcParams['font.family'] = 'DejaVu Sans'
22-
mpl.rcParams['text.hinting'] = 'none'
23-
mpl.rcParams['text.hinting_factor'] = 8
22+
if getattr(mpl, '_called_from_pytest', False):
23+
mpl.rcParams['text.hinting'] = 'default'
24+
mpl.rcParams['text.hinting_factor'] = 1
25+
else:
26+
mpl.rcParams['text.hinting'] = 'none'
27+
mpl.rcParams['text.hinting_factor'] = 8
2428

2529

2630
def set_reproducibility_for_testing():
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)