microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.27k stars 674 forks source link

Cyrillic Font Display Problems in RichEditBox and TextBox #1921

Open sharpninja opened 4 years ago

sharpninja commented 4 years ago

Describe the bug Related Issue on the Quick-Pad Repository

Please see the linked issue for full details.

TL;DR; Many Unicode characters render incorrectly in TextBox and RichEditBox. This is consistent across three different apps (NotepadX, Notepads, Quick Pad) using TextBox and RichEditbox. Some of the Cyrillic characters display correctly, some display as a box with accents. The linked issue has screen shots showing the same documents being rendered in Notepad, IE11, Edge, KDE Kate, NotepadX, Notepads, Quick Pad and Word Pad.

Of those, only Edge, Notepad and KDE Kate consistently detect encoding correctly in all cases and display the font correctly. Quick Pad always detects the correct encoding, but due to the font rendering issues never shows it correctly in either TextBox or RichEditBox.

Steps to reproduce the bug

Steps to reproduce the behavior:

  1. Download the text files linked in the linked issue
  2. Open the text files in Notepad using Consolas 11pt as your font. All will display correctly (except the RTF file, of course).
  3. Open the text files in Quick Pad (the app in the linked repository). All will be detected in the correct format and encoding. All will display incorrectly whether it's a text file being shown in TextBox or an rtf file in RichEditBox.

Expected behavior Rendering of Cyrillic Coptic text should match known good functionality in Notepad.

Screenshots UWP Problem File B problems

Version Info Windows 10 Insider, 20H1, 19555.1001

Windows 10 version Saw the problem?
Insider Build (19555.1001) Yes
Device form factor Saw the problem?
Desktop Yes

Additional context If downloading and building the Quick Pad app to view the documents, use this commit.

yoshiask commented 4 years ago

I would just like to point out that the sample text in those images is actually Coptic, not Cyrillic.

chrisglein commented 4 years ago

@ddalp Do you know what the gap is here between XAML's handling and what's happening with Notepad? I would assume they're both rendering with richedit but one doesn't work and one does.

ddalp commented 4 years ago

@chrisglein XAML uses DWrite for font binding/fallback and wordpad uses GDI. RichEdit also has different code path for Dwrite and GDI font handling too. Usually we debug XAML side font fallback logic(start with GetRunFontFaceId function) to see if there is anything wrong on our side. And sometimes we need to engage RichEdit team to debug it together. Since this font seems to be RTL language, it seems more an issue on RichEdit side I think.

yoshiask commented 4 years ago

@ddalp

Since this font seems to be RTL language...

I can assure you that the font (and that script) is not a RTL language. I noticed that the display issues occurred only in words that contained a jenkim/accent, which makes me suspect that. If it helps, the Unicode being used for the accent is \u0300\u200D.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 5 days.

yoshiask commented 1 year ago

This issue is still present. Would like to reiterate that the issue only appears to occur in words that contain a combining accent with a zero width joiner.