Skip to content

Commit

Permalink
add test blending grayscale glyphs in RGBA mode
Browse files Browse the repository at this point in the history
(cherry picked from commit 0c771b1)
  • Loading branch information
nulano committed Nov 17, 2023
1 parent 28c173f commit e720654
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Binary file added Tests/images/colr_bungee_stroke.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions Tests/test_imagefont.py
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,29 @@ def test_colr_mask(layout_engine):
assert_image_similar_tofile(im, "Tests/images/colr_bungee_mask.png", 22)


@skip_unless_feature_version("freetype2", "2.10.0")
def test_colr_stroke(layout_engine):
font = ImageFont.truetype(
"Tests/fonts/BungeeColor-Regular_colr_Windows.ttf",
size=64,
layout_engine=layout_engine,
)

im = Image.new("RGB", (300, 75), "white")
d = ImageDraw.Draw(im)

d.text(
(15, 5),
"Bungee",
font=font,
embedded_color=True,
stroke_width=8,
stroke_fill="blue",
)

assert_image_similar_tofile(im, "Tests/images/colr_bungee_stroke.png", 7)


def test_woff2(layout_engine):
try:
font = ImageFont.truetype(
Expand Down

0 comments on commit e720654

Please sign in to comment.