aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--doc/ScintillaHistory.html4
-rw-r--r--win32/PlatWin.cxx18
2 files changed, 19 insertions, 3 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 12b2597f3..c44fdc1e0 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -593,6 +593,10 @@
<a href="https://sourceforge.net/p/scintilla/bugs/2087/">Bug #2087</a>.
</li>
<li>
+ Support coloured text in Windows 8.1+.
+ <a href="https://sourceforge.net/p/scintilla/feature-requests/1277/">Feature #1277</a>.
+ </li>
+ <li>
Fix exception when inserting DBCS text.
<a href="https://sourceforge.net/p/scintilla/bugs/2093/">Bug #2093</a>.
</li>
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index fa1147b0f..d1ff19b55 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -67,6 +67,7 @@ IDWriteFactory *pIDWriteFactory = nullptr;
ID2D1Factory *pD2DFactory = nullptr;
IDWriteRenderingParams *defaultRenderingParams = nullptr;
IDWriteRenderingParams *customClearTypeRenderingParams = nullptr;
+D2D1_DRAW_TEXT_OPTIONS d2dDrawTextOptions = D2D1_DRAW_TEXT_OPTIONS_NONE;
static HMODULE hDLLD2D {};
static HMODULE hDLLDWrite {};
@@ -105,9 +106,20 @@ bool LoadD2D() {
if (hDLLDWrite) {
DWriteCFSig fnDWCF = reinterpret_cast<DWriteCFSig>(::GetProcAddress(hDLLDWrite, "DWriteCreateFactory"));
if (fnDWCF) {
- fnDWCF(DWRITE_FACTORY_TYPE_SHARED,
- __uuidof(IDWriteFactory),
+ const GUID IID_IDWriteFactory2 = // 0439fc60-ca44-4994-8dee-3a9af7b732ec
+ { 0x0439fc60, 0xca44, 0x4994, { 0x8d, 0xee, 0x3a, 0x9a, 0xf7, 0xb7, 0x32, 0xec } };
+
+ const HRESULT hr = fnDWCF(DWRITE_FACTORY_TYPE_SHARED,
+ IID_IDWriteFactory2,
reinterpret_cast<IUnknown**>(&pIDWriteFactory));
+ if (SUCCEEDED(hr)) {
+ // D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT
+ d2dDrawTextOptions = static_cast<D2D1_DRAW_TEXT_OPTIONS>(0x00000004);
+ } else {
+ fnDWCF(DWRITE_FACTORY_TYPE_SHARED,
+ __uuidof(IDWriteFactory),
+ reinterpret_cast<IUnknown**>(&pIDWriteFactory));
+ }
}
}
@@ -1894,7 +1906,7 @@ void SurfaceD2D::DrawTextCommon(PRectangle rc, Font &font_, XYPOSITION ybase, st
rc.Width(), rc.Height(), &pTextLayout);
if (SUCCEEDED(hr)) {
D2D1_POINT_2F origin = {rc.left, ybase-yAscent};
- pRenderTarget->DrawTextLayout(origin, pTextLayout, pBrush, D2D1_DRAW_TEXT_OPTIONS_NONE);
+ pRenderTarget->DrawTextLayout(origin, pTextLayout, pBrush, d2dDrawTextOptions);
pTextLayout->Release();
}