aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2011-08-02 13:22:10 +1000
committernyamatongwe <devnull@localhost>2011-08-02 13:22:10 +1000
commit32ccf7ecf4286b9ce64360c1c857f743cbcf51f4 (patch)
tree173cd875af9467857796b75169730c08a6b2144b
parentc4ba4ab013dc711f9caa5521b635b68f92a87e33 (diff)
downloadscintilla-mirror-32ccf7ecf4286b9ce64360c1c857f743cbcf51f4.tar.gz
Use SEMI_BOLD for bold as Segoe UI looks better at semi bold than bold.
Allow fractional font sizes by multiplying by 1000.
-rw-r--r--win32/PlatWin.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index d4a015cf9..9e9ead409 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -313,8 +313,10 @@ FontCached::FontCached(const char *faceName_, int characterSet_, float size_, bo
WCHAR wszFace[faceSize];
UTF16FromUTF8(faceName_, strlen(faceName_)+1, wszFace, faceSize);
FLOAT fHeight = size_;
+ if (fHeight > 2000)
+ fHeight = fHeight / 1000.0f;
HRESULT hr = pIDWriteFactory->CreateTextFormat(wszFace, NULL,
- bold_ ? DWRITE_FONT_WEIGHT_BOLD : DWRITE_FONT_WEIGHT_REGULAR,
+ bold_ ? DWRITE_FONT_WEIGHT_SEMI_BOLD : DWRITE_FONT_WEIGHT_REGULAR,
italic_ ? DWRITE_FONT_STYLE_ITALIC : DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, fHeight, L"en-us", &pTextFormat);
if (SUCCEEDED(hr)) {