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
a1953658
Commit
a1953658
authored
Feb 19, 2010
by
Vincent Povirk
Committed by
Alexandre Julliard
Feb 22, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32: Always use screen dpi in the font dialog, even with a printer dc.
parent
9bb6932e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
13 deletions
+20
-13
fontdlg.c
dlls/comdlg32/fontdlg.c
+18
-11
fontdlg.c
dlls/comdlg32/tests/fontdlg.c
+2
-2
No files found.
dlls/comdlg32/fontdlg.c
View file @
a1953658
...
...
@@ -456,6 +456,21 @@ static inline HDC CFn_GetDC(const CHOOSEFONTW *lpcf)
}
/*************************************************************************
* GetScreenDPI [internal]
*/
static
inline
int
GetScreenDPI
(
void
)
{
HDC
hdc
;
int
result
;
hdc
=
GetDC
(
0
);
result
=
GetDeviceCaps
(
hdc
,
LOGPIXELSY
);
ReleaseDC
(
0
,
hdc
);
return
result
;
}
/*************************************************************************
* CFn_ReleaseDC [internal]
*/
static
inline
void
CFn_ReleaseDC
(
const
CHOOSEFONTW
*
lpcf
,
HDC
hdc
)
...
...
@@ -486,10 +501,8 @@ static INT AddFontStyle( const ENUMLOGFONTEXW *lpElfex, const NEWTEXTMETRICEXW *
if
(
nFontType
&
RASTER_FONTTYPE
)
{
INT
points
;
if
(
!
(
hdc
=
CFn_GetDC
(
lpcf
)))
return
0
;
points
=
MulDiv
(
lpNTM
->
ntmTm
.
tmHeight
-
lpNTM
->
ntmTm
.
tmInternalLeading
,
72
,
GetDeviceCaps
(
hdc
,
LOGPIXELSY
));
CFn_ReleaseDC
(
lpcf
,
hdc
);
72
,
GetScreenDPI
());
i
=
AddFontSizeToCombo3
(
hcmb3
,
points
,
lpcf
);
if
(
i
)
return
0
;
}
else
if
(
SetFontSizesToCombo3
(
hcmb3
,
lpcf
))
return
0
;
...
...
@@ -705,7 +718,7 @@ static LRESULT CFn_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam, LPCHOOS
lpxx
->
lfHeight
;
INT
points
;
int
charset
=
lpxx
->
lfCharSet
;
points
=
MulDiv
(
height
,
72
,
Get
DeviceCaps
(
hdc
,
LOGPIXELSY
));
points
=
MulDiv
(
height
,
72
,
Get
ScreenDPI
(
));
pstyle
=
MAKELONG
(
lpxx
->
lfWeight
>
FW_MEDIUM
?
FW_BOLD
:
FW_NORMAL
,
lpxx
->
lfItalic
!=
0
);
SendDlgItemMessageW
(
hDlg
,
cmb1
,
CB_SETCURSEL
,
j
,
0
);
...
...
@@ -982,14 +995,8 @@ static LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam, LPCHOOSEFO
CB_GETITEMDATA
,
i
,
0
));
else
lpcf
->
iPointSize
=
100
;
hdc
=
CFn_GetDC
(
lpcf
);
if
(
hdc
)
{
lpxx
->
lfHeight
=
-
MulDiv
(
lpcf
->
iPointSize
,
GetDeviceCaps
(
hdc
,
LOGPIXELSY
),
720
);
CFn_ReleaseDC
(
lpcf
,
hdc
);
}
else
lpxx
->
lfHeight
=
-
lpcf
->
iPointSize
/
10
;
GetScreenDPI
(),
720
);
i
=
SendDlgItemMessageW
(
hDlg
,
cmb5
,
CB_GETCURSEL
,
0
,
0
);
if
(
i
!=
CB_ERR
)
lpxx
->
lfCharSet
=
SendDlgItemMessageW
(
hDlg
,
cmb5
,
CB_GETITEMDATA
,
i
,
0
);
...
...
dlls/comdlg32/tests/fontdlg.c
View file @
a1953658
...
...
@@ -135,8 +135,8 @@ static void test_ChooseFontA(void)
expected_lfheight
=
-
MulDiv
(
expected_pointsize
,
dpiy
,
720
);
ok
(
ret
==
TRUE
,
"ChooseFontA returned FALSE
\n
"
);
todo_wine
ok
(
cfa
.
iPointSize
==
expected_pointsize
,
"Expected %i, got %i
\n
"
,
expected_pointsize
,
cfa
.
iPointSize
);
todo_wine
ok
(
lfa
.
lfHeight
==
expected_lfheight
,
"Expected %i, got %i
\n
"
,
expected_lfheight
,
lfa
.
lfHeight
);
ok
(
cfa
.
iPointSize
==
expected_pointsize
,
"Expected %i, got %i
\n
"
,
expected_pointsize
,
cfa
.
iPointSize
);
ok
(
lfa
.
lfHeight
==
expected_lfheight
,
"Expected %i, got %i
\n
"
,
expected_lfheight
,
lfa
.
lfHeight
);
ok
(
lfa
.
lfWeight
==
FW_NORMAL
,
"Expected FW_NORMAL, got %i
\n
"
,
lfa
.
lfWeight
);
ok
(
strcmp
(
lfa
.
lfFaceName
,
"Symbol"
)
==
0
,
"Expected Symbol, got %s
\n
"
,
lfa
.
lfFaceName
);
...
...
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