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
a52167e7
Commit
a52167e7
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 EnumFonts implementation to unixlib.
parent
fb8daf33
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
78 additions
and
88 deletions
+78
-88
builtin.c
dlls/wineps.drv/builtin.c
+0
-80
init.c
dlls/wineps.drv/init.c
+0
-1
printproc.c
dlls/wineps.drv/printproc.c
+0
-6
psdrv.h
dlls/wineps.drv/psdrv.h
+0
-1
unixlib.c
dlls/wineps.drv/unixlib.c
+78
-0
No files found.
dlls/wineps.drv/builtin.c
View file @
a52167e7
...
@@ -374,83 +374,3 @@ BOOL CDECL PSDRV_GetCharWidth(PHYSDEV dev, UINT first, UINT count, const WCHAR *
...
@@ -374,83 +374,3 @@ BOOL CDECL PSDRV_GetCharWidth(PHYSDEV dev, UINT first, UINT count, const WCHAR *
return
TRUE
;
return
TRUE
;
}
}
/***********************************************************************
* PSDRV_GetFontMetric
*/
static
UINT
PSDRV_GetFontMetric
(
HDC
hdc
,
const
AFM
*
afm
,
NEWTEXTMETRICEXW
*
ntmx
,
ENUMLOGFONTEXW
*
elfx
)
{
/* ntmx->ntmTm is NEWTEXTMETRICW; compatible w/ TEXTMETRICW per Win32 doc */
TEXTMETRICW
*
tm
=
(
TEXTMETRICW
*
)
&
(
ntmx
->
ntmTm
);
LOGFONTW
*
lf
=
&
(
elfx
->
elfLogFont
);
PSFONT
font
;
memset
(
ntmx
,
0
,
sizeof
(
*
ntmx
));
memset
(
elfx
,
0
,
sizeof
(
*
elfx
));
ScaleFont
(
afm
,
-
(
LONG
)(
afm
->
WinMetrics
.
usUnitsPerEm
),
&
font
,
tm
);
lf
->
lfHeight
=
tm
->
tmHeight
;
lf
->
lfWidth
=
tm
->
tmAveCharWidth
;
lf
->
lfWeight
=
tm
->
tmWeight
;
lf
->
lfItalic
=
tm
->
tmItalic
;
lf
->
lfCharSet
=
tm
->
tmCharSet
;
lf
->
lfPitchAndFamily
=
(
afm
->
IsFixedPitch
)
?
FIXED_PITCH
:
VARIABLE_PITCH
;
lstrcpynW
(
lf
->
lfFaceName
,
afm
->
FamilyName
,
LF_FACESIZE
);
return
DEVICE_FONTTYPE
;
}
/***********************************************************************
* PSDRV_EnumFonts
*/
BOOL
CDECL
PSDRV_EnumFonts
(
PHYSDEV
dev
,
LPLOGFONTW
plf
,
FONTENUMPROCW
proc
,
LPARAM
lp
)
{
PSDRV_PDEVICE
*
physDev
=
get_psdrv_dev
(
dev
);
PHYSDEV
next
=
GET_NEXT_PHYSDEV
(
dev
,
pEnumFonts
);
ENUMLOGFONTEXW
lf
;
NEWTEXTMETRICEXW
tm
;
BOOL
ret
;
AFMLISTENTRY
*
afmle
;
FONTFAMILY
*
family
;
ret
=
next
->
funcs
->
pEnumFonts
(
next
,
plf
,
proc
,
lp
);
if
(
!
ret
)
return
FALSE
;
if
(
plf
&&
plf
->
lfFaceName
[
0
]
)
{
TRACE
(
"lfFaceName = %s
\n
"
,
debugstr_w
(
plf
->
lfFaceName
));
for
(
family
=
physDev
->
pi
->
Fonts
;
family
;
family
=
family
->
next
)
{
if
(
!
wcsncmp
(
plf
->
lfFaceName
,
family
->
FamilyName
,
wcslen
(
family
->
FamilyName
)))
break
;
}
if
(
family
)
{
for
(
afmle
=
family
->
afmlist
;
afmle
;
afmle
=
afmle
->
next
)
{
UINT
fm
;
TRACE
(
"Got '%s'
\n
"
,
afmle
->
afm
->
FontName
);
fm
=
PSDRV_GetFontMetric
(
dev
->
hdc
,
afmle
->
afm
,
&
tm
,
&
lf
);
if
(
!
(
ret
=
(
*
proc
)(
&
lf
.
elfLogFont
,
(
TEXTMETRICW
*
)
&
tm
,
fm
,
lp
)))
break
;
}
}
}
else
{
TRACE
(
"lfFaceName = NULL
\n
"
);
for
(
family
=
physDev
->
pi
->
Fonts
;
family
;
family
=
family
->
next
)
{
UINT
fm
;
afmle
=
family
->
afmlist
;
TRACE
(
"Got '%s'
\n
"
,
afmle
->
afm
->
FontName
);
fm
=
PSDRV_GetFontMetric
(
dev
->
hdc
,
afmle
->
afm
,
&
tm
,
&
lf
);
if
(
!
(
ret
=
(
*
proc
)(
&
lf
.
elfLogFont
,
(
TEXTMETRICW
*
)
&
tm
,
fm
,
lp
)))
break
;
}
}
return
ret
;
}
dlls/wineps.drv/init.c
View file @
a52167e7
...
@@ -693,7 +693,6 @@ static struct gdi_dc_funcs psdrv_funcs =
...
@@ -693,7 +693,6 @@ static struct gdi_dc_funcs psdrv_funcs =
.
pCreateCompatibleDC
=
PSDRV_CreateCompatibleDC
,
.
pCreateCompatibleDC
=
PSDRV_CreateCompatibleDC
,
.
pCreateDC
=
PSDRV_CreateDC
,
.
pCreateDC
=
PSDRV_CreateDC
,
.
pDeleteDC
=
PSDRV_DeleteDC
,
.
pDeleteDC
=
PSDRV_DeleteDC
,
.
pEnumFonts
=
PSDRV_EnumFonts
,
.
pGetCharWidth
=
PSDRV_GetCharWidth
,
.
pGetCharWidth
=
PSDRV_GetCharWidth
,
.
pGetTextExtentExPoint
=
PSDRV_GetTextExtentExPoint
,
.
pGetTextExtentExPoint
=
PSDRV_GetTextExtentExPoint
,
.
pGetTextMetrics
=
PSDRV_GetTextMetrics
,
.
pGetTextMetrics
=
PSDRV_GetTextMetrics
,
...
...
dlls/wineps.drv/printproc.c
View file @
a52167e7
...
@@ -155,11 +155,6 @@ static struct pp_data* get_handle_data(HANDLE pp)
...
@@ -155,11 +155,6 @@ static struct pp_data* get_handle_data(HANDLE pp)
return
ret
;
return
ret
;
}
}
static
BOOL
CDECL
font_EnumFonts
(
PHYSDEV
dev
,
LOGFONTW
*
lf
,
FONTENUMPROCW
proc
,
LPARAM
lp
)
{
return
EnumFontFamiliesExW
(
dev
->
hdc
,
lf
,
proc
,
lp
,
0
);
}
static
BOOL
CDECL
font_GetCharWidth
(
PHYSDEV
dev
,
UINT
first
,
UINT
count
,
const
WCHAR
*
chars
,
INT
*
buffer
)
static
BOOL
CDECL
font_GetCharWidth
(
PHYSDEV
dev
,
UINT
first
,
UINT
count
,
const
WCHAR
*
chars
,
INT
*
buffer
)
{
{
XFORM
old
,
xform
=
{
.
eM11
=
1
.
0
f
};
XFORM
old
,
xform
=
{
.
eM11
=
1
.
0
f
};
...
@@ -204,7 +199,6 @@ static HFONT CDECL font_SelectFont(PHYSDEV dev, HFONT hfont, UINT *aa_flags)
...
@@ -204,7 +199,6 @@ static HFONT CDECL font_SelectFont(PHYSDEV dev, HFONT hfont, UINT *aa_flags)
static
const
struct
gdi_dc_funcs
font_funcs
=
static
const
struct
gdi_dc_funcs
font_funcs
=
{
{
.
pEnumFonts
=
font_EnumFonts
,
.
pGetCharWidth
=
font_GetCharWidth
,
.
pGetCharWidth
=
font_GetCharWidth
,
.
pGetTextExtentExPoint
=
font_GetTextExtentExPoint
,
.
pGetTextExtentExPoint
=
font_GetTextExtentExPoint
,
.
pGetTextMetrics
=
font_GetTextMetrics
,
.
pGetTextMetrics
=
font_GetTextMetrics
,
...
...
dlls/wineps.drv/psdrv.h
View file @
a52167e7
...
@@ -429,7 +429,6 @@ extern BOOL CDECL PSDRV_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bo
...
@@ -429,7 +429,6 @@ extern BOOL CDECL PSDRV_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bo
extern
BOOL
CDECL
PSDRV_Ellipse
(
PHYSDEV
dev
,
INT
left
,
INT
top
,
INT
right
,
INT
bottom
)
DECLSPEC_HIDDEN
;
extern
BOOL
CDECL
PSDRV_Ellipse
(
PHYSDEV
dev
,
INT
left
,
INT
top
,
INT
right
,
INT
bottom
)
DECLSPEC_HIDDEN
;
extern
INT
CDECL
PSDRV_EndDoc
(
PHYSDEV
dev
)
DECLSPEC_HIDDEN
;
extern
INT
CDECL
PSDRV_EndDoc
(
PHYSDEV
dev
)
DECLSPEC_HIDDEN
;
extern
INT
CDECL
PSDRV_EndPage
(
PHYSDEV
dev
)
DECLSPEC_HIDDEN
;
extern
INT
CDECL
PSDRV_EndPage
(
PHYSDEV
dev
)
DECLSPEC_HIDDEN
;
extern
BOOL
CDECL
PSDRV_EnumFonts
(
PHYSDEV
dev
,
LPLOGFONTW
plf
,
FONTENUMPROCW
proc
,
LPARAM
lp
)
DECLSPEC_HIDDEN
;
extern
INT
CDECL
PSDRV_ExtEscape
(
PHYSDEV
dev
,
INT
nEscape
,
INT
cbInput
,
LPCVOID
in_data
,
extern
INT
CDECL
PSDRV_ExtEscape
(
PHYSDEV
dev
,
INT
nEscape
,
INT
cbInput
,
LPCVOID
in_data
,
INT
cbOutput
,
LPVOID
out_data
)
DECLSPEC_HIDDEN
;
INT
cbOutput
,
LPVOID
out_data
)
DECLSPEC_HIDDEN
;
extern
BOOL
CDECL
PSDRV_ExtTextOut
(
PHYSDEV
dev
,
INT
x
,
INT
y
,
UINT
flags
,
extern
BOOL
CDECL
PSDRV_ExtTextOut
(
PHYSDEV
dev
,
INT
x
,
INT
y
,
UINT
flags
,
...
...
dlls/wineps.drv/unixlib.c
View file @
a52167e7
...
@@ -1056,6 +1056,83 @@ static HFONT CDECL select_font(PHYSDEV dev, HFONT hfont, UINT *aa_flags)
...
@@ -1056,6 +1056,83 @@ static HFONT CDECL select_font(PHYSDEV dev, HFONT hfont, UINT *aa_flags)
return
hfont
;
return
hfont
;
}
}
static
UINT
get_font_metric
(
HDC
hdc
,
const
AFM
*
afm
,
NEWTEXTMETRICEXW
*
ntmx
,
ENUMLOGFONTEXW
*
elfx
)
{
/* ntmx->ntmTm is NEWTEXTMETRICW; compatible w/ TEXTMETRICW per Win32 doc */
TEXTMETRICW
*
tm
=
(
TEXTMETRICW
*
)
&
(
ntmx
->
ntmTm
);
LOGFONTW
*
lf
=
&
(
elfx
->
elfLogFont
);
PSFONT
font
;
memset
(
ntmx
,
0
,
sizeof
(
*
ntmx
));
memset
(
elfx
,
0
,
sizeof
(
*
elfx
));
scale_font
(
afm
,
-
(
LONG
)
afm
->
WinMetrics
.
usUnitsPerEm
,
&
font
,
tm
);
lf
->
lfHeight
=
tm
->
tmHeight
;
lf
->
lfWidth
=
tm
->
tmAveCharWidth
;
lf
->
lfWeight
=
tm
->
tmWeight
;
lf
->
lfItalic
=
tm
->
tmItalic
;
lf
->
lfCharSet
=
tm
->
tmCharSet
;
lf
->
lfPitchAndFamily
=
afm
->
IsFixedPitch
?
FIXED_PITCH
:
VARIABLE_PITCH
;
lstrcpynW
(
lf
->
lfFaceName
,
afm
->
FamilyName
,
LF_FACESIZE
);
return
DEVICE_FONTTYPE
;
}
static
BOOL
CDECL
enum_fonts
(
PHYSDEV
dev
,
LPLOGFONTW
plf
,
FONTENUMPROCW
proc
,
LPARAM
lp
)
{
PSDRV_PDEVICE
*
pdev
=
get_psdrv_dev
(
dev
);
PHYSDEV
next
=
GET_NEXT_PHYSDEV
(
dev
,
pEnumFonts
);
ENUMLOGFONTEXW
lf
;
NEWTEXTMETRICEXW
tm
;
BOOL
ret
;
AFMLISTENTRY
*
afmle
;
FONTFAMILY
*
family
;
ret
=
next
->
funcs
->
pEnumFonts
(
next
,
plf
,
proc
,
lp
);
if
(
!
ret
)
return
FALSE
;
if
(
plf
&&
plf
->
lfFaceName
[
0
])
{
TRACE
(
"lfFaceName = %s
\n
"
,
debugstr_w
(
plf
->
lfFaceName
));
for
(
family
=
pdev
->
pi
->
Fonts
;
family
;
family
=
family
->
next
)
{
if
(
!
wcsncmp
(
plf
->
lfFaceName
,
family
->
FamilyName
,
wcslen
(
family
->
FamilyName
)))
break
;
}
if
(
family
)
{
for
(
afmle
=
family
->
afmlist
;
afmle
;
afmle
=
afmle
->
next
)
{
UINT
fm
;
TRACE
(
"Got '%s'
\n
"
,
afmle
->
afm
->
FontName
);
fm
=
get_font_metric
(
dev
->
hdc
,
afmle
->
afm
,
&
tm
,
&
lf
);
if
(
!
(
ret
=
(
*
proc
)(
&
lf
.
elfLogFont
,
(
TEXTMETRICW
*
)
&
tm
,
fm
,
lp
)))
break
;
}
}
}
else
{
TRACE
(
"lfFaceName = NULL
\n
"
);
for
(
family
=
pdev
->
pi
->
Fonts
;
family
;
family
=
family
->
next
)
{
UINT
fm
;
afmle
=
family
->
afmlist
;
TRACE
(
"Got '%s'
\n
"
,
afmle
->
afm
->
FontName
);
fm
=
get_font_metric
(
dev
->
hdc
,
afmle
->
afm
,
&
tm
,
&
lf
);
if
(
!
(
ret
=
(
*
proc
)(
&
lf
.
elfLogFont
,
(
TEXTMETRICW
*
)
&
tm
,
fm
,
lp
)))
break
;
}
}
return
ret
;
}
static
NTSTATUS
init_dc
(
void
*
arg
)
static
NTSTATUS
init_dc
(
void
*
arg
)
{
{
struct
init_dc_params
*
params
=
arg
;
struct
init_dc_params
*
params
=
arg
;
...
@@ -1064,6 +1141,7 @@ static NTSTATUS init_dc(void *arg)
...
@@ -1064,6 +1141,7 @@ static NTSTATUS init_dc(void *arg)
params
->
funcs
->
pResetDC
=
reset_dc
;
params
->
funcs
->
pResetDC
=
reset_dc
;
params
->
funcs
->
pExtEscape
=
ext_escape
;
params
->
funcs
->
pExtEscape
=
ext_escape
;
params
->
funcs
->
pSelectFont
=
select_font
;
params
->
funcs
->
pSelectFont
=
select_font
;
params
->
funcs
->
pEnumFonts
=
enum_fonts
;
return
TRUE
;
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