@@ -260,6 +260,30 @@ offset.
260260 :alt: Demonstration of size height vs bbox top and bottom
261261 :align: center
262262
263+ If you are using these methods for aligning text, consider using :ref: `text-anchors ` instead
264+ which avoid issues that can occur with non-English text or unusual fonts.
265+ For example, instead of the following code::
266+
267+ from PIL import Image, ImageDraw, ImageFont
268+
269+ font = ImageFont.truetype("Tests/fonts/FreeMono.ttf")
270+
271+ im = Image.new("RGB", (100, 100))
272+ draw = ImageDraw.Draw(im)
273+ width, height = draw.textsize("Hello world", font)
274+ x, y = (100 - width) / 2, (100 - height) / 2
275+ draw.text((x, y), "Hello world", font=font)
276+
277+ Use instead::
278+
279+ from PIL import Image, ImageDraw, ImageFont
280+
281+ font = ImageFont.truetype("Tests/fonts/FreeMono.ttf")
282+
283+ im = Image.new("RGB", (100, 100))
284+ draw = ImageDraw.Draw(im)
285+ draw.text((100 / 2, 100 / 2), "Hello world", font=font, anchor="mm")
286+
263287FreeTypeFont.getmask2 fill parameter
264288~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
265289
0 commit comments