diff options
Diffstat (limited to 'core/src/fxge')
-rw-r--r-- | core/src/fxge/win32/fx_win32_device.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/src/fxge/win32/fx_win32_device.cpp b/core/src/fxge/win32/fx_win32_device.cpp index 2e2ea9a92b..9c03a30837 100644 --- a/core/src/fxge/win32/fx_win32_device.cpp +++ b/core/src/fxge/win32/fx_win32_device.cpp @@ -328,7 +328,9 @@ void* CWin32FontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitc for (int i = 0; i < iCount; ++i) { if (face == VariantNames[i].m_pFaceName) { CFX_WideString wsFace = CFX_WideString::FromLocal(facebuf); - CFX_WideString wsName = CFX_WideString::FromUTF16LE((const unsigned short*)VariantNames[i].m_pVariantName); + const unsigned short* pName = (const unsigned short*)VariantNames[i].m_pVariantName; + FX_STRSIZE len = CFX_WideString::WStringLength(pName); + CFX_WideString wsName = CFX_WideString::FromUTF16LE(pName, len); if (wsFace == wsName) { return hFont; } |