diff options
author | nyamatongwe <devnull@localhost> | 2013-04-09 21:20:52 +1000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2013-04-09 21:20:52 +1000 |
commit | 626e279016822c6ac8266ad56199828de07bfdac (patch) | |
tree | c155eb070f1b64d849518b82b21d2be8d9037bf8 | |
parent | 7e5ed4ea8e8206b6773faabf2f2a998b30963535 (diff) | |
download | scintilla-mirror-626e279016822c6ac8266ad56199828de07bfdac.tar.gz |
With DirectWrite, text was drawn at different vertical positions depending on which
other characters were draw in the same call. Switching to DWRITE_LINE_SPACING_METHOD_UNIFORM
fixed this.
-rw-r--r-- | win32/PlatWin.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index f23f0a6e8..1a39b1350 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -369,6 +369,12 @@ FontCached::FontCached(const FontParameters &fp) : } } pTextLayout->Release(); + DWRITE_LINE_SPACING_METHOD lineSpacingMethod=DWRITE_LINE_SPACING_METHOD_DEFAULT; + FLOAT lineSpacing=0; + FLOAT baseline=0; + if (SUCCEEDED(pTextFormat->GetLineSpacing(&lineSpacingMethod, &lineSpacing, &baseline))) { + pTextFormat->SetLineSpacing(DWRITE_LINE_SPACING_METHOD_UNIFORM, lineMetrics[0].height, lineMetrics[0].baseline); + } } fid = reinterpret_cast<void *>(new FormatAndMetrics(pTextFormat, fp.extraFontFlag, fp.characterSet, yAscent, yDescent, yInternalLeading)); } |