notepad2-mod icon indicating copy to clipboard operation
notepad2-mod copied to clipboard

using SC_TECHNOLOGY_DIRECTWRITE rather than SC_TECHNOLOGY_DEFAULT

Open bluenlive opened this issue 8 years ago • 3 comments

SC_TECHNOLOGY_DIRECTWRITE performs better font linking than SC_TECHNOLOGY_DEFAULT. In font-missing situation, SC_TECHNOLOGY_DIRECTWRITE can show more fonts.

Florian Balmer wrote (in e-mail)...

Notepad2 5.0.26-beta4 makes use of SC_TECHNOLOGY_DIRECTWRITE [0], which seems to perform better font linking than the traditional SC_TECHNOLOGY_DEFAULT mode, and may thus fix some GDI quirks? The same problem seems to appear in Notepad2 5.0.26-beta4 if DirectWrite is disabled [1].

[0] http://www.scintilla.org/ScintillaDoc.html#SCI_SETTECHNOLOGY [1] http://www.flos-freeware.ch/development-releases/notepad2-FAQs.html#d2d-rendering

Best wishes, Florian.

bluenlive avatar Jul 15 '15 13:07 bluenlive

Random changes in the files.

Also, I see no need to have a new macro. Finally, the place you decided to add the call is pretty random.

XhmikosR avatar Jul 15 '15 15:07 XhmikosR

With SC_TECHNOLOGY_DIRECTWRITE, Scintilla becomes more likely to be fully capable for handling multilingual characters. Maybe It's a legacy bug in GDI.

It matters, but that's not the point.

For many years, CPU-based font rendering codes are developed to look almost equal to printed ones. On printers, outline vector fonts are processed with a component called RIP(raster image processor). This difference has been a long last pain for font designers, print layout designers and application GUI designers. DirectWrite uses GPU during the rasterization phase, and this makes the rendered result seem much more accurate because of features like, for example, ClearType sub-pixel positioning.

No reason to avoid use of DirectWrite.

BTW, I agree with @bluenlive that Direct2D feature can be enabled or disabled manually. It's because of the behavioral difference between GDI and DirectWrite. See below, the first and the second images compared. Both are set Consolas 10pt. Also both the third and the fourth images are set Inconsolata 11pt. Non-Latin graphemes shown are Korean syllables. With GDI used, the first and the third images seems Batang (Microsoft Korean default font like Times New Roman) is used for fallback on Korean syllables. With DirectWrite used, the second and the fourth images seems Malgun Gothic (Microsoft Korean default font like Segoe UI) is used for fallback.

Korean syllable graphemes are expected to have exact twice the width of Latin graphemes when they are used with monospace fonts like Consolas or Inconsolata. Although GDI is used, the first one shows a good example of rendered result, because the rectangular selection seems like an exact rectangle. On the other hand, the fourth one is better rendered than the third one. I don't know what makes this difference, but I am certain that this is not a bug.

selection_1 selection_2 selection_3 selection_4

Executable binaries used to take these screenshots are those @bluenlive distributes with Korean language patches.

Conclusion: making GDI/DirectWrite a manual choice would dramatically help users with various fallback fonts.

Thanks.

eonj avatar Jul 21 '15 18:07 eonj

This PR contains changes not related to what addressed, see https://github.com/zufuliu/notepad2/commit/b7ad639fa6e576db2df04ce72e2b69f409f386bd for a clean implementation and an easy way to switch between different rendering technologies.

zufuliu avatar Jul 31 '18 00:07 zufuliu