Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
ce4dfe23
Commit
ce4dfe23
authored
Aug 26, 2004
by
Huw Davies
Committed by
Alexandre Julliard
Aug 26, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deprecate the "Resolution" entry in the config file in favour of
HKEY_CURRNET_CONFIG\Software\Fonts\LogPixels.
parent
32902591
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
63 additions
and
37 deletions
+63
-37
init.c
dlls/x11drv/init.c
+50
-4
x11drv.h
dlls/x11drv/x11drv.h
+1
-1
xfont.c
dlls/x11drv/xfont.c
+11
-31
config
documentation/samples/config
+0
-1
wine.inf
tools/wine.inf
+1
-0
No files found.
dlls/x11drv/init.c
View file @
ce4dfe23
...
...
@@ -45,6 +45,51 @@ unsigned int text_caps = (TC_OP_CHARACTER | TC_OP_STROKE | TC_CP_STROKE |
TC_SA_CONTIN
|
TC_UA_ABLE
|
TC_SO_ABLE
|
TC_RA_ABLE
);
/* X11R6 adds TC_SF_X_YINDEP, Xrender adds TC_VA_ABLE */
static
const
WCHAR
dpi_key_name
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'F'
,
'o'
,
'n'
,
't'
,
's'
,
'\0'
};
static
const
WCHAR
dpi_value_name
[]
=
{
'L'
,
'o'
,
'g'
,
'P'
,
'i'
,
'x'
,
'e'
,
'l'
,
's'
,
'\0'
};
static
const
WCHAR
INIFontSection
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'e'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'e'
,
'\\'
,
'C'
,
'o'
,
'n'
,
'f'
,
'i'
,
'g'
,
'\\'
,
'f'
,
'o'
,
'n'
,
't'
,
's'
,
'\0'
};
static
const
WCHAR
INIResolution
[]
=
{
'R'
,
'e'
,
's'
,
'o'
,
'l'
,
'u'
,
't'
,
'i'
,
'o'
,
'n'
,
'\0'
};
/******************************************************************************
* get_dpi
*
* get the dpi from the registry
*/
static
DWORD
get_dpi
(
void
)
{
DWORD
dpi
=
96
;
HKEY
hkey
;
if
(
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
INIFontSection
,
&
hkey
)
==
ERROR_SUCCESS
)
{
char
buffer
[
20
];
DWORD
type
,
count
=
sizeof
(
buffer
);
if
(
RegQueryValueExW
(
hkey
,
INIResolution
,
0
,
&
type
,
buffer
,
&
count
)
==
ERROR_SUCCESS
)
if
(
atoi
(
buffer
)
!=
96
)
MESSAGE
(
"Please use the registry key HKEY_CURRENT_CONFIG
\\
Sotfware
\\
Fonts
\\
LogPixels
\n
"
"to set the screen resolution and remove the
\"
Resolution
\"
entry in the config file
\n
"
);
RegCloseKey
(
hkey
);
}
if
(
RegOpenKeyW
(
HKEY_CURRENT_CONFIG
,
dpi_key_name
,
&
hkey
)
==
ERROR_SUCCESS
)
{
DWORD
type
,
size
,
new_dpi
;
size
=
sizeof
(
new_dpi
);
if
(
RegQueryValueExW
(
hkey
,
dpi_value_name
,
NULL
,
&
type
,
(
void
*
)
&
new_dpi
,
&
size
)
==
ERROR_SUCCESS
)
{
if
(
type
==
REG_DWORD
&&
new_dpi
!=
0
)
dpi
=
new_dpi
;
}
RegCloseKey
(
hkey
);
}
return
dpi
;
}
/**********************************************************************
* X11DRV_GDI_Initialize
*/
...
...
@@ -59,12 +104,13 @@ void X11DRV_GDI_Initialize( Display *display )
/* Initialize XRender */
X11DRV_XRender_Init
();
/* Initialize fonts and text caps */
log_pixels_x
=
log_pixels_y
=
96
;
X11DRV_FONT_Init
(
&
log_pixels_x
,
&
log_pixels_y
);
/* Initialize device caps */
log_pixels_x
=
log_pixels_y
=
get_dpi
();
horz_size
=
MulDiv
(
screen_width
,
254
,
log_pixels_x
*
10
);
vert_size
=
MulDiv
(
screen_height
,
254
,
log_pixels_y
*
10
);
/* Initialize fonts and text caps */
X11DRV_FONT_Init
(
log_pixels_x
,
log_pixels_y
);
}
/**********************************************************************
...
...
dlls/x11drv/x11drv.h
View file @
ce4dfe23
...
...
@@ -197,7 +197,7 @@ extern BOOL X11DRV_SwapBuffers(X11DRV_PDEVICE *physDev);
/* X11 driver internal functions */
extern
void
X11DRV_BITMAP_Init
(
void
);
extern
void
X11DRV_FONT_Init
(
int
*
log_pixels_x
,
int
*
log_pixels_y
);
extern
void
X11DRV_FONT_Init
(
int
log_pixels_x
,
int
log_pixels_y
);
struct
tagBITMAPOBJ
;
extern
int
X11DRV_DIB_BitmapInfoSize
(
const
BITMAPINFO
*
info
,
WORD
coloruse
);
...
...
dlls/x11drv/xfont.c
View file @
ce4dfe23
...
...
@@ -83,7 +83,6 @@ static const char* INIAliasSection = "Alias";
static
const
char
*
INIIgnoreSection
=
"Ignore"
;
static
const
char
*
INIDefault
=
"Default"
;
static
const
char
*
INIDefaultFixed
=
"DefaultFixed"
;
static
const
char
*
INIResolution
=
"Resolution"
;
static
const
char
*
INIGlobalMetrics
=
"FontMetrics"
;
static
const
char
*
INIDefaultSerif
=
"DefaultSerif"
;
static
const
char
*
INIDefaultSansSerif
=
"DefaultSansSerif"
;
...
...
@@ -2390,44 +2389,25 @@ static BOOL XFONT_WriteCachedMetrics( int fd, unsigned x_checksum, int x_count,
}
/***********************************************************************
* XFONT_Get
Point
Resolution()
* XFONT_Get
Def
Resolution()
*
* INIT ONLY
*
* Here we initialize DefResolution which is used in the
* XFONT_Match() penalty function. We also load the point
* resolution value (higher values result in larger fonts).
* XFONT_Match() penalty function, based on the values of log_pixels
*/
static
int
XFONT_Get
PointResolution
(
int
*
log_pixels_x
,
int
*
log_pixels_y
)
static
int
XFONT_Get
DefResolution
(
int
log_pixels_x
,
int
log_pixels_y
)
{
int
i
,
j
,
point_resolution
,
num
=
3
;
int
i
,
j
,
num
=
3
;
int
allowed_xfont_resolutions
[
3
]
=
{
72
,
75
,
100
};
int
best
=
0
,
best_diff
=
65536
;
HKEY
hkey
;
point_resolution
=
0
;
if
(
!
RegOpenKeyA
(
HKEY_LOCAL_MACHINE
,
INIFontSection
,
&
hkey
))
{
char
buffer
[
20
];
DWORD
type
,
count
=
sizeof
(
buffer
);
if
(
!
RegQueryValueExA
(
hkey
,
INIResolution
,
0
,
&
type
,
buffer
,
&
count
))
point_resolution
=
atoi
(
buffer
);
RegCloseKey
(
hkey
);
}
if
(
!
point_resolution
)
point_resolution
=
*
log_pixels_y
;
else
*
log_pixels_x
=
*
log_pixels_y
=
point_resolution
;
/* FIXME We can only really guess at a best DefResolution
* - this should be configurable
*/
for
(
i
=
best
=
0
;
i
<
num
;
i
++
)
{
j
=
abs
(
point_resolution
-
allowed_xfont_resolutions
[
i
]
);
j
=
abs
(
log_pixels_x
-
allowed_xfont_resolutions
[
i
]
);
if
(
j
<
best_diff
)
{
best
=
i
;
...
...
@@ -2435,7 +2415,7 @@ static int XFONT_GetPointResolution( int *log_pixels_x, int *log_pixels_y )
}
}
DefResolution
=
allowed_xfont_resolutions
[
best
];
return
point_r
esolution
;
return
DefR
esolution
;
}
...
...
@@ -3012,14 +2992,14 @@ void X11DRV_FONT_InitX11Metrics( void )
/***********************************************************************
* X11DRV_FONT_Init
*/
void
X11DRV_FONT_Init
(
int
*
log_pixels_x
,
int
*
log_pixels_y
)
void
X11DRV_FONT_Init
(
int
log_pixels_x
,
int
log_pixels_y
)
{
XFONT_GetPoint
Resolution
(
log_pixels_x
,
log_pixels_y
);
XFONT_GetDef
Resolution
(
log_pixels_x
,
log_pixels_y
);
if
(
using_client_side_fonts
)
text_caps
|=
TC_VA_ABLE
;
if
(
using_client_side_fonts
)
text_caps
|=
TC_VA_ABLE
;
return
;
return
;
}
/**********************************************************************
...
...
documentation/samples/config
View file @
ce4dfe23
...
...
@@ -94,7 +94,6 @@ WINE REGISTRY Version 2
[fonts]
;Read the Fonts topic in the Wine User Guide before adding aliases
;See a couple of examples for russian users below
"Resolution" = "96"
"Default" = "-adobe-helvetica-"
"DefaultFixed" = "fixed"
"DefaultSerif" = "-adobe-times-"
...
...
tools/wine.inf
View file @
ce4dfe23
...
...
@@ -156,6 +156,7 @@ HKLM,%FontSubStr%,"Times New Roman CYR,204",,"Times New Roman,204"
HKLM,%FontSubStr%,"Times New Roman Greek,161",,"Times New Roman,161"
HKLM,%FontSubStr%,"Times New Roman TUR,162",,"Times New Roman,162"
HKLM,%FontSubStr%,"Tms Rmn",,"Times New Roman"
HKLM,System\CurrentControlSet\Hardware Profiles\Current\Software\Fonts,"LogPixels",0x10001,00000060
[MCI]
HKLM,%Mci32Str%,"AVIVideo",,"mciavi.drv"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment