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
a319df34
Commit
a319df34
authored
Jun 26, 1999
by
Thuy Nguyen
Committed by
Alexandre Julliard
Jun 26, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented the underline and strikeout text attributes for the Wine
PostScript driver.
parent
31c58546
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
88 additions
and
0 deletions
+88
-0
ps.c
graphics/psdrv/ps.c
+16
-0
text.c
graphics/psdrv/text.c
+70
-0
psdrv.h
include/psdrv.h
+2
-0
No files found.
graphics/psdrv/ps.c
View file @
a319df34
...
...
@@ -104,6 +104,13 @@ static char psrectangle[] = /* x, y, width, height, -width */
"%d 0 rlineto
\n
"
"closepath
\n
"
;
static
char
psrrectangle
[]
=
/* x, y, width, height, -width */
"%d %d rmoveto
\n
"
"%d 0 rlineto
\n
"
"0 %d rlineto
\n
"
"%d 0 rlineto
\n
"
"closepath
\n
"
;
static
char
psshow
[]
=
/* string */
"(%s) show
\n
"
;
...
...
@@ -482,6 +489,15 @@ BOOL PSDRV_WriteRectangle(DC *dc, INT x, INT y, INT width,
return
PSDRV_WriteSpool
(
dc
,
buf
,
strlen
(
buf
));
}
BOOL
PSDRV_WriteRRectangle
(
DC
*
dc
,
INT
x
,
INT
y
,
INT
width
,
INT
height
)
{
char
buf
[
100
];
sprintf
(
buf
,
psrrectangle
,
x
,
y
,
width
,
height
,
-
width
);
return
PSDRV_WriteSpool
(
dc
,
buf
,
strlen
(
buf
));
}
BOOL
PSDRV_WriteArc
(
DC
*
dc
,
INT
x
,
INT
y
,
INT
w
,
INT
h
,
double
ang1
,
double
ang2
)
{
...
...
graphics/psdrv/text.c
View file @
a319df34
...
...
@@ -81,6 +81,76 @@ BOOL PSDRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
PSDRV_WriteMoveTo
(
dc
,
x
,
y
);
PSDRV_WriteShow
(
dc
,
strbuf
,
strlen
(
strbuf
));
/*
* Underline and strikeout attributes.
*/
if
((
physDev
->
font
.
tm
.
tmUnderlined
)
||
(
physDev
->
font
.
tm
.
tmStruckOut
))
{
/* Get the thickness and the position for the underline attribute */
/* We'll use the same thickness for the strikeout attribute */
float
thick
=
physDev
->
font
.
afm
->
UnderlineThickness
*
physDev
->
font
.
scale
;
float
pos
=
-
physDev
->
font
.
afm
->
UnderlinePosition
*
physDev
->
font
.
scale
;
SIZE
size
;
INT
escapement
=
physDev
->
font
.
escapement
;
TRACE
(
psdrv
,
"Position = %f Thickness %f Escapement %d
\n
"
,
pos
,
thick
,
escapement
);
/* Get the width of the text */
PSDRV_GetTextExtentPoint
(
dc
,
strbuf
,
strlen
(
strbuf
),
&
size
);
size
.
cx
=
XLSTODS
(
dc
,
size
.
cx
);
/* Do the underline */
if
(
physDev
->
font
.
tm
.
tmUnderlined
)
{
if
(
escapement
!=
0
)
/* rotated text */
{
PSDRV_WriteGSave
(
dc
);
/* save the graphics state */
PSDRV_WriteMoveTo
(
dc
,
x
,
y
);
/* move to the start */
/* temporarily rotate the coord system */
PSDRV_WriteRotate
(
dc
,
-
escapement
/
10
);
/* draw the underline relative to the starting point */
PSDRV_WriteRRectangle
(
dc
,
0
,
(
INT
)
pos
,
size
.
cx
,
(
INT
)
thick
);
}
else
PSDRV_WriteRectangle
(
dc
,
x
,
y
+
(
INT
)
pos
,
size
.
cx
,
(
INT
)
thick
);
PSDRV_WriteFill
(
dc
);
if
(
escapement
!=
0
)
/* rotated text */
PSDRV_WriteGRestore
(
dc
);
/* restore the graphics state */
}
/* Do the strikeout */
if
(
physDev
->
font
.
tm
.
tmStruckOut
)
{
pos
=
-
physDev
->
font
.
tm
.
tmAscent
/
2
;
if
(
escapement
!=
0
)
/* rotated text */
{
PSDRV_WriteGSave
(
dc
);
/* save the graphics state */
PSDRV_WriteMoveTo
(
dc
,
x
,
y
);
/* move to the start */
/* temporarily rotate the coord system */
PSDRV_WriteRotate
(
dc
,
-
escapement
/
10
);
/* draw the underline relative to the starting point */
PSDRV_WriteRRectangle
(
dc
,
0
,
(
INT
)
pos
,
size
.
cx
,
(
INT
)
thick
);
}
else
PSDRV_WriteRectangle
(
dc
,
x
,
y
+
(
INT
)
pos
,
size
.
cx
,
(
INT
)
thick
);
PSDRV_WriteFill
(
dc
);
if
(
escapement
!=
0
)
/* rotated text */
PSDRV_WriteGRestore
(
dc
);
/* restore the graphics state */
}
}
HeapFree
(
PSDRV_Heap
,
0
,
strbuf
);
return
TRUE
;
}
include/psdrv.h
View file @
a319df34
...
...
@@ -272,6 +272,8 @@ extern BOOL PSDRV_WriteLineTo(DC *dc, INT x, INT y);
extern
BOOL
PSDRV_WriteStroke
(
DC
*
dc
);
extern
BOOL
PSDRV_WriteRectangle
(
DC
*
dc
,
INT
x
,
INT
y
,
INT
width
,
INT
height
);
extern
BOOL
PSDRV_WriteRRectangle
(
DC
*
dc
,
INT
x
,
INT
y
,
INT
width
,
INT
height
);
extern
BOOL
PSDRV_WriteSetFont
(
DC
*
dc
,
BOOL
UseANSI
);
extern
BOOL
PSDRV_WriteShow
(
DC
*
dc
,
char
*
str
,
INT
count
);
extern
BOOL
PSDRV_WriteReencodeFont
(
DC
*
dc
);
...
...
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