mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
add mono color text test
This commit is contained in:
parent
9fbd35fe87
commit
2dd9324df2
BIN
Tests/images/text_mono.gif
Normal file
BIN
Tests/images/text_mono.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
|
@ -11,6 +11,7 @@ from PIL import Image, ImageDraw, ImageFont
|
|||
|
||||
from .helper import (
|
||||
assert_image_equal,
|
||||
assert_image_equal_tofile,
|
||||
assert_image_similar,
|
||||
assert_image_similar_tofile,
|
||||
is_pypy,
|
||||
|
@ -724,3 +725,19 @@ class TestImageFont:
|
|||
@skip_unless_feature("raqm")
|
||||
class TestImageFont_RaqmLayout(TestImageFont):
|
||||
LAYOUT_ENGINE = ImageFont.LAYOUT_RAQM
|
||||
|
||||
|
||||
def test_render_mono_size():
|
||||
# issue 4177
|
||||
|
||||
if distutils.version.StrictVersion(ImageFont.core.freetype2_version) < "2.4":
|
||||
pytest.skip("Different metrics")
|
||||
|
||||
im = Image.new("P", (100, 30), "white")
|
||||
draw = ImageDraw.Draw(im)
|
||||
ttf = ImageFont.truetype(
|
||||
"Tests/fonts/DejaVuSans.ttf", 18, layout_engine=ImageFont.LAYOUT_BASIC
|
||||
)
|
||||
|
||||
draw.text((10, 10), "r" * 10, "black", ttf)
|
||||
assert_image_equal_tofile(im, "Tests/images/text_mono.gif")
|
||||
|
|
Loading…
Reference in New Issue
Block a user