Kaisuke Nakajima points out that it's unnecessary to translate
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Wed, 21 Jan 2004 20:59:20 +0000 (20:59 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Wed, 21 Jan 2004 20:59:20 +0000 (20:59 +0000)
negative font sizes (meaning pixels) into positive ones (points) in
winstore.c, since it gets done anyway at the point of font creation;
and removing the code in winstore.c means that the precise font
entered by the user is saved in the config, rather than being
rounded.

git-svn-id: svn://svn.tartarus.org/sgt/putty@3755 cda61777-01e9-0310-a592-d414129be87e

winctrls.c
winstore.c

index 4a35cb6..0fb4b9f 100644 (file)
@@ -2282,8 +2282,9 @@ void dlg_fontsel_set(union control *ctrl, void *dlg, FontSpec fs)
     if (fs.height == 0)
        buf = dupprintf("Font: %s, %sdefault height", fs.name, boldstr);
     else
-       buf = dupprintf("Font: %s, %s%d-point", fs.name, boldstr,
-                       (fs.height < 0 ? -fs.height : fs.height));
+       buf = dupprintf("Font: %s, %s%d-%s", fs.name, boldstr,
+                       (fs.height < 0 ? -fs.height : fs.height),
+                       (fs.height < 0 ? "pixel" : "point"));
     SetDlgItemText(dp->hwnd, c->base_id+1, buf);
     sfree(buf);
 }
index 553f474..3ce84e0 100644 (file)
@@ -182,18 +182,6 @@ int read_setting_fontspec(void *handle, const char *name, FontSpec *result)
     ret.height = read_setting_i(handle, settingname, INT_MIN);
     sfree(settingname);
     if (ret.height == INT_MIN) return 0;
-    if (ret.height < 0) {
-       int oldh, newh;
-       HDC hdc = GetDC(NULL);
-       int logpix = GetDeviceCaps(hdc, LOGPIXELSY);
-       ReleaseDC(NULL, hdc);
-
-       oldh = -ret.height;
-       newh = MulDiv(oldh, 72, logpix) + 1;
-       if (MulDiv(newh, logpix, 72) > oldh)
-           newh--;
-       ret.height = newh;
-    }
     *result = ret;
     return 1;
 }