Skip to content
This repository has been archived by the owner on Aug 12, 2018. It is now read-only.

using SC_TECHNOLOGY_DIRECTWRITE rather than SC_TECHNOLOGY_DEFAULT #122

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

using SC_TECHNOLOGY_DIRECTWRITE rather than SC_TECHNOLOGY_DEFAULT #122

wants to merge 2 commits into from

Conversation

bluenlive
Copy link
Contributor

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.

To set technology "DirectWrite"
Setting technology to DIRECTWRITE.
@XhmikosR
Copy link
Owner

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.

@eonj
Copy link
Contributor

eonj commented Jul 21, 2015

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.

@zufuliu
Copy link
Contributor

zufuliu commented Jul 31, 2018

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants