diff options
author | nyamatongwe <unknown> | 2013-04-09 21:20:52 +1000 |
---|---|---|
committer | nyamatongwe <unknown> | 2013-04-09 21:20:52 +1000 |
commit | 6cc4823eb0ac95c98ee1fbf322900af490fa16da (patch) | |
tree | e416ccc8a6ef429d715e9e87fff83ad2ab3c728c | |
parent | ad3a7b2b4808a72fb6a551068d474063caa5b4ae (diff) | |
download | scintilla-mirror-6cc4823eb0ac95c98ee1fbf322900af490fa16da.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)); } |