From 9a4f39588dc082f6a6fbab3354b2a55fc588c195 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 29 Jan 2025 18:58:53 +1100 Subject: [PATCH] Use embedded color for text length in multiline_text --- src/PIL/ImageDraw.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/PIL/ImageDraw.py b/src/PIL/ImageDraw.py index d8e4c0c60..dd691eeec 100644 --- a/src/PIL/ImageDraw.py +++ b/src/PIL/ImageDraw.py @@ -742,7 +742,12 @@ class ImageDraw: line_spacing = self._multiline_spacing(font, spacing, stroke_width) for line in lines: line_width = self.textlength( - line, font, direction=direction, features=features, language=language + line, + font, + direction=direction, + features=features, + language=language, + embedded_color=embedded_color, ) widths.append(line_width) max_width = max(max_width, line_width)