Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Scintilla.NET/NativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions Scintilla.NET/Scintilla.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
Expand Down
18 changes: 17 additions & 1 deletion Scintilla.NET/Technology.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,21 @@ public enum Technology
/// Renders text using Direct2D/DirectWrite. Since Direct2D buffers drawing,
/// Scintilla's buffering can be turned off with <see cref="Scintilla.BufferedDraw" />.
/// </summary>
DirectWrite = NativeMethods.SC_TECHNOLOGY_DIRECTWRITE
DirectWrite = NativeMethods.SC_TECHNOLOGY_DIRECTWRITE,

/// <summary>
/// Request that the frame is retained after being presented which may prevent drawing failures on some cards and drivers.
/// </summary>
DirectWriteRetain = NativeMethods.SC_TECHNOLOGY_DIRECTWRITERETAIN,

/// <summary>
/// Use DirectWrite to draw into a GDI DC. This mode may work for remote access sessions.
/// </summary>
DirectWriteDc = NativeMethods.SC_TECHNOLOGY_DIRECTWRITEDC,

/// <summary>
/// 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.
/// </summary>
DirectWrite1 = NativeMethods.SC_TECHNOLOGY_DIRECT_WRITE_1,
}
Loading