From 46a0809b348e8c7c67fa1631e16eee016e23ff4c Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Tue, 2 Aug 2011 13:22:10 +1000 Subject: Use SEMI_BOLD for bold as Segoe UI looks better at semi bold than bold. Allow fractional font sizes by multiplying by 1000. --- win32/PlatWin.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)) { -- cgit v1.2.3