mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-12 17:40:51 +03:00
Use font in ImageDraw examples
This commit is contained in:
parent
912a33f5e9
commit
d3b974b786
|
@ -232,10 +232,10 @@ Previous code::
|
|||
|
||||
im = Image.new("RGB", (100, 100))
|
||||
draw = ImageDraw.Draw(im)
|
||||
width, height = draw.textsize("Hello world")
|
||||
width, height = draw.textsize("Hello world", font)
|
||||
|
||||
width, height = font.getsize_multiline("Hello\nworld")
|
||||
width, height = draw.multiline_textsize("Hello\nworld")
|
||||
width, height = draw.multiline_textsize("Hello\nworld", font)
|
||||
|
||||
Use instead::
|
||||
|
||||
|
@ -247,9 +247,9 @@ Use instead::
|
|||
|
||||
im = Image.new("RGB", (100, 100))
|
||||
draw = ImageDraw.Draw(im)
|
||||
width = draw.textlength("Hello world")
|
||||
width = draw.textlength("Hello world", font)
|
||||
|
||||
left, top, right, bottom = draw.multiline_textbbox((0, 0), "Hello\nworld")
|
||||
left, top, right, bottom = draw.multiline_textbbox((0, 0), "Hello\nworld", font)
|
||||
width, height = right - left, bottom - top
|
||||
|
||||
FreeTypeFont.getmask2 fill parameter
|
||||
|
|
|
@ -69,10 +69,10 @@ Previous code::
|
|||
|
||||
im = Image.new("RGB", (100, 100))
|
||||
draw = ImageDraw.Draw(im)
|
||||
width, height = draw.textsize("Hello world")
|
||||
width, height = draw.textsize("Hello world", font)
|
||||
|
||||
width, height = font.getsize_multiline("Hello\nworld")
|
||||
width, height = draw.multiline_textsize("Hello\nworld")
|
||||
width, height = draw.multiline_textsize("Hello\nworld", font)
|
||||
|
||||
Use instead::
|
||||
|
||||
|
@ -84,9 +84,9 @@ Use instead::
|
|||
|
||||
im = Image.new("RGB", (100, 100))
|
||||
draw = ImageDraw.Draw(im)
|
||||
width = draw.textlength("Hello world")
|
||||
width = draw.textlength("Hello world", font)
|
||||
|
||||
left, top, right, bottom = draw.multiline_textbbox((0, 0), "Hello\nworld")
|
||||
left, top, right, bottom = draw.multiline_textbbox((0, 0), "Hello\nworld", font)
|
||||
width, height = right - left, bottom - top
|
||||
|
||||
API Additions
|
||||
|
|
Loading…
Reference in New Issue
Block a user