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
f8b11542
Commit
f8b11542
authored
Aug 09, 2012
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Aug 14, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: GdipGetLogFontW should transform returned font height using font and…
gdiplus: GdipGetLogFontW should transform returned font height using font and device unit/resolution/scale.
parent
e9af648a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
14 deletions
+17
-14
font.c
dlls/gdiplus/font.c
+17
-2
graphics.c
dlls/gdiplus/tests/graphics.c
+0
-12
No files found.
dlls/gdiplus/font.c
View file @
f8b11542
...
...
@@ -449,8 +449,23 @@ GpStatus WINGDIPAPI GdipGetLogFontA(GpFont *font, GpGraphics *graphics,
void
get_log_fontW
(
const
GpFont
*
font
,
GpGraphics
*
graphics
,
LOGFONTW
*
lf
)
{
/* FIXME: use graphics */
lf
->
lfHeight
=
-
units_to_pixels
(
font
->
emSize
,
font
->
unit
,
font
->
family
->
dpi
);
REAL
height
;
if
(
font
->
unit
==
UnitPixel
)
{
height
=
units_to_pixels
(
font
->
emSize
,
graphics
->
unit
,
graphics
->
yres
);
if
(
graphics
->
unit
!=
UnitDisplay
)
height
*=
graphics
->
scale
;
}
else
{
if
(
graphics
->
unit
==
UnitDisplay
||
graphics
->
unit
==
UnitPixel
)
height
=
units_to_pixels
(
font
->
emSize
,
font
->
unit
,
graphics
->
xres
);
else
height
=
units_to_pixels
(
font
->
emSize
,
font
->
unit
,
graphics
->
yres
);
}
lf
->
lfHeight
=
-
(
height
+
0
.
5
);
lf
->
lfWidth
=
0
;
lf
->
lfEscapement
=
0
;
lf
->
lfOrientation
=
0
;
...
...
dlls/gdiplus/tests/graphics.c
View file @
f8b11542
...
...
@@ -3479,19 +3479,8 @@ static void test_GdipMeasureString(void)
height
=
units_to_pixels
(
font_size
,
td
[
i
].
unit
,
td
[
i
].
res_y
);
if
(
td
[
i
].
unit
!=
UnitDisplay
)
height
*=
td
[
i
].
page_scale
;
/* FIXME: remove once Wine is fixed */
if
(
td
[
i
].
unit
==
UnitDisplay
||
(
td
[
i
].
unit
==
UnitPixel
&&
td
[
i
].
page_scale
==
1
.
0
))
ok
(
-
lf
.
lfHeight
==
(
LONG
)(
height
+
0
.
5
),
"%u: expected %d (%f), got %d
\n
"
,
i
,
(
LONG
)(
height
+
0
.
5
),
height
,
lf
.
lfHeight
);
else
{
todo_wine
ok
(
-
lf
.
lfHeight
==
(
LONG
)(
height
+
0
.
5
),
"%u: expected %d (%f), got %d
\n
"
,
i
,
(
LONG
)(
height
+
0
.
5
),
height
,
lf
.
lfHeight
);
/* further testing is useless */
GdipDeleteGraphics
(
graphics
);
continue
;
}
height
=
font_size
*
font_to_pixel_scale
;
...
...
@@ -3572,7 +3561,6 @@ static void test_GdipMeasureString(void)
else
height
=
units_to_pixels
(
font_size
,
font_unit
,
td
[
i
].
res_y
);
/*trace("%.1f font units = %f pixels with %.1f dpi, page_scale %.1f\n", font_size, height, td[i].res_y, td[i].page_scale);*/
todo_wine
ok
(
-
lf
.
lfHeight
==
(
LONG
)(
height
+
0
.
5
),
"%u: expected %d (%f), got %d
\n
"
,
i
,
(
LONG
)(
height
+
0
.
5
),
height
,
lf
.
lfHeight
);
...
...
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