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
2c93bf7e
Commit
2c93bf7e
authored
May 11, 2012
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
May 11, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Retrieve LOGFONT from a GpFont using GdipGetLogFontW instead of accessing it directly.
parent
5ae4238c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
graphics.c
dlls/gdiplus/graphics.c
+7
-5
graphicspath.c
dlls/gdiplus/graphicspath.c
+4
-1
No files found.
dlls/gdiplus/graphics.c
View file @
2c93bf7e
...
...
@@ -2136,15 +2136,13 @@ void get_font_hfont(GpGraphics *graphics, GDIPCONST GpFont *font, HFONT *hfont)
rel_height
=
sqrt
((
pt
[
2
].
Y
-
pt
[
0
].
Y
)
*
(
pt
[
2
].
Y
-
pt
[
0
].
Y
)
+
(
pt
[
2
].
X
-
pt
[
0
].
X
)
*
(
pt
[
2
].
X
-
pt
[
0
].
X
));
lfw
=
font
->
lfw
;
lfw
.
lfHeight
=
roundr
(
-
font
->
pixel_size
*
rel_height
);
GdipGetLogFontW
((
GpFont
*
)
font
,
graphics
,
&
lfw
)
;
lfw
.
lfHeight
=
roundr
(
lfw
.
lfHeight
*
rel_height
);
unscaled_font
=
CreateFontIndirectW
(
&
lfw
);
SelectObject
(
hdc
,
unscaled_font
);
GetTextMetricsW
(
hdc
,
&
textmet
);
lfw
=
font
->
lfw
;
lfw
.
lfHeight
=
roundr
(
-
font
->
pixel_size
*
rel_height
);
lfw
.
lfWidth
=
roundr
(
textmet
.
tmAveCharWidth
*
rel_width
/
rel_height
);
lfw
.
lfEscapement
=
lfw
.
lfOrientation
=
roundr
((
angle
/
M_PI
)
*
1800
.
0
);
...
...
@@ -4919,6 +4917,7 @@ GpStatus WINGDIPAPI GdipMeasureCharacterRanges(GpGraphics* graphics,
{
GpStatus
stat
;
int
i
;
LOGFONTW
lfw
;
HFONT
oldfont
;
struct
measure_ranges_args
args
;
HDC
hdc
,
temp_hdc
=
NULL
;
...
...
@@ -4932,6 +4931,9 @@ GpStatus WINGDIPAPI GdipMeasureCharacterRanges(GpGraphics* graphics,
if
(
regionCount
<
stringFormat
->
range_count
)
return
InvalidParameter
;
stat
=
GdipGetLogFontW
((
GpFont
*
)
font
,
graphics
,
&
lfw
);
if
(
stat
!=
Ok
)
return
stat
;
if
(
!
graphics
->
hdc
)
{
hdc
=
temp_hdc
=
CreateCompatibleDC
(
0
);
...
...
@@ -4943,7 +4945,7 @@ GpStatus WINGDIPAPI GdipMeasureCharacterRanges(GpGraphics* graphics,
if
(
stringFormat
->
attr
)
TRACE
(
"may be ignoring some format flags: attr %x
\n
"
,
stringFormat
->
attr
);
oldfont
=
SelectObject
(
hdc
,
CreateFontIndirectW
(
&
font
->
lfw
));
oldfont
=
SelectObject
(
hdc
,
CreateFontIndirectW
(
&
lfw
));
for
(
i
=
0
;
i
<
stringFormat
->
range_count
;
i
++
)
{
...
...
dlls/gdiplus/graphicspath.c
View file @
2c93bf7e
...
...
@@ -942,6 +942,7 @@ GpStatus WINGDIPAPI GdipAddPathString(GpPath* path, GDIPCONST WCHAR* string, INT
{
GpFont
*
font
;
GpStatus
status
;
LOGFONTW
lfw
;
HANDLE
hfont
;
HDC
dc
;
GpPath
*
backup
;
...
...
@@ -956,7 +957,9 @@ GpStatus WINGDIPAPI GdipAddPathString(GpPath* path, GDIPCONST WCHAR* string, INT
if
(
status
!=
Ok
)
return
status
;
hfont
=
CreateFontIndirectW
(
&
font
->
lfw
);
status
=
GdipGetLogFontW
((
GpFont
*
)
font
,
NULL
,
&
lfw
);
if
(
status
!=
Ok
)
return
status
;
hfont
=
CreateFontIndirectW
(
&
lfw
);
if
(
!
hfont
)
{
WARN
(
"Failed to create font
\n
"
);
...
...
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