[Bug 59712] New: `TextRenderer.MeasureText()` ignores trailing spaces
http://bugs.winehq.org/show_bug.cgi?id=59712 Bug ID: 59712 Summary: `TextRenderer.MeasureText()` ignores trailing spaces Product: Framework Mono Version: 6.12.0 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: System.Windows.Forms Assignee: wine-bugs@list.winehq.org Reporter: matthias.klaey@gmx.ch CC: madewokherd@gmail.com Distribution: --- Created attachment 80848 --> http://bugs.winehq.org/attachment.cgi?id=80848 [Windows 11 = equal width measured], [Mono Debian WSL = trailing spaces ignored] As visible in the attached screenshots, `TextRenderer.MeasureText()` ignores trailing spaces. Here's the repro code snipped: ``` var text = listBox_OwnerDraw.Items[e.Index].ToString(); TextRenderer.DrawText(e.Graphics, text, e.Font, e.Bounds, e.ForeColor, e.BackColor, TextFormat); var width = TextRenderer.MeasureText(e.Graphics, text, e.Font, e.Bounds.Size, TextFormat).Width; listBox_Width.Items[e.Index] = $"Width = {width}"; ``` Origin: https://sourceforge.net/p/y-a-terminal/code/HEAD/tree/trunk/YAT/YATLib/YAT.S... -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59712 --- Comment #1 from matthias.klaey@gmx.ch <matthias.klaey@gmx.ch> --- Origin URL tied to specific revision: https://sourceforge.net/p/y-a-terminal/code/6846/tree//trunk/YAT/YATLib/YAT.... -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59712 --- Comment #2 from matthias.klaey@gmx.ch <matthias.klaey@gmx.ch> --- And here's a potential workaround: https://sourceforge.net/p/y-a-terminal/code/6853/tree//trunk/YAT/YATLib/YAT.... -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59712 Maotong Zhang <zmtong1988@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |zmtong1988@gmail.com --- Comment #3 from Maotong Zhang <zmtong1988@gmail.com> --- Hello, please upload the test program so we can verify whether Wine-Mono MeasureText calculation has any issues. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59712 Ken Sharp <imwellcushtymelike@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |source -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59712 --- Comment #4 from matthias.klaey@gmx.ch <matthias.klaey@gmx.ch> --- (In reply to Maotong Zhang from comment #3)
Hello, please upload the test program so we can verify whether Wine-Mono MeasureText calculation has any issues.
Hi Maotong, Do mean me with "Hello"? If so, please see the links provided. You may download the complete project from https://sourceforge.net/p/y-a-terminal/code/6846/tree//trunk/YAT/YATLib/YAT.... and then remove the unrelated pieces of code. Or, you may create a minimal WinForms project in your favorite environment and then add the few lines stated in the initial description. That's all needed to reproduce the issue. Best regards, Matthias -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59712 --- Comment #5 from Maotong Zhang <zmtong1988@gmail.com> ---
https://sourceforge.net/p/y-a-terminal/code/6846/tree//trunk/YAT/YATLib/YAT. SystemEx.Windows.Forms.Test/
My current environment doesn't support compiling the test program, but I'll try to find a way to build it. Could you try installing .NET Framework 4.8 using winetricks dotnet48 and check whether the width is correct? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59712 --- Comment #6 from Esme Povirk <madewokherd@gmail.com> --- FWIW, all involved components would be different on Wine so it's most likely only Framework Mono. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla