mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-09-24 04:56:57 +03:00
Merge branch 'main' into macos
This commit is contained in:
commit
f905202267
Binary file not shown.
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.5 KiB |
BIN
Tests/images/colr_bungee_older.png
Normal file
BIN
Tests/images/colr_bungee_older.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.4 KiB |
|
@ -1494,7 +1494,9 @@ def test_default_font_size() -> None:
|
|||
|
||||
def draw_text() -> None:
|
||||
draw.text((0, 0), text, font_size=16)
|
||||
assert_image_equal_tofile(im, "Tests/images/imagedraw_default_font_size.png")
|
||||
assert_image_similar_tofile(
|
||||
im, "Tests/images/imagedraw_default_font_size.png", 1
|
||||
)
|
||||
|
||||
check(draw_text)
|
||||
|
||||
|
@ -1513,7 +1515,9 @@ def test_default_font_size() -> None:
|
|||
|
||||
def draw_multiline_text() -> None:
|
||||
draw.multiline_text((0, 0), text, font_size=16)
|
||||
assert_image_equal_tofile(im, "Tests/images/imagedraw_default_font_size.png")
|
||||
assert_image_similar_tofile(
|
||||
im, "Tests/images/imagedraw_default_font_size.png", 1
|
||||
)
|
||||
|
||||
check(draw_multiline_text)
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ from .helper import (
|
|||
assert_image_equal,
|
||||
assert_image_equal_tofile,
|
||||
assert_image_similar_tofile,
|
||||
has_feature_version,
|
||||
is_win32,
|
||||
skip_unless_feature,
|
||||
skip_unless_feature_version,
|
||||
|
@ -549,7 +550,7 @@ def test_default_font() -> None:
|
|||
draw.text((10, 60), txt, font=larger_default_font)
|
||||
|
||||
# Assert
|
||||
assert_image_equal_tofile(im, "Tests/images/default_font_freetype.png")
|
||||
assert_image_similar_tofile(im, "Tests/images/default_font_freetype.png", 0.13)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("mode", ("", "1", "RGBA"))
|
||||
|
@ -1055,7 +1056,10 @@ def test_colr(layout_engine: ImageFont.Layout) -> None:
|
|||
|
||||
d.text((15, 5), "Bungee", font=font, embedded_color=True)
|
||||
|
||||
assert_image_similar_tofile(im, "Tests/images/colr_bungee.png", 21)
|
||||
if has_feature_version("freetype2", "2.14.0"):
|
||||
assert_image_similar_tofile(im, "Tests/images/colr_bungee.png", 6.1)
|
||||
else:
|
||||
assert_image_similar_tofile(im, "Tests/images/colr_bungee_older.png", 21)
|
||||
|
||||
|
||||
@skip_unless_feature_version("freetype2", "2.10.0")
|
||||
|
@ -1071,7 +1075,7 @@ def test_colr_mask(layout_engine: ImageFont.Layout) -> None:
|
|||
|
||||
d.text((15, 5), "Bungee", "black", font=font)
|
||||
|
||||
assert_image_similar_tofile(im, "Tests/images/colr_bungee_mask.png", 22)
|
||||
assert_image_similar_tofile(im, "Tests/images/colr_bungee_mask.png", 14.1)
|
||||
|
||||
|
||||
def test_woff2(layout_engine: ImageFont.Layout) -> None:
|
||||
|
|
|
@ -183,7 +183,7 @@ def test_x_max_and_y_offset() -> None:
|
|||
draw.text((0, 0), "لح", font=ttf, fill=500)
|
||||
|
||||
target = "Tests/images/test_x_max_and_y_offset.png"
|
||||
assert_image_similar_tofile(im, target, 0.5)
|
||||
assert_image_similar_tofile(im, target, 3.8)
|
||||
|
||||
|
||||
def test_language() -> None:
|
||||
|
|
|
@ -114,7 +114,7 @@ ARCHITECTURES = {
|
|||
|
||||
V = {
|
||||
"BROTLI": "1.1.0",
|
||||
"FREETYPE": "2.13.3",
|
||||
"FREETYPE": "2.14.1",
|
||||
"FRIBIDI": "1.0.16",
|
||||
"HARFBUZZ": "11.4.5",
|
||||
"JPEGTURBO": "3.1.2",
|
||||
|
|
Loading…
Reference in New Issue
Block a user