summaryrefslogtreecommitdiffstats
path: root/win/tkWinFont.c
diff options
context:
space:
mode:
Diffstat (limited to 'win/tkWinFont.c')
-rw-r--r--win/tkWinFont.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/win/tkWinFont.c b/win/tkWinFont.c
index b5e6679..a2eae27 100644
--- a/win/tkWinFont.c
+++ b/win/tkWinFont.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinFont.c,v 1.40 2008/10/05 18:22:22 dkf Exp $
+ * RCS: @(#) $Id: tkWinFont.c,v 1.41 2008/10/18 11:31:29 patthoyts Exp $
*/
#include "tkWinInt.h"
@@ -1403,13 +1403,26 @@ InitFont(
fontPtr->font.fid = (Font) fontPtr;
fontPtr->hwnd = hwnd;
- fontPtr->pixelSize = tm.tmHeight - tm.tmInternalLeading;
+ fontPtr->pixelSize = tm.tmHeight;
+
+ /*
+ * The font pixelSize should be the tmHeight - tmInternalLeading
+ * but this causes fonts to appear too small on for instance
+ * Russian systems where there is internal leading in use.
+ * This hack appears to sort things out.
+ * NB: the logic on this flag is reversed - this means if the
+ * font is not fixed then subtract the leading value.
+ */
+
+ if (tm.tmPitchAndFamily & TMPF_FIXED_PITCH) {
+ fontPtr->pixelSize -= tm.tmInternalLeading;
+ }
faPtr = &fontPtr->font.fa;
faPtr->family = Tk_GetUid(Tcl_DStringValue(&faceString));
faPtr->size =
- TkFontGetPoints(tkwin, -(fontPtr->pixelSize));
+ TkFontGetPoints(tkwin, -(fontPtr->pixelSize));
faPtr->weight =
(tm.tmWeight > FW_MEDIUM) ? TK_FW_BOLD : TK_FW_NORMAL;
faPtr->slant = (tm.tmItalic != 0) ? TK_FS_ITALIC : TK_FS_ROMAN;