diff --git a/Scintilla.NET/NativeMethods.cs b/Scintilla.NET/NativeMethods.cs index 0a29f39..9a03421 100644 --- a/Scintilla.NET/NativeMethods.cs +++ b/Scintilla.NET/NativeMethods.cs @@ -1189,6 +1189,7 @@ public static class NativeMethods public const int SC_TECHNOLOGY_DIRECTWRITE = 1; public const int SC_TECHNOLOGY_DIRECTWRITERETAIN = 2; public const int SC_TECHNOLOGY_DIRECTWRITEDC = 3; + public const int SC_TECHNOLOGY_DIRECT_WRITE_1 = 4; // Tab draw public const int SCTD_LONGARROW = 0; diff --git a/Scintilla.NET/Scintilla.cs b/Scintilla.NET/Scintilla.cs index c093363..13f6c05 100644 --- a/Scintilla.NET/Scintilla.cs +++ b/Scintilla.NET/Scintilla.cs @@ -6492,6 +6492,11 @@ public Technology Technology set { int technology = (int)value; + // DirectWrite 1 requires Windows 8 / Windows Server 2012 or later. If the user attempts to set it on an unsupported OS, fall back to default rendering technology. + if (value == Technology.DirectWrite1 && !(Environment.OSVersion.Platform == PlatformID.Win32NT && Environment.OSVersion.Version >= new Version(6, 2))) + { + technology = (int)Technology.Default; + } DirectMessage(NativeMethods.SCI_SETTECHNOLOGY, new IntPtr(technology)); } } diff --git a/Scintilla.NET/Technology.cs b/Scintilla.NET/Technology.cs index 2c23d8d..fe99f5a 100644 --- a/Scintilla.NET/Technology.cs +++ b/Scintilla.NET/Technology.cs @@ -14,5 +14,21 @@ public enum Technology /// Renders text using Direct2D/DirectWrite. Since Direct2D buffers drawing, /// Scintilla's buffering can be turned off with . /// - DirectWrite = NativeMethods.SC_TECHNOLOGY_DIRECTWRITE + DirectWrite = NativeMethods.SC_TECHNOLOGY_DIRECTWRITE, + + /// + /// Request that the frame is retained after being presented which may prevent drawing failures on some cards and drivers. + /// + DirectWriteRetain = NativeMethods.SC_TECHNOLOGY_DIRECTWRITERETAIN, + + /// + /// Use DirectWrite to draw into a GDI DC. This mode may work for remote access sessions. + /// + DirectWriteDc = NativeMethods.SC_TECHNOLOGY_DIRECTWRITEDC, + + /// + /// Renders text using Windows 8 DirectWrite 1.1 features in a lower level way that manages graphics state more explicitly. + /// Technically DirectWrite 1.1 is available on some Windows 7 systems, but it's difficult to detect and not worth the effort. This technology is only available on Windows 8 and later. + /// + DirectWrite1 = NativeMethods.SC_TECHNOLOGY_DIRECT_WRITE_1, }