Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion 10 .github/workflows/macos-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,19 @@ set -e

if [[ "$ImageOS" == "macos13" ]]; then
brew uninstall gradle maven

wget https://raw.githubusercontent.com/python-pillow/pillow-depends/main/freetype-2.14.1.tar.gz
tar -xvzf freetype-2.14.1.tar.gz
(cd freetype-2.14.1 \
&& ./configure \
&& make -j4 \
&& make install)
else
brew install freetype
fi
brew install \
aom \
dav1d \
freetype \
ghostscript \
jpeg-turbo \
libimagequant \
Expand Down
Binary file modified BIN -195 Bytes (96%) Tests/images/colr_bungee.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified BIN -255 Bytes (91%) Tests/images/colr_bungee_mask.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BIN +4.44 KB Tests/images/colr_bungee_older.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions 8 Tests/test_imagedraw.py
Original file line number Diff line number Diff line change
Expand Up @@ -1494,7 +1494,9 @@ def check(func: Callable[[], None]) -> 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)

Expand All @@ -1513,7 +1515,9 @@ def draw_textbbox() -> 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)

Expand Down
10 changes: 7 additions & 3 deletions 10 Tests/test_imagefont.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
assert_image_equal,
assert_image_equal_tofile,
assert_image_similar_tofile,
has_feature_version,
is_win32,
skip_unless_feature,
skip_unless_feature_version,
Expand Down Expand Up @@ -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"))
Expand Down Expand Up @@ -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")
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion 2 Tests/test_imagefontctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion 2 winbuild/build_prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def cmd_msbuild(

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",
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.