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
8ce10f14
Commit
8ce10f14
authored
Apr 23, 2010
by
Huw Davies
Committed by
Alexandre Julliard
Apr 25, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineps.drv: Add world transform support for fonts.
parent
5075f00f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
9 deletions
+35
-9
builtin.c
dlls/wineps.drv/builtin.c
+4
-2
download.c
dlls/wineps.drv/download.c
+20
-1
ps.c
dlls/wineps.drv/ps.c
+4
-4
psdrv.h
dlls/wineps.drv/psdrv.h
+7
-2
No files found.
dlls/wineps.drv/builtin.c
View file @
8ce10f14
...
...
@@ -79,7 +79,9 @@ static VOID ScaleFont(const AFM *afm, LONG lfHeight, PSFONT *font,
(
float
)(
wm
->
usWinAscent
+
wm
->
usWinDescent
);
}
font
->
size
=
(
INT
)
Round
(
font
->
fontinfo
.
Builtin
.
scale
*
(
float
)
wm
->
usUnitsPerEm
);
font
->
size
.
xx
=
(
INT
)
Round
(
font
->
fontinfo
.
Builtin
.
scale
*
(
float
)
wm
->
usUnitsPerEm
);
font
->
size
.
xy
=
font
->
size
.
yx
=
0
;
font
->
size
.
yy
=
-
(
INT
)
Round
(
font
->
fontinfo
.
Builtin
.
scale
*
(
float
)
wm
->
usUnitsPerEm
);
usUnitsPerEm
=
(
USHORT
)
Round
((
float
)(
wm
->
usUnitsPerEm
)
*
font
->
fontinfo
.
Builtin
.
scale
);
sAscender
=
(
SHORT
)
Round
((
float
)(
wm
->
sAscender
)
*
font
->
fontinfo
.
Builtin
.
scale
);
...
...
@@ -140,7 +142,7 @@ static VOID ScaleFont(const AFM *afm, LONG lfHeight, PSFONT *font,
font
->
strikeoutThickness
=
font
->
underlineThickness
;
TRACE
(
"Selected PS font '%s' size %d weight %d.
\n
"
,
afm
->
FontName
,
font
->
size
,
tm
->
tmWeight
);
font
->
size
.
xx
,
tm
->
tmWeight
);
TRACE
(
"H = %d As = %d Des = %d IL = %d EL = %d
\n
"
,
tm
->
tmHeight
,
tm
->
tmAscent
,
tm
->
tmDescent
,
tm
->
tmInternalLeading
,
tm
->
tmExternalLeading
);
...
...
dlls/wineps.drv/download.c
View file @
8ce10f14
...
...
@@ -33,6 +33,8 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
psdrv
);
BOOL
WINAPI
GetTransform
(
HDC
hdc
,
DWORD
which
,
XFORM
*
xform
);
#define MS_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
( ( (DWORD)_x4 << 24 ) | \
( (DWORD)_x3 << 16 ) | \
...
...
@@ -233,6 +235,10 @@ static UINT calc_ppem_for_height(HDC hdc, LONG height)
return
MulDiv
(
emsize
,
height
,
ascent
+
descent
);
}
static
inline
float
ps_round
(
float
f
)
{
return
(
f
>
0
)
?
(
f
+
0
.
5
)
:
(
f
-
0
.
5
);
}
/****************************************************************************
* PSDRV_WriteSetDownloadFont
*
...
...
@@ -247,6 +253,7 @@ BOOL PSDRV_WriteSetDownloadFont(PSDRV_PDEVICE *physDev)
DOWNLOAD
*
pdl
;
LOGFONTW
lf
;
UINT
ppem
;
XFORM
xform
;
assert
(
physDev
->
font
.
fontloc
==
Download
);
...
...
@@ -261,7 +268,19 @@ BOOL PSDRV_WriteSetDownloadFont(PSDRV_PDEVICE *physDev)
ppem
=
calc_ppem_for_height
(
physDev
->
hdc
,
lf
.
lfHeight
);
physDev
->
font
.
size
=
abs
(
PSDRV_YWStoDS
(
physDev
,
ppem
));
/* Retrieve the world -> device transform */
GetTransform
(
physDev
->
hdc
,
0x204
,
&
xform
);
physDev
->
font
.
size
.
xx
=
ps_round
(
ppem
*
xform
.
eM11
);
physDev
->
font
.
size
.
xy
=
ps_round
(
ppem
*
xform
.
eM12
);
physDev
->
font
.
size
.
yx
=
ps_round
(
ppem
*
xform
.
eM21
);
physDev
->
font
.
size
.
yy
=
ps_round
(
ppem
*
xform
.
eM22
);
if
(
GetMapMode
(
physDev
->
hdc
)
==
MM_TEXT
)
{
physDev
->
font
.
size
.
yx
*=
-
1
;
physDev
->
font
.
size
.
yy
*=
-
1
;
}
physDev
->
font
.
underlineThickness
=
potm
->
otmsUnderscoreSize
;
physDev
->
font
.
underlinePosition
=
potm
->
otmsUnderscorePosition
;
...
...
dlls/wineps.drv/ps.c
View file @
8ce10f14
...
...
@@ -115,9 +115,9 @@ static const char psrectangle[] = /* x, y, width, height, -width */
static
const
char
psglyphshow
[]
=
/* glyph name */
"/%s glyphshow
\n
"
;
static
const
char
pssetfont
[]
=
/* fontname, x
scale, yscale, ascent
, escapement */
static
const
char
pssetfont
[]
=
/* fontname, x
x_scale, xy_scale, yx_scale, yy_scale
, escapement */
"/%s findfont
\n
"
"[%d
0 0
%d 0 0]
\n
"
"[%d
%d %d
%d 0 0]
\n
"
"%d 10 div matrix rotate
\n
"
"matrix concatmatrix
\n
"
"makefont setfont
\n
"
;
...
...
@@ -501,7 +501,7 @@ BOOL PSDRV_WriteArc(PSDRV_PDEVICE *physDev, INT x, INT y, INT w, INT h, double a
}
BOOL
PSDRV_WriteSetFont
(
PSDRV_PDEVICE
*
physDev
,
const
char
*
name
,
INT
size
,
INT
escapement
)
BOOL
PSDRV_WriteSetFont
(
PSDRV_PDEVICE
*
physDev
,
const
char
*
name
,
matrix
size
,
INT
escapement
)
{
char
*
buf
;
...
...
@@ -513,7 +513,7 @@ BOOL PSDRV_WriteSetFont(PSDRV_PDEVICE *physDev, const char *name, INT size, INT
return
FALSE
;
}
sprintf
(
buf
,
pssetfont
,
name
,
size
,
-
size
,
-
escapement
);
sprintf
(
buf
,
pssetfont
,
name
,
size
.
xx
,
size
.
xy
,
size
.
yx
,
size
.
yy
,
-
escapement
);
PSDRV_WriteSpool
(
physDev
,
buf
,
strlen
(
buf
));
HeapFree
(
PSDRV_Heap
,
0
,
buf
);
...
...
dlls/wineps.drv/psdrv.h
View file @
8ce10f14
...
...
@@ -298,6 +298,11 @@ enum fontloc {
Builtin
,
Download
};
typedef
struct
{
INT
xx
,
xy
,
yx
,
yy
;
}
matrix
;
typedef
struct
{
enum
fontloc
fontloc
;
union
{
...
...
@@ -305,7 +310,7 @@ typedef struct {
DOWNLOAD
*
Download
;
}
fontinfo
;
int
size
;
matrix
size
;
PSCOLOR
color
;
BOOL
set
;
/* Have we done a setfont yet */
...
...
@@ -436,7 +441,7 @@ extern BOOL PSDRV_WriteRectangle(PSDRV_PDEVICE *physDev, INT x, INT y, INT width
INT
height
);
extern
BOOL
PSDRV_WriteRRectangle
(
PSDRV_PDEVICE
*
physDev
,
INT
x
,
INT
y
,
INT
width
,
INT
height
);
extern
BOOL
PSDRV_WriteSetFont
(
PSDRV_PDEVICE
*
physDev
,
const
char
*
name
,
INT
size
,
extern
BOOL
PSDRV_WriteSetFont
(
PSDRV_PDEVICE
*
physDev
,
const
char
*
name
,
matrix
size
,
INT
escapement
);
extern
BOOL
PSDRV_WriteGlyphShow
(
PSDRV_PDEVICE
*
physDev
,
LPCSTR
g_name
);
extern
BOOL
PSDRV_WriteSetPen
(
PSDRV_PDEVICE
*
physDev
);
...
...
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