summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--macosx/tkMacOSXFont.c6
-rw-r--r--macosx/tkMacOSXXStubs.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c
index c2c884f..5e980d6 100644
--- a/macosx/tkMacOSXFont.c
+++ b/macosx/tkMacOSXFont.c
@@ -205,7 +205,7 @@ GetTkFontAttributesForNSFont(
NSFontTraitMask traits = [[NSFontManager sharedFontManager]
traitsOfFont:nsFont];
faPtr->family = Tk_GetUid([[nsFont familyName] UTF8String]);
-#define FACTOR (3.0/4.0)
+#define FACTOR 0.75
faPtr->size = [nsFont pointSize] * FACTOR;
faPtr->weight = (traits & NSBoldFontMask ? TK_FW_BOLD : TK_FW_NORMAL);
faPtr->slant = (traits & NSItalicFontMask ? TK_FS_ITALIC : TK_FS_ROMAN);
@@ -716,7 +716,7 @@ TkpGetFontFromAttributes(
/* Set of attributes to match. */
{
MacFont *fontPtr;
- int points = (int) (TkFontGetPoints(tkwin, faPtr->size) * 4.0 / 3.0 + 0.5);
+ CGFloat points = floor(TkFontGetPoints(tkwin, faPtr->size / FACTOR) + 0.5);
NSFontTraitMask traits = GetNSFontTraitsFromTkFontAttributes(faPtr);
NSInteger weight = (faPtr->weight == TK_FW_BOLD ? 9 : 5);
NSFont *nsFont;
@@ -738,7 +738,7 @@ TkpGetFontFromAttributes(
if (tkFontPtr == NULL) {
fontPtr = (MacFont *)ckalloc(sizeof(MacFont));
} else {
- fontPtr = (MacFont *) tkFontPtr;
+ fontPtr = (MacFont *)tkFontPtr;
TkpDeleteFont(tkFontPtr);
}
CFRetain(nsFont); /* Always needed to allow unconditional CFRelease below */
diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c
index b3584ce..823fba8 100644
--- a/macosx/tkMacOSXXStubs.c
+++ b/macosx/tkMacOSXXStubs.c
@@ -94,8 +94,8 @@ TkMacOSXDisplayChanged(
DefaultDepthOfScreen(screen) = NSBitsPerPixelFromDepth([s depth]);
WidthOfScreen(screen) = bounds.size.width;
HeightOfScreen(screen) = bounds.size.height;
- WidthMMOfScreen(screen) = (bounds.size.width * 254 * 3 / 4 + 360) / 720;
- HeightMMOfScreen(screen) = (bounds.size.height * 254 * 3 / 4 + 360) / 720;
+ WidthMMOfScreen(screen) = (bounds.size.width * 381 + 720) / 1440; /* = 3/4 * 254/720 */
+ HeightMMOfScreen(screen) = (bounds.size.height * 381 + 720) / 1440; /* = 3/4 * 254/720 */
for (s in nsScreens) {
maxBounds = NSUnionRect(maxBounds, [s visibleFrame]);