From 28c1e186b953ae0c8fe7681c7d7ae8950efb266f Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 20 Nov 2015 10:52:27 +1100 Subject: Using DirectWrite, for ligatures and other character clusters, display caret and selections part-way through clusters so that the caret doesn't stick to the end of the cluster making it easier to understand editing actions. --- doc/ScintillaHistory.html | 5 +++++ win32/PlatWin.cxx | 7 +++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 1c7943845..b7e20b12f 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -513,6 +513,11 @@ Bug #1779.
  • + On Windows using DirectWrite, for ligatures and other character clusters, + display caret and selections part-way through clusters so that the caret doesn't stick + to the end of the cluster making it easier to understand editing actions. +
  • +
  • On GTK+ on OS X, fix warning during destruction. Bug #1777.
  • diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index 79fccc22f..bf4f0503b 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -1614,17 +1614,16 @@ void SurfaceD2D::MeasureWidths(Font &font_, const char *s, int len, XYPOSITION * HRESULT hr = pIDWriteFactory->CreateTextLayout(tbuf.buffer, tbuf.tlen, pTextFormat, 10000.0, 1000.0, &pTextLayout); if (!SUCCEEDED(hr)) return; - // For now, assuming WCHAR == cluster if (!SUCCEEDED(pTextLayout->GetClusterMetrics(clusterMetrics, clusters, &count))) return; + // A cluster may be more than one WCHAR, such as for "ffi" which is a ligature in the Candara font FLOAT position = 0.0f; size_t ti=0; for (size_t ci=0; ci(tbuf.tlen)); pTextLayout->Release(); -- cgit v1.2.3