aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32/PlatWin.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'win32/PlatWin.cxx')
-rw-r--r--win32/PlatWin.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index e407bd630..766c91ef9 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -296,12 +296,10 @@ FontID CreateFontFromParameters(const FontParameters &fp) {
} else {
#if defined(USE_D2D)
IDWriteTextFormat *pTextFormat = nullptr;
- const int faceSize = 200;
- WCHAR wszFace[faceSize] = L"";
- UTF16FromUTF8(fp.faceName, wszFace, faceSize);
+ const std::wstring wsFace = WStringFromUTF8(fp.faceName);
const FLOAT fHeight = fp.size;
const DWRITE_FONT_STYLE style = fp.italic ? DWRITE_FONT_STYLE_ITALIC : DWRITE_FONT_STYLE_NORMAL;
- HRESULT hr = pIDWriteFactory->CreateTextFormat(wszFace, nullptr,
+ HRESULT hr = pIDWriteFactory->CreateTextFormat(wsFace.c_str(), nullptr,
static_cast<DWRITE_FONT_WEIGHT>(fp.weight),
style,
DWRITE_FONT_STRETCH_NORMAL, fHeight, L"en-us", &pTextFormat);