Windows 10 x64, (Scintilla:Notepad3, SciTE release v5.0.1, x64)
Using latest Scintilla release (v5.0.1) I discovered following text rendering issue:
Using German text with "Umlauts" (äöüÄÖÜß) , disabling line numbering (SCI_SETMARGINWIDTHN(n,0) - zero(0) should be invisible according to documentation - the "Umlauts" changed their appearance as if the UTF-8 Encoding has bee reinterpreted as ISO-8851-1 Encoding, if caret enters the line with the "Umlauts" and get back to correct visualization, when the caret leaves the line (e.g. ü <-> ü, ä <-> ä, see attached .jpg)
Example text to copy:
Hallo,
vielen Dank für die schnelle Rückmeldung. Ich habe die aktuellste Version v5.21.416.1 beta (Version wunschgemäß kopiert, siehe unten). Leider tritt das Problem nach wie vor auf. Jedes Mal, wenn man einen neuen Buchstaben eintippt, wird die Darstellung für den Bruchteil einer Sekunde normal, doch dann verwandeln sich die Umlaute wieder in die zwei Sonderzeichen.
Hello,
I would like to add a ".zip" file with a French text in UTF-8 as example with SciTE v5.0.1
Likewise, the problem goes away completely if Line Numbers or Line Endings are enabled.
Also more details on this issue in: https://github.com/rizonesoft/Notepad3/issues/3337
PS: SciTE v5.0.0 and earlier do not have this problem.
Last edit: Pairi Daiza 2021-04-18
debugging shows codePageText is zero in SurfaceD2D::DrawTextTransparent() when line number is disable. codePageText is only set in SetFont().
For all text, set breakpoint condition in SurfaceD2D::DrawTextCommon() to
codePageDraw==0, following is the stacktrace:The problem is codePageText is used before set (in SetFont() method), so the bug apples to all other calls to DrawTextCommon().
A simple fix is remove codePageText, use mode.codePage directly like SurfaceGDI.
This was caused by trying to unify the DrawTextCommon and DrawTextCommonUTF8 methods in [94e7ff] without handling the side effects of SetFont correctly.
I think the simplest change while preserving the code sharing is to change the name of the codePageDraw parameter to codePageOverride then use that if it is non-0:
Related
Commit: [94e7ff]
Hello Neil,
thank you for your quick response - the supplied patch works fine.
Best regards
Rainer
Fix committed as [0cf964] .
Related
Commit: [0cf964]