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
b1f7b0da
Commit
b1f7b0da
authored
May 05, 2023
by
Piotr Caban
Committed by
Alexandre Julliard
May 09, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineps: Move GetCharWidth implementation to unixlib.
parent
a52167e7
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
60 additions
and
51 deletions
+60
-51
Makefile.in
dlls/wineps.drv/Makefile.in
+1
-1
builtin.c
dlls/wineps.drv/builtin.c
+0
-35
init.c
dlls/wineps.drv/init.c
+0
-1
printproc.c
dlls/wineps.drv/printproc.c
+0
-13
psdrv.h
dlls/wineps.drv/psdrv.h
+0
-1
unixlib.c
dlls/wineps.drv/unixlib.c
+59
-0
No files found.
dlls/wineps.drv/Makefile.in
View file @
b1f7b0da
MODULE
=
wineps.drv
UNIXLIB
=
wineps.so
IMPORTS
=
user32 gdi32 winspool advapi32 win32u
UNIX_LIBS
=
-lwin32u
UNIX_LIBS
=
-lwin32u
-lm
C_SRCS
=
\
afm.c
\
...
...
dlls/wineps.drv/builtin.c
View file @
b1f7b0da
...
...
@@ -339,38 +339,3 @@ BOOL CDECL PSDRV_GetTextExtentExPoint(PHYSDEV dev, LPCWSTR str, INT count, LPINT
}
return
TRUE
;
}
/***********************************************************************
* PSDRV_GetCharWidth
*/
BOOL
CDECL
PSDRV_GetCharWidth
(
PHYSDEV
dev
,
UINT
first
,
UINT
count
,
const
WCHAR
*
chars
,
INT
*
buffer
)
{
PSDRV_PDEVICE
*
physDev
=
get_psdrv_dev
(
dev
);
UINT
i
,
c
;
if
(
physDev
->
font
.
fontloc
==
Download
)
{
dev
=
GET_NEXT_PHYSDEV
(
dev
,
pGetCharWidth
);
return
dev
->
funcs
->
pGetCharWidth
(
dev
,
first
,
count
,
chars
,
buffer
);
}
TRACE
(
"U+%.4X +%u
\n
"
,
first
,
count
);
for
(
i
=
0
;
i
<
count
;
++
i
)
{
c
=
chars
?
chars
[
i
]
:
first
+
i
;
if
(
c
>
0xffff
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
*
buffer
=
floor
(
PSDRV_UVMetrics
(
c
,
physDev
->
font
.
fontinfo
.
Builtin
.
afm
)
->
WX
*
physDev
->
font
.
fontinfo
.
Builtin
.
scale
+
0
.
5
);
TRACE
(
"U+%.4X: %i
\n
"
,
i
,
*
buffer
);
++
buffer
;
}
return
TRUE
;
}
dlls/wineps.drv/init.c
View file @
b1f7b0da
...
...
@@ -693,7 +693,6 @@ static struct gdi_dc_funcs psdrv_funcs =
.
pCreateCompatibleDC
=
PSDRV_CreateCompatibleDC
,
.
pCreateDC
=
PSDRV_CreateDC
,
.
pDeleteDC
=
PSDRV_DeleteDC
,
.
pGetCharWidth
=
PSDRV_GetCharWidth
,
.
pGetTextExtentExPoint
=
PSDRV_GetTextExtentExPoint
,
.
pGetTextMetrics
=
PSDRV_GetTextMetrics
,
.
priority
=
GDI_PRIORITY_GRAPHICS_DRV
...
...
dlls/wineps.drv/printproc.c
View file @
b1f7b0da
...
...
@@ -155,18 +155,6 @@ static struct pp_data* get_handle_data(HANDLE pp)
return
ret
;
}
static
BOOL
CDECL
font_GetCharWidth
(
PHYSDEV
dev
,
UINT
first
,
UINT
count
,
const
WCHAR
*
chars
,
INT
*
buffer
)
{
XFORM
old
,
xform
=
{
.
eM11
=
1
.
0
f
};
BOOL
ret
;
GetWorldTransform
(
dev
->
hdc
,
&
old
);
SetWorldTransform
(
dev
->
hdc
,
&
xform
);
ret
=
NtGdiGetCharWidthW
(
dev
->
hdc
,
first
,
count
,
(
WCHAR
*
)
chars
,
NTGDI_GETCHARWIDTH_INT
,
buffer
);
SetWorldTransform
(
dev
->
hdc
,
&
old
);
return
ret
;
}
static
BOOL
CDECL
font_GetTextExtentExPoint
(
PHYSDEV
dev
,
const
WCHAR
*
str
,
INT
count
,
INT
*
dxs
)
{
SIZE
size
;
...
...
@@ -199,7 +187,6 @@ static HFONT CDECL font_SelectFont(PHYSDEV dev, HFONT hfont, UINT *aa_flags)
static
const
struct
gdi_dc_funcs
font_funcs
=
{
.
pGetCharWidth
=
font_GetCharWidth
,
.
pGetTextExtentExPoint
=
font_GetTextExtentExPoint
,
.
pGetTextMetrics
=
font_GetTextMetrics
,
.
pSelectFont
=
font_SelectFont
,
...
...
dlls/wineps.drv/psdrv.h
View file @
b1f7b0da
...
...
@@ -434,7 +434,6 @@ extern INT CDECL PSDRV_ExtEscape( PHYSDEV dev, INT nEscape, INT cbInput, LPCVOID
extern
BOOL
CDECL
PSDRV_ExtTextOut
(
PHYSDEV
dev
,
INT
x
,
INT
y
,
UINT
flags
,
const
RECT
*
lprect
,
LPCWSTR
str
,
UINT
count
,
const
INT
*
lpDx
)
DECLSPEC_HIDDEN
;
extern
BOOL
CDECL
PSDRV_FillPath
(
PHYSDEV
dev
)
DECLSPEC_HIDDEN
;
extern
BOOL
CDECL
PSDRV_GetCharWidth
(
PHYSDEV
dev
,
UINT
first
,
UINT
count
,
const
WCHAR
*
chars
,
INT
*
buffer
)
DECLSPEC_HIDDEN
;
extern
BOOL
CDECL
PSDRV_GetTextExtentExPoint
(
PHYSDEV
dev
,
LPCWSTR
str
,
INT
count
,
LPINT
alpDx
)
DECLSPEC_HIDDEN
;
extern
BOOL
CDECL
PSDRV_GetTextMetrics
(
PHYSDEV
dev
,
TEXTMETRICW
*
metrics
)
DECLSPEC_HIDDEN
;
extern
BOOL
CDECL
PSDRV_LineTo
(
PHYSDEV
dev
,
INT
x
,
INT
y
)
DECLSPEC_HIDDEN
;
...
...
dlls/wineps.drv/unixlib.c
View file @
b1f7b0da
...
...
@@ -25,6 +25,8 @@
#endif
#include <stdarg.h>
#include <stdlib.h>
#include <math.h>
#include "windef.h"
#include "winbase.h"
...
...
@@ -1133,6 +1135,62 @@ static BOOL CDECL enum_fonts(PHYSDEV dev, LPLOGFONTW plf, FONTENUMPROCW proc, LP
return
ret
;
}
static
int
metrics_by_uv
(
const
void
*
a
,
const
void
*
b
)
{
return
(
int
)(((
const
AFMMETRICS
*
)
a
)
->
UV
-
((
const
AFMMETRICS
*
)
b
)
->
UV
);
}
const
AFMMETRICS
*
uv_metrics
(
LONG
uv
,
const
AFM
*
afm
)
{
const
AFMMETRICS
*
needle
;
AFMMETRICS
key
;
/*
* Ugly work-around for symbol fonts. Wine is sending characters which
* belong in the Unicode private use range (U+F020 - U+F0FF) as ASCII
* characters (U+0020 - U+00FF).
*/
if
((
afm
->
Metrics
->
UV
&
0xff00
)
==
0xf000
&&
uv
<
0x100
)
uv
|=
0xf000
;
key
.
UV
=
uv
;
needle
=
bsearch
(
&
key
,
afm
->
Metrics
,
afm
->
NumofMetrics
,
sizeof
(
AFMMETRICS
),
metrics_by_uv
);
if
(
!
needle
)
{
WARN
(
"No glyph for U+%.4X in '%s'
\n
"
,
(
int
)
uv
,
afm
->
FontName
);
needle
=
afm
->
Metrics
;
}
return
needle
;
}
static
BOOL
CDECL
get_char_width
(
PHYSDEV
dev
,
UINT
first
,
UINT
count
,
const
WCHAR
*
chars
,
INT
*
buffer
)
{
PSDRV_PDEVICE
*
pdev
=
get_psdrv_dev
(
dev
);
UINT
i
,
c
;
if
(
pdev
->
font
.
fontloc
==
Download
)
{
dev
=
GET_NEXT_PHYSDEV
(
dev
,
pGetCharWidth
);
return
dev
->
funcs
->
pGetCharWidth
(
dev
,
first
,
count
,
chars
,
buffer
);
}
TRACE
(
"U+%.4X +%u
\n
"
,
first
,
count
);
for
(
i
=
0
;
i
<
count
;
++
i
)
{
c
=
chars
?
chars
[
i
]
:
first
+
i
;
if
(
c
>
0xffff
)
return
FALSE
;
*
buffer
=
floor
(
uv_metrics
(
c
,
pdev
->
font
.
fontinfo
.
Builtin
.
afm
)
->
WX
*
pdev
->
font
.
fontinfo
.
Builtin
.
scale
+
0
.
5
);
TRACE
(
"U+%.4X: %i
\n
"
,
i
,
*
buffer
);
++
buffer
;
}
return
TRUE
;
}
static
NTSTATUS
init_dc
(
void
*
arg
)
{
struct
init_dc_params
*
params
=
arg
;
...
...
@@ -1142,6 +1200,7 @@ static NTSTATUS init_dc(void *arg)
params
->
funcs
->
pExtEscape
=
ext_escape
;
params
->
funcs
->
pSelectFont
=
select_font
;
params
->
funcs
->
pEnumFonts
=
enum_fonts
;
params
->
funcs
->
pGetCharWidth
=
get_char_width
;
return
TRUE
;
}
...
...
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