Re: Screen font size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/9/07, L. Rahyen <research@xxxxxxxxxx> wrote:
> On Tuesday October 9 2007 18:34, Nigel Liang wrote:
> > Does the attached patch to increase the range for LogPixel slider in
> > winecfg seem like it would be helpful? Or is anyone out there running
> > at resolutions higher than 255 DPI? :)
>
>         Thanks for looking into this problem.
>         Your patch allows to set more than 120 up to 255 DPI and this is great but
> there is a problem. If I set 128 or more then when I open winecfg again it
> doesn't show my current DPI setting; it shows 63 instead. However real DPI
> setting is much higher (for example, 149 DPI - that's my normal DPI size for
> both WINE and Windows in VMWare). Maybe a problem with unsigned to signed
> conversion somewhere?... This needs to be fixed before actually submitting
> your patch to wine-patches mailing list.
>
Ah~ This is because the get_reg_key function does W->A conversion on
everything it outputs. Could you try this patch that calls
get_reg_keyW instead and see if this solves your problem?

-Nigel
diff --git a/programs/winecfg/x11drvdlg.c b/programs/winecfg/x11drvdlg.c
index 0a4e597..79f24bb 100644
--- a/programs/winecfg/x11drvdlg.c
+++ b/programs/winecfg/x11drvdlg.c
@@ -36,8 +36,8 @@ #include "winecfg.h"
 WINE_DEFAULT_DEBUG_CHANNEL(winecfg);
 
 #define RES_MAXLEN 5 /* the maximum number of characters in a screen dimension. 5 digits should be plenty, what kind of crazy person runs their screen >10,000 pixels across? */
-#define MINDPI 96
-#define MAXDPI 120
+#define MINDPI 80
+#define MAXDPI 255
 #define DEFDPI 96
 
 static const char logpixels_reg[] = "System\\CurrentControlSet\\Hardware Profiles\\Current\\Software\\Fonts";
@@ -243,9 +243,13 @@ static void on_d3d_pshader_mode_clicked(
 }
 static INT read_logpixels_reg(void)
 {
+    static const WCHAR szLogPixels[] = {'L','o','g','P','i','x','e','l','s',0};
+    WCHAR szLogPixelsReg[MAXBUFLEN];
+    WCHAR *buf;
     DWORD dwLogPixels;
-    char *buf  = get_reg_key(HKEY_LOCAL_MACHINE, logpixels_reg,
-                             "LogPixels", NULL);
+
+    MultiByteToWideChar(CP_ACP, 0, logpixels_reg, -1, szLogPixelsReg, -1);
+    buf  = get_reg_keyW(HKEY_LOCAL_MACHINE, szLogPixelsReg, szLogPixels, NULL);
     dwLogPixels = buf ? *buf : DEFDPI;
     HeapFree(GetProcessHeap(), 0, buf);
     return dwLogPixels;
_______________________________________________
wine-users mailing list
wine-users@xxxxxxxxxx
http://www.winehq.org/mailman/listinfo/wine-users

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux