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
bb1740a4
Commit
bb1740a4
authored
Jul 02, 2012
by
Huw Davies
Committed by
Alexandre Julliard
Jul 02, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineps: Add support for printing fake italic fonts.
parent
8f80159d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
12 deletions
+58
-12
builtin.c
dlls/wineps.drv/builtin.c
+1
-1
download.c
dlls/wineps.drv/download.c
+20
-1
ps.c
dlls/wineps.drv/ps.c
+35
-9
psdrv.h
dlls/wineps.drv/psdrv.h
+2
-1
No files found.
dlls/wineps.drv/builtin.c
View file @
bb1740a4
...
...
@@ -238,7 +238,7 @@ BOOL PSDRV_WriteSetBuiltinFont(PHYSDEV dev)
PSDRV_PDEVICE
*
physDev
=
get_psdrv_dev
(
dev
);
return
PSDRV_WriteSetFont
(
dev
,
physDev
->
font
.
fontinfo
.
Builtin
.
afm
->
FontName
,
physDev
->
font
.
size
,
physDev
->
font
.
escapement
);
physDev
->
font
.
size
,
physDev
->
font
.
escapement
,
FALSE
);
}
BOOL
PSDRV_WriteBuiltinGlyphShow
(
PHYSDEV
dev
,
LPCWSTR
str
,
INT
count
)
...
...
dlls/wineps.drv/download.c
View file @
bb1740a4
...
...
@@ -239,6 +239,24 @@ static inline float ps_round(float f)
{
return
(
f
>
0
)
?
(
f
+
0
.
5
)
:
(
f
-
0
.
5
);
}
static
BOOL
is_fake_italic
(
HDC
hdc
)
{
TEXTMETRICW
tm
;
BYTE
head
[
54
];
/* the head table is 54 bytes long */
WORD
mac_style
;
GetTextMetricsW
(
hdc
,
&
tm
);
if
(
!
tm
.
tmItalic
)
return
FALSE
;
if
(
GetFontData
(
hdc
,
MS_MAKE_TAG
(
'h'
,
'e'
,
'a'
,
'd'
),
0
,
head
,
sizeof
(
head
)
)
==
GDI_ERROR
)
return
FALSE
;
mac_style
=
GET_BE_WORD
(
head
+
44
);
TRACE
(
"mac style %04x
\n
"
,
mac_style
);
return
!
(
mac_style
&
2
);
}
/****************************************************************************
* PSDRV_WriteSetDownloadFont
*
...
...
@@ -328,7 +346,8 @@ BOOL PSDRV_WriteSetDownloadFont(PHYSDEV dev)
}
PSDRV_WriteSetFont
(
dev
,
ps_name
,
physDev
->
font
.
size
,
physDev
->
font
.
escapement
);
PSDRV_WriteSetFont
(
dev
,
ps_name
,
physDev
->
font
.
size
,
physDev
->
font
.
escapement
,
is_fake_italic
(
dev
->
hdc
));
HeapFree
(
GetProcessHeap
(),
0
,
ps_name
);
HeapFree
(
GetProcessHeap
(),
0
,
potm
);
...
...
dlls/wineps.drv/ps.c
View file @
bb1740a4
...
...
@@ -129,11 +129,23 @@ static const char psrectangle[] = /* x, y, width, height, -width */
static
const
char
psglyphshow
[]
=
/* glyph name */
"/%s glyphshow
\n
"
;
static
const
char
pssetfont
[]
=
/* fontname, xx_scale, xy_scale, yx_scale, yy_scale, escapement */
"/%s findfont
\n
"
"[%d %d %d %d 0 0]
\n
"
static
const
char
psfindfont
[]
=
/* fontname */
"/%s findfont
\n
"
;
static
const
char
psfakeitalic
[]
=
"[1 0 0.25 1 0 0]
\n
"
;
static
const
char
pssizematrix
[]
=
"[%d %d %d %d 0 0]
\n
"
;
static
const
char
psconcat
[]
=
"matrix concatmatrix
\n
"
;
static
const
char
psrotatefont
[]
=
/* escapement */
"%d 10 div matrix rotate
\n
"
"matrix concatmatrix
\n
"
"matrix concatmatrix
\n
"
;
static
const
char
pssetfont
[]
=
"makefont setfont
\n
"
;
static
const
char
pssetline
[]
=
/* width, join, endcap */
...
...
@@ -554,22 +566,36 @@ BOOL PSDRV_WriteCurveTo(PHYSDEV dev, POINT pts[3])
return
PSDRV_WriteSpool
(
dev
,
buf
,
strlen
(
buf
));
}
BOOL
PSDRV_WriteSetFont
(
PHYSDEV
dev
,
const
char
*
name
,
matrix
size
,
INT
escapement
)
BOOL
PSDRV_WriteSetFont
(
PHYSDEV
dev
,
const
char
*
name
,
matrix
size
,
INT
escapement
,
BOOL
fake_italic
)
{
char
*
buf
;
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
s
izeof
(
pssetfont
)
+
strlen
(
name
)
+
40
);
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
s
trlen
(
name
)
+
256
);
if
(
!
buf
)
{
WARN
(
"HeapAlloc failed
\n
"
);
return
FALSE
;
}
sprintf
(
buf
,
pssetfont
,
name
,
size
.
xx
,
size
.
xy
,
size
.
yx
,
size
.
yy
,
-
escapement
);
sprintf
(
buf
,
psfindfont
,
name
);
PSDRV_WriteSpool
(
dev
,
buf
,
strlen
(
buf
)
);
PSDRV_WriteSpool
(
dev
,
buf
,
strlen
(
buf
));
if
(
fake_italic
)
PSDRV_WriteSpool
(
dev
,
psfakeitalic
,
sizeof
(
psfakeitalic
)
-
1
);
sprintf
(
buf
,
pssizematrix
,
size
.
xx
,
size
.
xy
,
size
.
yx
,
size
.
yy
);
PSDRV_WriteSpool
(
dev
,
buf
,
strlen
(
buf
)
);
if
(
fake_italic
)
PSDRV_WriteSpool
(
dev
,
psconcat
,
sizeof
(
psconcat
)
-
1
);
if
(
escapement
)
{
sprintf
(
buf
,
psrotatefont
,
-
escapement
);
PSDRV_WriteSpool
(
dev
,
buf
,
strlen
(
buf
)
);
}
PSDRV_WriteSpool
(
dev
,
pssetfont
,
sizeof
(
pssetfont
)
-
1
);
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
return
TRUE
;
}
...
...
dlls/wineps.drv/psdrv.h
View file @
bb1740a4
...
...
@@ -489,7 +489,8 @@ extern BOOL PSDRV_WriteLineTo(PHYSDEV dev, INT x, INT y) DECLSPEC_HIDDEN;
extern
BOOL
PSDRV_WriteStroke
(
PHYSDEV
dev
)
DECLSPEC_HIDDEN
;
extern
BOOL
PSDRV_WriteRectangle
(
PHYSDEV
dev
,
INT
x
,
INT
y
,
INT
width
,
INT
height
)
DECLSPEC_HIDDEN
;
extern
BOOL
PSDRV_WriteRRectangle
(
PHYSDEV
dev
,
INT
x
,
INT
y
,
INT
width
,
INT
height
)
DECLSPEC_HIDDEN
;
extern
BOOL
PSDRV_WriteSetFont
(
PHYSDEV
dev
,
const
char
*
name
,
matrix
size
,
INT
escapement
)
DECLSPEC_HIDDEN
;
extern
BOOL
PSDRV_WriteSetFont
(
PHYSDEV
dev
,
const
char
*
name
,
matrix
size
,
INT
escapement
,
BOOL
fake_italic
)
DECLSPEC_HIDDEN
;
extern
BOOL
PSDRV_WriteGlyphShow
(
PHYSDEV
dev
,
LPCSTR
g_name
)
DECLSPEC_HIDDEN
;
extern
BOOL
PSDRV_WriteSetPen
(
PHYSDEV
dev
)
DECLSPEC_HIDDEN
;
extern
BOOL
PSDRV_WriteArc
(
PHYSDEV
dev
,
INT
x
,
INT
y
,
INT
w
,
INT
h
,
...
...
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