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
1c30b894
Commit
1c30b894
authored
Oct 08, 2012
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Oct 08, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Stop adding 1/6 of EM height to the created font height.
parent
ec4cd117
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
graphics.c
dlls/gdiplus/graphics.c
+3
-5
graphics.c
dlls/gdiplus/tests/graphics.c
+8
-0
No files found.
dlls/gdiplus/graphics.c
View file @
1c30b894
...
...
@@ -2138,15 +2138,13 @@ static void get_font_hfont(GpGraphics *graphics, GDIPCONST GpFont *font,
{
HDC
hdc
=
CreateCompatibleDC
(
0
);
GpPointF
pt
[
3
];
REAL
angle
,
rel_width
,
rel_height
,
font_height
,
font_to_pixel_scale
;
REAL
angle
,
rel_width
,
rel_height
,
font_height
;
LOGFONTW
lfw
;
HFONT
unscaled_font
;
TEXTMETRICW
textmet
;
font_to_pixel_scale
=
(
format
&&
format
->
generic_typographic
)
?
1
.
0
:
units_scale
(
UnitPoint
,
UnitPixel
,
font
->
family
->
dpi
);
if
(
font
->
unit
==
UnitPixel
)
font_height
=
font
->
emSize
*
font_to_pixel_scale
;
font_height
=
font
->
emSize
;
else
{
REAL
unit_scale
,
res
;
...
...
@@ -2154,7 +2152,7 @@ static void get_font_hfont(GpGraphics *graphics, GDIPCONST GpFont *font,
res
=
(
graphics
->
unit
==
UnitDisplay
||
graphics
->
unit
==
UnitPixel
)
?
graphics
->
xres
:
graphics
->
yres
;
unit_scale
=
units_scale
(
font
->
unit
,
graphics
->
unit
,
res
);
font_height
=
font
->
emSize
*
font_to_pixel_scale
*
unit_scale
;
font_height
=
font
->
emSize
*
unit_scale
;
if
(
graphics
->
unit
!=
UnitDisplay
)
font_height
/=
graphics
->
scale
;
}
...
...
dlls/gdiplus/tests/graphics.c
View file @
1c30b894
...
...
@@ -3530,6 +3530,7 @@ static void test_GdipMeasureString(void)
expectf
(
0
.
0
,
bounds
.
X
);
expectf
(
0
.
0
,
bounds
.
Y
);
todo_wine
expectf_
(
height
,
bounds
.
Height
,
height
/
100
.
0
);
expectf_
(
bounds
.
Height
/
base_cy
,
bounds
.
Width
/
base_cx
,
0
.
1
);
expect
(
7
,
chars
);
...
...
@@ -3546,6 +3547,7 @@ static void test_GdipMeasureString(void)
expect
(
Ok
,
status
);
expectf
(
50
.
0
,
bounds
.
X
);
expectf
(
50
.
0
,
bounds
.
Y
);
todo_wine
expectf_
(
height
,
bounds
.
Height
,
height
/
100
.
0
);
expectf_
(
bounds
.
Height
/
base_cy
,
bounds
.
Width
/
base_cx
,
0
.
1
);
expect
(
7
,
chars
);
...
...
@@ -3613,6 +3615,7 @@ static void test_GdipMeasureString(void)
expectf
(
0
.
0
,
bounds
.
X
);
expectf
(
0
.
0
,
bounds
.
Y
);
todo_wine
expectf_
(
height
,
bounds
.
Height
,
height
/
85
.
0
);
expectf_
(
bounds
.
Height
/
base_cy
,
bounds
.
Width
/
base_cx
,
0
.
1
);
expect
(
7
,
chars
);
...
...
@@ -3629,6 +3632,7 @@ static void test_GdipMeasureString(void)
expect
(
Ok
,
status
);
expectf
(
50
.
0
,
bounds
.
X
);
expectf
(
50
.
0
,
bounds
.
Y
);
todo_wine
expectf_
(
height
,
bounds
.
Height
,
height
/
85
.
0
);
expectf_
(
bounds
.
Height
/
base_cy
,
bounds
.
Width
/
base_cx
,
0
.
1
);
expect
(
7
,
chars
);
...
...
@@ -3640,6 +3644,7 @@ static void test_GdipMeasureString(void)
height
*=
td
[
i
].
page_scale
;
/*trace("%u: unit %u, %.1fx%.1f dpi, scale %.1f, height %f, pixels %f\n",
i, td[i].unit, td[i].res_x, td[i].res_y, td[i].page_scale, bounds.Height, height);*/
todo_wine
expectf_
(
100
.
0
,
height
,
1
.
1
);
status
=
GdipDeleteGraphics
(
graphics
);
...
...
@@ -3833,12 +3838,14 @@ static void test_font_height_scaling(void)
status
=
GdipTransformPoints
(
graphics
,
CoordinateSpaceDevice
,
CoordinateSpaceWorld
,
&
ptf
,
1
);
expect
(
Ok
,
status
);
match
=
fabs
(
100
.
0
-
ptf
.
Y
)
<=
1
.
0
;
todo_wine
ok
(
match
,
"Expected 100.0, got %f
\n
"
,
ptf
.
Y
);
/* verify the result */
ptf
.
Y
=
units_to_pixels
(
bounds
.
Height
,
gfx_unit
,
dpi
);
ptf
.
Y
/=
100
.
0
;
match
=
fabs
(
100
.
0
-
ptf
.
Y
)
<=
1
.
0
;
todo_wine
ok
(
match
,
"Expected 100.0, got %f
\n
"
,
ptf
.
Y
);
/* bounds.width of 1 glyph: [margin]+[width]+[margin] */
...
...
@@ -3874,6 +3881,7 @@ static void test_font_height_scaling(void)
match
=
fabs
(
1
.
0
-
margin
/
rect
.
X
)
<=
0
.
05
;
ok
(
match
,
"Expected %f, got %f
\n
"
,
margin
,
rect
.
X
);
match
=
fabs
(
1
.
0
-
height
/
rect
.
Height
)
<=
0
.
1
;
todo_wine
ok
(
match
,
"Expected %f, got %f
\n
"
,
height
,
rect
.
Height
);
match
=
fabs
(
1
.
0
-
bounds
.
Width
/
(
rect
.
Width
+
margin
*
2
.
0
))
<=
0
.
05
;
ok
(
match
,
"Expected %f, got %f
\n
"
,
bounds
.
Width
,
rect
.
Width
+
margin
*
2
.
0
);
...
...
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