Skip to content

Incorrect rendering of hot prefixes for some fonts after the KB5058499 update for Windows 11 #13559

Open
@smToDo

Description

@smToDo

Description

Hello.
We have an application with custom string rendering using the DrawString method and the Segoe UI font.
After installing the KB5058499 update for Windows 11, our application began to render the string with hot prefixes incorrectly.
The DrawText method works correctly.
This issue does not exist for all fonts.
Original string: "ファイル(&F)"
Image

Reproduction Steps

  1. Create a WinForms application for .Net Framework or .Net
  2. Override the OnPaint method of the main form:
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            var text = "ファイル(&F)";
            var stringFormat = new StringFormat
            {
                HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.Show
            };
            using (var font = new Font("Segoe UI", 10))
            {
                e.Graphics.DrawString($"DrawString {text}", font, SystemBrushes.ControlText, new Point(Bounds.Width / 2, Bounds.Height / 2), stringFormat);
                TextRenderer.DrawText(e.Graphics, $"DrawText {text}", font, new Point(Bounds.Width / 2, Bounds.Height / 2 + 30), SystemColors.ControlText);
            }
        }
  1. Run application.

Expected behavior

The DrawString method ​​renders a hot prefix as the DrawText method.

Actual behavior

The DrawString method does not display hot prefix correctly.

Regression?

Yes, the DrawStrings works correctly with Windows 10 and Windows 11 before KB5058499.

Known Workarounds

Not all fonts are drawn with an issue, you can select a new application font.

Configuration

.Net Framework 4.8
.Net 8
Windows 11 Pro 24H2 26100.4202

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.DrawingSystem.Drawing issuesexternal-OS-issueIssue caused by an external OS component such as Common Controls.untriagedThe team needs to look at this issue in the next triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions