aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32/ScintillaWin.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'win32/ScintillaWin.cxx')
-rw-r--r--win32/ScintillaWin.cxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx
index 070ab0fb2..0dd715d6d 100644
--- a/win32/ScintillaWin.cxx
+++ b/win32/ScintillaWin.cxx
@@ -2459,7 +2459,7 @@ void ScintillaWin::ImeStartComposition() {
// Since the style creation code has been made platform independent,
// The logfont for the IME is recreated here.
int styleHere = (pdoc->StyleAt(sel.MainCaret())) & 31;
- LOGFONTA lf = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ""};
+ LOGFONTW lf = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, L""};
int sizeZoomed = vs.styles[styleHere].size + vs.zoomLevel * SC_FONT_SIZE_MULTIPLIER;
if (sizeZoomed <= 2 * SC_FONT_SIZE_MULTIPLIER) // Hangs if sizeZoomed <= 1
sizeZoomed = 2 * SC_FONT_SIZE_MULTIPLIER;
@@ -2473,11 +2473,13 @@ void ScintillaWin::ImeStartComposition() {
lf.lfWeight = vs.styles[styleHere].weight;
lf.lfItalic = static_cast<BYTE>(vs.styles[styleHere].italic ? 1 : 0);
lf.lfCharSet = DEFAULT_CHARSET;
- lf.lfFaceName[0] = '\0';
- if (vs.styles[styleHere].fontName)
- StringCopy(lf.lfFaceName, vs.styles[styleHere].fontName);
+ lf.lfFaceName[0] = L'\0';
+ if (vs.styles[styleHere].fontName) {
+ const char* fontName = vs.styles[styleHere].fontName;
+ UTF16FromUTF8(fontName, strlen(fontName)+1, lf.lfFaceName, LF_FACESIZE);
+ }
- ::ImmSetCompositionFontA(hIMC, &lf);
+ ::ImmSetCompositionFontW(hIMC, &lf);
}
::ImmReleaseContext(MainHWND(), hIMC);
// Caret is displayed in IME window. So, caret in Scintilla is useless.