diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-01-18 13:03:38 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-01-18 13:03:38 (GMT) |
commit | 0b2fc80ed0e336ab6bf3099bf5d992bf3c4a369a (patch) | |
tree | 50d04c2abe85107c4e62282225cbba5bd5c952cc /win/tkWinFont.c | |
parent | b5023c71059a0bbc386c8ad8f48d3cf42e629fd7 (diff) | |
parent | 138b094f7e36c97e17af4e3d2a2228bba8bbf00f (diff) | |
download | tk-0b2fc80ed0e336ab6bf3099bf5d992bf3c4a369a.zip tk-0b2fc80ed0e336ab6bf3099bf5d992bf3c4a369a.tar.gz tk-0b2fc80ed0e336ab6bf3099bf5d992bf3c4a369a.tar.bz2 |
merge core-8-6-branch
Diffstat (limited to 'win/tkWinFont.c')
-rw-r--r-- | win/tkWinFont.c | 41 |
1 files changed, 16 insertions, 25 deletions
diff --git a/win/tkWinFont.c b/win/tkWinFont.c index d0e3309..4121cc3 100644 --- a/win/tkWinFont.c +++ b/win/tkWinFont.c @@ -262,16 +262,7 @@ void TkpFontPkgInit( TkMainInfo *mainPtr) /* The application being created. */ { - if (TkWinGetPlatformId() == VER_PLATFORM_WIN32_NT) { - /* - * If running NT, then we will be calling some Unicode functions - * explictly. So, even if the Tcl system encoding isn't Unicode, make - * sure we convert to/from the Unicode char set. - */ - - systemEncoding = TkWinGetUnicodeEncoding(); - } - + systemEncoding = TkWinGetUnicodeEncoding(); TkWinSetupSystemFonts(mainPtr); } @@ -760,14 +751,14 @@ TkpGetFontAttrsForChar( * character */ FontFamily *familyPtr = thisSubFontPtr->familyPtr; HFONT oldfont; /* Saved font from the device context */ - TEXTMETRICA tm; /* Font metrics of the selected subfont */ + TEXTMETRIC tm; /* Font metrics of the selected subfont */ /* * Get the font attributes. */ oldfont = SelectObject(hdc, thisSubFontPtr->hFont0); - GetTextMetricsA(hdc, &tm); + GetTextMetrics(hdc, &tm); SelectObject(hdc, oldfont); ReleaseDC(fontPtr->hwnd, hdc); faPtr->family = familyPtr->faceName; @@ -1118,7 +1109,7 @@ Tk_DrawChars( HBRUSH oldBrush, stipple; HBITMAP oldBitmap, bitmap; HDC dcMem; - TEXTMETRICA tm; + TEXTMETRIC tm; SIZE size; if (twdPtr->type != TWD_BITMAP) { @@ -1145,7 +1136,7 @@ Tk_DrawChars( */ GetTextExtentPointA(dcMem, source, numBytes, &size); - GetTextMetricsA(dcMem, &tm); + GetTextMetrics(dcMem, &tm); size.cx -= tm.tmOverhang; bitmap = CreateCompatibleBitmap(dc, size.cx, size.cy); oldBitmap = SelectObject(dcMem, bitmap); @@ -1184,7 +1175,7 @@ Tk_DrawChars( } else { HBITMAP oldBitmap, bitmap; HDC dcMem; - TEXTMETRICA tm; + TEXTMETRIC tm; SIZE size; dcMem = CreateCompatibleDC(dc); @@ -1199,7 +1190,7 @@ Tk_DrawChars( */ GetTextExtentPointA(dcMem, source, numBytes, &size); - GetTextMetricsA(dcMem, &tm); + GetTextMetrics(dcMem, &tm); size.cx -= tm.tmOverhang; bitmap = CreateCompatibleBitmap(dc, size.cx, size.cy); oldBitmap = SelectObject(dcMem, bitmap); @@ -1266,7 +1257,7 @@ TkDrawAngledChars( HBRUSH oldBrush, stipple; HBITMAP oldBitmap, bitmap; HDC dcMem; - TEXTMETRICA tm; + TEXTMETRIC tm; SIZE size; if (twdPtr->type != TWD_BITMAP) { @@ -1293,7 +1284,7 @@ TkDrawAngledChars( */ GetTextExtentPointA(dcMem, source, numBytes, &size); - GetTextMetricsA(dcMem, &tm); + GetTextMetrics(dcMem, &tm); size.cx -= tm.tmOverhang; bitmap = CreateCompatibleBitmap(dc, size.cx, size.cy); oldBitmap = SelectObject(dcMem, bitmap); @@ -1332,7 +1323,7 @@ TkDrawAngledChars( } else { HBITMAP oldBitmap, bitmap; HDC dcMem; - TEXTMETRICA tm; + TEXTMETRIC tm; SIZE size; dcMem = CreateCompatibleDC(dc); @@ -1347,7 +1338,7 @@ TkDrawAngledChars( */ GetTextExtentPointA(dcMem, source, numBytes, &size); - GetTextMetricsA(dcMem, &tm); + GetTextMetrics(dcMem, &tm); size.cx -= tm.tmOverhang; bitmap = CreateCompatibleBitmap(dc, size.cx, size.cy); oldBitmap = SelectObject(dcMem, bitmap); @@ -1454,11 +1445,11 @@ MultiFontTextOut( Tcl_DString runString; const char *p, *end, *next; SubFont *lastSubFontPtr, *thisSubFontPtr; - TEXTMETRICA tm; + TEXTMETRIC tm; lastSubFontPtr = &fontPtr->subFontArray[0]; oldFont = SelectFont(hdc, fontPtr, lastSubFontPtr, angle); - GetTextMetricsA(hdc, &tm); + GetTextMetrics(hdc, &tm); end = source + numBytes; for (p = source; p < end; ) { @@ -1482,7 +1473,7 @@ MultiFontTextOut( lastSubFontPtr = thisSubFontPtr; source = p; SelectFont(hdc, fontPtr, lastSubFontPtr, angle); - GetTextMetricsA(hdc, &tm); + GetTextMetrics(hdc, &tm); } p = next; } @@ -1560,7 +1551,7 @@ InitFont( HDC hdc; HWND hwnd; HFONT oldFont; - TEXTMETRICA tm; + TEXTMETRIC tm; Window window; TkFontMetrics *fmPtr; Tcl_Encoding encoding; @@ -1573,7 +1564,7 @@ InitFont( hdc = GetDC(hwnd); oldFont = SelectObject(hdc, hFont); - GetTextMetricsA(hdc, &tm); + GetTextMetrics(hdc, &tm); /* * On any version NT, there may fonts with international names. Use the |