mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-05-29 02:03:25 +03:00
deprecate fill in imageFont
This commit is contained in:
parent
535c45717f
commit
a766b5b0d5
|
@ -977,6 +977,11 @@ class TestImageFont:
|
||||||
|
|
||||||
assert_image_similar_tofile(im, "Tests/images/colr_bungee_mask.png", 22)
|
assert_image_similar_tofile(im, "Tests/images/colr_bungee_mask.png", 22)
|
||||||
|
|
||||||
|
def test_fill_deprecation(self):
|
||||||
|
font = self.get_font()
|
||||||
|
with pytest.warns(DeprecationWarning):
|
||||||
|
font.getmask2("Hello world", fill=Image.core.fill)
|
||||||
|
|
||||||
|
|
||||||
@skip_unless_feature("raqm")
|
@skip_unless_feature("raqm")
|
||||||
class TestImageFont_RaqmLayout(TestImageFont):
|
class TestImageFont_RaqmLayout(TestImageFont):
|
||||||
|
|
|
@ -602,7 +602,7 @@ class FreeTypeFont:
|
||||||
self,
|
self,
|
||||||
text,
|
text,
|
||||||
mode="",
|
mode="",
|
||||||
fill=Image.core.fill,
|
fill=None,
|
||||||
direction=None,
|
direction=None,
|
||||||
features=None,
|
features=None,
|
||||||
language=None,
|
language=None,
|
||||||
|
@ -627,6 +627,8 @@ class FreeTypeFont:
|
||||||
|
|
||||||
.. versionadded:: 1.1.5
|
.. versionadded:: 1.1.5
|
||||||
|
|
||||||
|
:param fill: Fill function. Deprecated.
|
||||||
|
|
||||||
:param direction: Direction of the text. It can be 'rtl' (right to
|
:param direction: Direction of the text. It can be 'rtl' (right to
|
||||||
left), 'ltr' (left to right) or 'ttb' (top to bottom).
|
left), 'ltr' (left to right) or 'ttb' (top to bottom).
|
||||||
Requires libraqm.
|
Requires libraqm.
|
||||||
|
@ -674,6 +676,10 @@ class FreeTypeFont:
|
||||||
:py:mod:`PIL.Image.core` interface module, and the text offset, the
|
:py:mod:`PIL.Image.core` interface module, and the text offset, the
|
||||||
gap between the starting coordinate and the first marking
|
gap between the starting coordinate and the first marking
|
||||||
"""
|
"""
|
||||||
|
if fill is not None:
|
||||||
|
deprecate("fill", 10)
|
||||||
|
else:
|
||||||
|
fill = Image.core.fill
|
||||||
size, offset = self.font.getsize(
|
size, offset = self.font.getsize(
|
||||||
text, mode, direction, features, language, anchor
|
text, mode, direction, features, language, anchor
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user