Skip to content

Commit d3b974b

Browse files
committed
Use font in ImageDraw examples
1 parent 912a33f commit d3b974b

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

docs/deprecations.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,10 @@ Previous code::
232232

233233
im = Image.new("RGB", (100, 100))
234234
draw = ImageDraw.Draw(im)
235-
width, height = draw.textsize("Hello world")
235+
width, height = draw.textsize("Hello world", font)
236236

237237
width, height = font.getsize_multiline("Hello\nworld")
238-
width, height = draw.multiline_textsize("Hello\nworld")
238+
width, height = draw.multiline_textsize("Hello\nworld", font)
239239

240240
Use instead::
241241

@@ -247,9 +247,9 @@ Use instead::
247247

248248
im = Image.new("RGB", (100, 100))
249249
draw = ImageDraw.Draw(im)
250-
width = draw.textlength("Hello world")
250+
width = draw.textlength("Hello world", font)
251251

252-
left, top, right, bottom = draw.multiline_textbbox((0, 0), "Hello\nworld")
252+
left, top, right, bottom = draw.multiline_textbbox((0, 0), "Hello\nworld", font)
253253
width, height = right - left, bottom - top
254254

255255
FreeTypeFont.getmask2 fill parameter

docs/releasenotes/9.2.0.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ Previous code::
6969

7070
im = Image.new("RGB", (100, 100))
7171
draw = ImageDraw.Draw(im)
72-
width, height = draw.textsize("Hello world")
72+
width, height = draw.textsize("Hello world", font)
7373

7474
width, height = font.getsize_multiline("Hello\nworld")
75-
width, height = draw.multiline_textsize("Hello\nworld")
75+
width, height = draw.multiline_textsize("Hello\nworld", font)
7676

7777
Use instead::
7878

@@ -84,9 +84,9 @@ Use instead::
8484

8585
im = Image.new("RGB", (100, 100))
8686
draw = ImageDraw.Draw(im)
87-
width = draw.textlength("Hello world")
87+
width = draw.textlength("Hello world", font)
8888

89-
left, top, right, bottom = draw.multiline_textbbox((0, 0), "Hello\nworld")
89+
left, top, right, bottom = draw.multiline_textbbox((0, 0), "Hello\nworld", font)
9090
width, height = right - left, bottom - top
9191

9292
API Additions

0 commit comments

Comments
 (0)