mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 01:46:18 +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)
|
||||
|
||||
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")
|
||||
class TestImageFont_RaqmLayout(TestImageFont):
|
||||
|
|
|
@ -602,7 +602,7 @@ class FreeTypeFont:
|
|||
self,
|
||||
text,
|
||||
mode="",
|
||||
fill=Image.core.fill,
|
||||
fill=None,
|
||||
direction=None,
|
||||
features=None,
|
||||
language=None,
|
||||
|
@ -627,6 +627,8 @@ class FreeTypeFont:
|
|||
|
||||
.. versionadded:: 1.1.5
|
||||
|
||||
:param fill: Fill function. Deprecated.
|
||||
|
||||
:param direction: Direction of the text. It can be 'rtl' (right to
|
||||
left), 'ltr' (left to right) or 'ttb' (top to bottom).
|
||||
Requires libraqm.
|
||||
|
@ -674,6 +676,10 @@ class FreeTypeFont:
|
|||
:py:mod:`PIL.Image.core` interface module, and the text offset, the
|
||||
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(
|
||||
text, mode, direction, features, language, anchor
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user