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
cc748043
Commit
cc748043
authored
Sep 28, 2005
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Sep 28, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Draw underline and strikeout for ExtTextOut on an open path using
Polygon to more closely mimic what Windows does.
parent
b5506084
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
28 deletions
+75
-28
font.c
dlls/gdi/font.c
+75
-28
No files found.
dlls/gdi/font.c
View file @
cc748043
...
...
@@ -2060,8 +2060,6 @@ done:
if
(
!
size
)
{
TEXTMETRICW
tm
;
GetTextMetricsW
(
hdc
,
&
tm
);
underlinePos
=
0
;
underlineWidth
=
tm
.
tmAscent
/
20
+
1
;
strikeoutPos
=
tm
.
tmAscent
/
2
;
...
...
@@ -2078,36 +2076,85 @@ done:
HeapFree
(
GetProcessHeap
(),
0
,
otm
);
}
if
(
lf
.
lfUnderline
)
if
(
PATH_IsPathOpen
(
dc
->
path
)
)
{
POINT
pts
[
2
],
oldpt
;
HPEN
hpen
=
CreatePen
(
PS_SOLID
,
underlineWidth
,
GetTextColor
(
hdc
));
hpen
=
SelectObject
(
hdc
,
hpen
);
pts
[
0
].
x
=
x
;
pts
[
0
].
y
=
y
;
pts
[
1
].
x
=
x
+
xwidth
;
pts
[
1
].
y
=
y
-
ywidth
;
DPtoLP
(
hdc
,
pts
,
2
);
MoveToEx
(
hdc
,
pts
[
0
].
x
-
underlinePos
*
sinEsc
,
pts
[
0
].
y
-
underlinePos
*
cosEsc
,
&
oldpt
);
LineTo
(
hdc
,
pts
[
1
].
x
-
underlinePos
*
sinEsc
,
pts
[
1
].
y
-
underlinePos
*
cosEsc
);
MoveToEx
(
hdc
,
oldpt
.
x
,
oldpt
.
y
,
NULL
);
DeleteObject
(
SelectObject
(
hdc
,
hpen
));
}
POINT
pts
[
5
];
HPEN
hpen
;
HBRUSH
hbrush
=
CreateSolidBrush
(
GetTextColor
(
hdc
));
hbrush
=
SelectObject
(
hdc
,
hbrush
);
hpen
=
SelectObject
(
hdc
,
GetStockObject
(
NULL_PEN
));
if
(
lf
.
lfUnderline
)
{
pts
[
0
].
x
=
x
-
underlinePos
*
sinEsc
;
pts
[
0
].
y
=
y
-
underlinePos
*
cosEsc
;
pts
[
1
].
x
=
x
+
xwidth
-
underlinePos
*
sinEsc
;
pts
[
1
].
y
=
y
-
ywidth
-
underlinePos
*
cosEsc
;
pts
[
2
].
x
=
pts
[
1
].
x
+
underlineWidth
*
sinEsc
;
pts
[
2
].
y
=
pts
[
1
].
y
+
underlineWidth
*
cosEsc
;
pts
[
3
].
x
=
pts
[
0
].
x
+
underlineWidth
*
sinEsc
;
pts
[
3
].
y
=
pts
[
0
].
y
+
underlineWidth
*
cosEsc
;
pts
[
4
].
x
=
pts
[
0
].
x
;
pts
[
4
].
y
=
pts
[
0
].
y
;
DPtoLP
(
hdc
,
pts
,
5
);
Polygon
(
hdc
,
pts
,
5
);
}
if
(
lf
.
lfStrikeOut
)
{
pts
[
0
].
x
=
x
-
strikeoutPos
*
sinEsc
;
pts
[
0
].
y
=
y
-
strikeoutPos
*
cosEsc
;
pts
[
1
].
x
=
x
+
xwidth
-
strikeoutPos
*
sinEsc
;
pts
[
1
].
y
=
y
-
ywidth
-
strikeoutPos
*
cosEsc
;
pts
[
2
].
x
=
pts
[
1
].
x
+
strikeoutWidth
*
sinEsc
;
pts
[
2
].
y
=
pts
[
1
].
y
+
strikeoutWidth
*
cosEsc
;
pts
[
3
].
x
=
pts
[
0
].
x
+
strikeoutWidth
*
sinEsc
;
pts
[
3
].
y
=
pts
[
0
].
y
+
strikeoutWidth
*
cosEsc
;
pts
[
4
].
x
=
pts
[
0
].
x
;
pts
[
4
].
y
=
pts
[
0
].
y
;
DPtoLP
(
hdc
,
pts
,
5
);
Polygon
(
hdc
,
pts
,
5
);
}
if
(
lf
.
lfStrikeOut
)
SelectObject
(
hdc
,
hpen
);
hbrush
=
SelectObject
(
hdc
,
hbrush
);
DeleteObject
(
hbrush
);
}
else
{
POINT
pts
[
2
],
oldpt
;
HPEN
hpen
=
CreatePen
(
PS_SOLID
,
strikeoutWidth
,
GetTextColor
(
hdc
));
hpen
=
SelectObject
(
hdc
,
hpen
);
pts
[
0
].
x
=
x
;
pts
[
0
].
y
=
y
;
pts
[
1
].
x
=
x
+
xwidth
;
pts
[
1
].
y
=
y
-
ywidth
;
DPtoLP
(
hdc
,
pts
,
2
);
MoveToEx
(
hdc
,
pts
[
0
].
x
-
strikeoutPos
*
sinEsc
,
pts
[
0
].
y
-
strikeoutPos
*
cosEsc
,
&
oldpt
);
LineTo
(
hdc
,
pts
[
1
].
x
-
strikeoutPos
*
sinEsc
,
pts
[
1
].
y
-
strikeoutPos
*
cosEsc
);
MoveToEx
(
hdc
,
oldpt
.
x
,
oldpt
.
y
,
NULL
);
DeleteObject
(
SelectObject
(
hdc
,
hpen
));
HPEN
hpen
;
if
(
lf
.
lfUnderline
)
{
hpen
=
CreatePen
(
PS_SOLID
,
underlineWidth
,
GetTextColor
(
hdc
));
hpen
=
SelectObject
(
hdc
,
hpen
);
pts
[
0
].
x
=
x
;
pts
[
0
].
y
=
y
;
pts
[
1
].
x
=
x
+
xwidth
;
pts
[
1
].
y
=
y
-
ywidth
;
DPtoLP
(
hdc
,
pts
,
2
);
MoveToEx
(
hdc
,
pts
[
0
].
x
-
underlinePos
*
sinEsc
,
pts
[
0
].
y
-
underlinePos
*
cosEsc
,
&
oldpt
);
LineTo
(
hdc
,
pts
[
1
].
x
-
underlinePos
*
sinEsc
,
pts
[
1
].
y
-
underlinePos
*
cosEsc
);
MoveToEx
(
hdc
,
oldpt
.
x
,
oldpt
.
y
,
NULL
);
DeleteObject
(
SelectObject
(
hdc
,
hpen
));
}
if
(
lf
.
lfStrikeOut
)
{
hpen
=
CreatePen
(
PS_SOLID
,
strikeoutWidth
,
GetTextColor
(
hdc
));
hpen
=
SelectObject
(
hdc
,
hpen
);
pts
[
0
].
x
=
x
;
pts
[
0
].
y
=
y
;
pts
[
1
].
x
=
x
+
xwidth
;
pts
[
1
].
y
=
y
-
ywidth
;
DPtoLP
(
hdc
,
pts
,
2
);
MoveToEx
(
hdc
,
pts
[
0
].
x
-
strikeoutPos
*
sinEsc
,
pts
[
0
].
y
-
strikeoutPos
*
cosEsc
,
&
oldpt
);
LineTo
(
hdc
,
pts
[
1
].
x
-
strikeoutPos
*
sinEsc
,
pts
[
1
].
y
-
strikeoutPos
*
cosEsc
);
MoveToEx
(
hdc
,
oldpt
.
x
,
oldpt
.
y
,
NULL
);
DeleteObject
(
SelectObject
(
hdc
,
hpen
));
}
}
}
...
...
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