Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
ce6f6f74
Commit
ce6f6f74
authored
Oct 27, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 28, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Use dpiX/dpiY argument in GetRecommendedRenderingMode().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
daed36fb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
5 deletions
+77
-5
font.c
dlls/dwrite/font.c
+2
-0
font.c
dlls/dwrite/tests/font.c
+75
-5
No files found.
dlls/dwrite/font.c
View file @
ce6f6f74
...
...
@@ -1068,6 +1068,8 @@ static HRESULT WINAPI dwritefontface2_GetRecommendedRenderingMode(IDWriteFontFac
if
(
is_sideways
)
FIXME
(
"sideways mode not supported
\n
"
);
emSize
*=
max
(
dpiX
,
dpiY
)
/
96
.
0
f
;
*
renderingmode
=
DWRITE_RENDERING_MODE_DEFAULT
;
*
gridfitmode
=
DWRITE_GRID_FIT_MODE_DEFAULT
;
if
(
params
)
{
...
...
dlls/dwrite/tests/font.c
View file @
ce6f6f74
...
...
@@ -4439,12 +4439,11 @@ if (0) /* crashes on native */
for
(
emsize
=
1
.
0
;
emsize
<
500
.
0
;
emsize
+=
1
.
0
)
{
DWRITE_RENDERING_MODE
expected
;
FLOAT
ppdip
;
WORD
gasp
;
int
i
;
for
(
i
=
0
;
i
<
sizeof
(
recmode_tests
)
/
sizeof
(
recmode_tests
[
0
]);
i
++
)
{
FLOAT
ppdip
;
ppdip
=
1
.
0
f
;
mode
=
10
;
gasp
=
get_gasp_flags
(
fontface
,
emsize
,
ppdip
);
...
...
@@ -4487,12 +4486,82 @@ if (0) /* crashes on native */
/* IDWriteFontFace1 offers another variant of this method */
if
(
fontface1
)
{
for
(
i
=
0
;
i
<
sizeof
(
recmode_tests1
)
/
sizeof
(
recmode_tests1
[
0
]);
i
++
)
{
FLOAT
dpi
;
ppdip
=
1
.
0
f
;
dpi
=
96
.
0
f
*
ppdip
;
mode
=
10
;
expected
=
get_expected_rendering_mode
(
emsize
,
gasp
,
recmode_tests1
[
i
].
measuring
,
recmode_tests1
[
i
].
threshold
);
hr
=
IDWriteFontFace1_GetRecommendedRenderingMode
(
fontface1
,
emsize
,
96
.
0
,
96
.
0
,
gasp
=
get_gasp_flags
(
fontface
,
emsize
,
ppdip
);
expected
=
get_expected_rendering_mode
(
emsize
*
ppdip
,
gasp
,
recmode_tests1
[
i
].
measuring
,
recmode_tests1
[
i
].
threshold
);
hr
=
IDWriteFontFace1_GetRecommendedRenderingMode
(
fontface1
,
emsize
,
dpi
,
dpi
,
NULL
,
FALSE
,
recmode_tests1
[
i
].
threshold
,
recmode_tests1
[
i
].
measuring
,
&
mode
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
mode
==
expected
,
"%.2f/%d: got %d, flags 0x%04x, expected %d
\n
"
,
emsize
,
i
,
mode
,
gasp
,
expected
);
ok
(
mode
==
expected
,
"%.2f/%d: got %d, dpi %f, flags 0x%04x, expected %d
\n
"
,
emsize
,
i
,
mode
,
dpi
,
gasp
,
expected
);
/* Only test larger sizes to workaround Win7 differences, where unscaled natural emsize threshold is used;
Win8 and Win10 handle this as expected. */
if
(
emsize
>
20
.
0
f
)
{
ppdip
=
2
.
0
f
;
dpi
=
96
.
0
f
*
ppdip
;
mode
=
10
;
gasp
=
get_gasp_flags
(
fontface
,
emsize
,
ppdip
);
expected
=
get_expected_rendering_mode
(
emsize
*
ppdip
,
gasp
,
recmode_tests1
[
i
].
measuring
,
recmode_tests1
[
i
].
threshold
);
hr
=
IDWriteFontFace1_GetRecommendedRenderingMode
(
fontface1
,
emsize
,
dpi
,
dpi
,
NULL
,
FALSE
,
recmode_tests1
[
i
].
threshold
,
recmode_tests1
[
i
].
measuring
,
&
mode
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
mode
==
expected
,
"%.2f/%d: got %d, dpi %f, flags 0x%04x, expected %d
\n
"
,
emsize
,
i
,
mode
,
dpi
,
gasp
,
expected
);
ppdip
=
0
.
5
f
;
dpi
=
96
.
0
f
*
ppdip
;
mode
=
10
;
gasp
=
get_gasp_flags
(
fontface
,
emsize
,
ppdip
);
expected
=
get_expected_rendering_mode
(
emsize
*
ppdip
,
gasp
,
recmode_tests1
[
i
].
measuring
,
recmode_tests1
[
i
].
threshold
);
hr
=
IDWriteFontFace1_GetRecommendedRenderingMode
(
fontface1
,
emsize
,
dpi
,
dpi
,
NULL
,
FALSE
,
recmode_tests1
[
i
].
threshold
,
recmode_tests1
[
i
].
measuring
,
&
mode
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
mode
==
expected
,
"%.2f/%d: got %d, dpi %f, flags 0x%04x, expected %d
\n
"
,
emsize
,
i
,
mode
,
dpi
,
gasp
,
expected
);
/* try different dpis for X and Y direction */
ppdip
=
1
.
0
f
;
dpi
=
96
.
0
f
*
ppdip
;
mode
=
10
;
gasp
=
get_gasp_flags
(
fontface
,
emsize
,
ppdip
);
expected
=
get_expected_rendering_mode
(
emsize
*
ppdip
,
gasp
,
recmode_tests1
[
i
].
measuring
,
recmode_tests1
[
i
].
threshold
);
hr
=
IDWriteFontFace1_GetRecommendedRenderingMode
(
fontface1
,
emsize
,
dpi
*
0
.
5
f
,
dpi
,
NULL
,
FALSE
,
recmode_tests1
[
i
].
threshold
,
recmode_tests1
[
i
].
measuring
,
&
mode
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
mode
==
expected
,
"%.2f/%d: got %d, dpi %f, flags 0x%04x, expected %d
\n
"
,
emsize
,
i
,
mode
,
dpi
,
gasp
,
expected
);
ppdip
=
1
.
0
f
;
dpi
=
96
.
0
f
*
ppdip
;
mode
=
10
;
gasp
=
get_gasp_flags
(
fontface
,
emsize
,
ppdip
);
expected
=
get_expected_rendering_mode
(
emsize
*
ppdip
,
gasp
,
recmode_tests1
[
i
].
measuring
,
recmode_tests1
[
i
].
threshold
);
hr
=
IDWriteFontFace1_GetRecommendedRenderingMode
(
fontface1
,
emsize
,
dpi
,
dpi
*
0
.
5
f
,
NULL
,
FALSE
,
recmode_tests1
[
i
].
threshold
,
recmode_tests1
[
i
].
measuring
,
&
mode
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
mode
==
expected
,
"%.2f/%d: got %d, dpi %f, flags 0x%04x, expected %d
\n
"
,
emsize
,
i
,
mode
,
dpi
,
gasp
,
expected
);
ppdip
=
2
.
0
f
;
dpi
=
96
.
0
f
*
ppdip
;
mode
=
10
;
gasp
=
get_gasp_flags
(
fontface
,
emsize
,
ppdip
);
expected
=
get_expected_rendering_mode
(
emsize
*
ppdip
,
gasp
,
recmode_tests1
[
i
].
measuring
,
recmode_tests1
[
i
].
threshold
);
hr
=
IDWriteFontFace1_GetRecommendedRenderingMode
(
fontface1
,
emsize
,
dpi
*
0
.
5
f
,
dpi
,
NULL
,
FALSE
,
recmode_tests1
[
i
].
threshold
,
recmode_tests1
[
i
].
measuring
,
&
mode
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
mode
==
expected
,
"%.2f/%d: got %d, dpi %f, flags 0x%04x, expected %d
\n
"
,
emsize
,
i
,
mode
,
dpi
,
gasp
,
expected
);
ppdip
=
2
.
0
f
;
dpi
=
96
.
0
f
*
ppdip
;
mode
=
10
;
gasp
=
get_gasp_flags
(
fontface
,
emsize
,
ppdip
);
expected
=
get_expected_rendering_mode
(
emsize
*
ppdip
,
gasp
,
recmode_tests1
[
i
].
measuring
,
recmode_tests1
[
i
].
threshold
);
hr
=
IDWriteFontFace1_GetRecommendedRenderingMode
(
fontface1
,
emsize
,
dpi
,
dpi
*
0
.
5
f
,
NULL
,
FALSE
,
recmode_tests1
[
i
].
threshold
,
recmode_tests1
[
i
].
measuring
,
&
mode
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
mode
==
expected
,
"%.2f/%d: got %d, dpi %f, flags 0x%04x, expected %d
\n
"
,
emsize
,
i
,
mode
,
dpi
,
gasp
,
expected
);
}
}
}
...
...
@@ -4500,6 +4569,7 @@ if (0) /* crashes on native */
if
(
fontface2
)
{
DWRITE_GRID_FIT_MODE
gridfit
,
expected_gridfit
;
gasp
=
get_gasp_flags
(
fontface
,
emsize
,
1
.
0
f
);
for
(
i
=
0
;
i
<
sizeof
(
recmode_tests1
)
/
sizeof
(
recmode_tests1
[
0
]);
i
++
)
{
mode
=
10
;
expected
=
get_expected_rendering_mode
(
emsize
,
gasp
,
recmode_tests1
[
0
].
measuring
,
recmode_tests1
[
0
].
threshold
);
...
...
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