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
137128fa
Commit
137128fa
authored
Mar 20, 2015
by
Vincent Povirk
Committed by
Alexandre Julliard
Mar 23, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Fonts in UnitWorld shouldn't be scaled to the page unit.
parent
93740566
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
2 deletions
+58
-2
font.c
dlls/gdiplus/font.c
+1
-1
graphics.c
dlls/gdiplus/graphics.c
+1
-1
graphics.c
dlls/gdiplus/tests/graphics.c
+56
-0
No files found.
dlls/gdiplus/font.c
View file @
137128fa
...
...
@@ -465,7 +465,7 @@ GpStatus WINGDIPAPI GdipGetLogFontW(GpFont *font, GpGraphics *graphics, LOGFONTW
matrix
=
graphics
->
worldtrans
;
if
(
font
->
unit
==
UnitPixel
)
if
(
font
->
unit
==
UnitPixel
||
font
->
unit
==
UnitWorld
)
{
height
=
units_to_pixels
(
font
->
emSize
,
graphics
->
unit
,
graphics
->
yres
);
if
(
graphics
->
unit
!=
UnitDisplay
)
...
...
dlls/gdiplus/graphics.c
View file @
137128fa
...
...
@@ -2123,7 +2123,7 @@ static void get_font_hfont(GpGraphics *graphics, GDIPCONST GpFont *font,
HFONT
unscaled_font
;
TEXTMETRICW
textmet
;
if
(
font
->
unit
==
UnitPixel
)
if
(
font
->
unit
==
UnitPixel
||
font
->
unit
==
UnitWorld
)
font_height
=
font
->
emSize
;
else
{
...
...
dlls/gdiplus/tests/graphics.c
View file @
137128fa
...
...
@@ -3695,6 +3695,62 @@ todo_wine
GdipDeleteFont
(
font
);
}
/* Font with units = UnitWorld */
for
(
i
=
0
;
i
<
sizeof
(
td
)
/
sizeof
(
td
[
0
]);
i
++
)
{
GpPointF
pt
=
{
0
.
0
,
100
.
0
};
GpImage
*
image
;
REAL
expected_width
,
expected_height
;
graphics
=
create_graphics
(
td
[
i
].
res_x
,
td
[
i
].
res_y
,
td
[
i
].
unit
,
td
[
i
].
page_scale
,
&
image
);
status
=
GdipTransformPoints
(
graphics
,
CoordinateSpaceWorld
,
CoordinateSpaceDevice
,
&
pt
,
1
);
expect
(
Ok
,
status
);
status
=
GdipCreateFont
(
family
,
pt
.
Y
,
FontStyleRegular
,
UnitWorld
,
&
font
);
expect
(
Ok
,
status
);
status
=
GdipGetFontUnit
(
font
,
&
font_unit
);
expect
(
Ok
,
status
);
expect
(
UnitWorld
,
font_unit
);
lf
.
lfHeight
=
0xdeadbeef
;
status
=
GdipGetLogFontW
(
font
,
graphics
,
&
lf
);
expect
(
Ok
,
status
);
ok
(
lf
.
lfHeight
==
-
100
,
"%u: expected -100, got %d
\n
"
,
i
,
lf
.
lfHeight
);
set_rect_empty
(
&
rc
);
set_rect_empty
(
&
bounds
);
status
=
GdipMeasureString
(
graphics
,
string
,
-
1
,
font
,
&
rc
,
format
,
&
bounds
,
&
chars
,
&
lines
);
expect
(
Ok
,
status
);
if
(
i
==
0
)
{
base_cx
=
bounds
.
Width
;
base_cy
=
bounds
.
Height
;
}
pt
.
X
=
1
.
0
;
pt
.
Y
=
1
.
0
;
status
=
GdipTransformPoints
(
graphics
,
CoordinateSpaceWorld
,
CoordinateSpaceDevice
,
&
pt
,
1
);
expect
(
Ok
,
status
);
/* height is constant in device space, width is proportional to height in world space */
expected_width
=
base_cx
*
pt
.
Y
;
expected_height
=
base_cy
*
pt
.
Y
;
if
(
td
[
i
].
unit
==
UnitDisplay
||
td
[
i
].
unit
==
UnitPixel
)
ok
(
fabs
(
expected_width
-
bounds
.
Width
)
<=
0
.
001
,
"%u: expected %f, got %f
\n
"
,
i
,
expected_width
,
bounds
.
Width
);
else
todo_wine
ok
(
fabs
(
expected_width
-
bounds
.
Width
)
<=
0
.
001
,
"%u: expected %f, got %f
\n
"
,
i
,
expected_width
,
bounds
.
Width
);
ok
(
fabs
(
expected_height
-
bounds
.
Height
)
<=
0
.
001
,
"%u: expected %f, got %f
\n
"
,
i
,
expected_height
,
bounds
.
Height
);
GdipDeleteGraphics
(
graphics
);
GdipDisposeImage
(
image
);
GdipDeleteFont
(
font
);
}
GdipDeleteFontFamily
(
family
);
GdipDeleteStringFormat
(
format
);
}
...
...
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