-
-
Notifications
You must be signed in to change notification settings - Fork 269
using SC_TECHNOLOGY_DIRECTWRITE rather than SC_TECHNOLOGY_DEFAULT #122
base: master
Are you sure you want to change the base?
Conversation
To set technology "DirectWrite"
Setting technology to DIRECTWRITE.
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. |
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. 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. |
This PR contains changes not related to what addressed, see zufuliu/notepad4@b7ad639 for a clean implementation and an easy way to switch between different rendering technologies. |
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)...