summaryrefslogtreecommitdiffstats
path: root/win/tkWinFont.c
diff options
context:
space:
mode:
Diffstat (limited to 'win/tkWinFont.c')
-rw-r--r--win/tkWinFont.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/win/tkWinFont.c b/win/tkWinFont.c
index e48f93c..11385ed 100644
--- a/win/tkWinFont.c
+++ b/win/tkWinFont.c
@@ -2462,7 +2462,6 @@ GetScreenFont(
double angle) /* What is the desired orientation of the
* font. */
{
- Tcl_DString ds;
HFONT hFont;
LOGFONTW lf;
@@ -2481,10 +2480,7 @@ GetScreenFont(
lf.lfQuality = DEFAULT_QUALITY;
lf.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
- Tcl_DStringInit(&ds);
- Tcl_UtfToWCharDString(faceName, -1, &ds);
- wcsncpy(lf.lfFaceName, (WCHAR *)Tcl_DStringValue(&ds), LF_FACESIZE-1);
- Tcl_DStringFree(&ds);
+ MultiByteToWideChar(CP_UTF8, 0, faceName, -1, lf.lfFaceName, LF_FACESIZE);
lf.lfFaceName[LF_FACESIZE-1] = 0;
hFont = CreateFontIndirectW(&lf);
return hFont;