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
19eab9c0
Commit
19eab9c0
authored
May 09, 2023
by
Piotr Caban
Committed by
Alexandre Julliard
May 11, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineps: Store font substitution table in DEVMODE.
parent
aa3699dd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
23 deletions
+44
-23
init.c
dlls/wineps.drv/init.c
+18
-5
psdrv.h
dlls/wineps.drv/psdrv.h
+1
-0
unixlib.c
dlls/wineps.drv/unixlib.c
+19
-18
unixlib.h
dlls/wineps.drv/unixlib.h
+6
-0
No files found.
dlls/wineps.drv/init.c
View file @
19eab9c0
...
...
@@ -503,10 +503,11 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCWSTR name)
WCHAR
*
ppd_filename
=
NULL
;
char
*
nameA
=
NULL
;
BOOL
using_default_devmode
=
FALSE
;
int
len
,
input_slots
,
resolutions
,
page_size
s
,
size
;
int
i
,
len
,
input_slots
,
resolutions
,
page_sizes
,
font_sub
s
,
size
;
struct
input_slot
*
dm_slot
;
struct
resolution
*
dm_res
;
struct
page_size
*
dm_page
;
struct
font_sub
*
dm_sub
;
INPUTSLOT
*
slot
;
RESOLUTION
*
res
;
PAGESIZE
*
page
;
...
...
@@ -544,11 +545,17 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCWSTR name)
goto
fail
;
}
pi
->
FontSubTable
=
load_font_sub_table
(
hPrinter
,
&
pi
->
FontSubTableSize
);
input_slots
=
list_count
(
&
pi
->
ppd
->
InputSlots
);
resolutions
=
list_count
(
&
pi
->
ppd
->
Resolutions
);
page_sizes
=
list_count
(
&
pi
->
ppd
->
PageSizes
);
size
=
FIELD_OFFSET
(
PSDRV_DEVMODE
,
data
[
input_slots
*
sizeof
(
struct
input_slot
)
+
resolutions
*
sizeof
(
struct
resolution
)
+
page_sizes
*
sizeof
(
struct
page_size
)]);
font_subs
=
pi
->
FontSubTableSize
;
size
=
FIELD_OFFSET
(
PSDRV_DEVMODE
,
data
[
input_slots
*
sizeof
(
struct
input_slot
)
+
resolutions
*
sizeof
(
struct
resolution
)
+
page_sizes
*
sizeof
(
struct
page_size
)
+
font_subs
*
sizeof
(
struct
font_sub
)]);
pi
->
Devmode
=
get_devmode
(
hPrinter
,
name
,
&
using_default_devmode
,
size
);
if
(
!
pi
->
Devmode
)
goto
fail
;
...
...
@@ -622,6 +629,14 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCWSTR name)
dm_page
->
win_page
=
page
->
WinPage
;
dm_page
++
;
}
dm_sub
=
(
struct
font_sub
*
)
dm_page
;
for
(
i
=
0
;
i
<
font_subs
;
i
++
)
{
lstrcpynW
(
dm_sub
->
name
,
pi
->
FontSubTable
[
i
].
pValueName
,
ARRAY_SIZE
(
dm_sub
->
name
));
lstrcpynW
(
dm_sub
->
sub
,
(
WCHAR
*
)
pi
->
FontSubTable
[
i
].
pData
,
ARRAY_SIZE
(
dm_sub
->
sub
));
dm_sub
++
;
}
}
/* Duplex is indicated by the setting of the DM_DUPLEX bit in dmFields.
...
...
@@ -640,8 +655,6 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCWSTR name)
set_devmode
(
hPrinter
,
pi
->
Devmode
);
pi
->
FontSubTable
=
load_font_sub_table
(
hPrinter
,
&
pi
->
FontSubTableSize
);
LIST_FOR_EACH_ENTRY
(
font
,
&
pi
->
ppd
->
InstalledFonts
,
FONTNAME
,
entry
)
{
afm
=
PSDRV_FindAFMinList
(
PSDRV_AFMFontList
,
font
->
Name
);
...
...
dlls/wineps.drv/psdrv.h
View file @
19eab9c0
...
...
@@ -227,6 +227,7 @@ typedef struct {
int
input_slots
;
int
resolutions
;
int
page_sizes
;
int
font_subs
;
BYTE
data
[
1
];
}
PSDRV_DEVMODE
;
...
...
dlls/wineps.drv/unixlib.c
View file @
19eab9c0
...
...
@@ -1050,9 +1050,11 @@ static HFONT CDECL select_font(PHYSDEV dev, HFONT hfont, UINT *aa_flags)
{
PSDRV_PDEVICE
*
pdev
=
get_psdrv_dev
(
dev
);
PHYSDEV
next
=
GET_NEXT_PHYSDEV
(
dev
,
pSelectFont
);
const
struct
font_sub
*
font_sub
;
HFONT
ret
;
LOGFONTW
lf
;
BOOL
subst
=
FALSE
;
int
i
;
if
(
!
NtGdiExtGetObjectW
(
hfont
,
sizeof
(
lf
),
&
lf
))
return
0
;
...
...
@@ -1097,28 +1099,27 @@ static HFONT CDECL select_font(PHYSDEV dev, HFONT hfont, UINT *aa_flags)
}
}
if
(
pdev
->
pi
->
pi
->
FontSubTableSize
!=
0
)
font_sub
=
(
const
struct
font_sub
*
)(
pdev
->
devmode
->
data
+
pdev
->
devmode
->
input_slots
*
sizeof
(
struct
input_slot
)
+
pdev
->
devmode
->
resolutions
*
sizeof
(
struct
resolution
)
+
pdev
->
devmode
->
page_sizes
*
sizeof
(
struct
page_size
));
for
(
i
=
0
;
i
<
pdev
->
devmode
->
font_subs
;
i
++
)
{
DWORD
i
;
for
(
i
=
0
;
i
<
pdev
->
pi
->
pi
->
FontSubTableSize
;
++
i
)
if
(
!
wcsicmp
(
lf
.
lfFaceName
,
font_sub
[
i
].
name
))
{
if
(
!
wcsicmp
(
lf
.
lfFaceName
,
pdev
->
pi
->
pi
->
FontSubTable
[
i
].
pValueName
))
TRACE
(
"substituting facename %s for %s
\n
"
,
debugstr_w
(
font_sub
[
i
].
sub
),
debugstr_w
(
lf
.
lfFaceName
));
if
(
wcslen
(
font_sub
[
i
].
sub
)
<
LF_FACESIZE
)
{
TRACE
(
"substituting facename %s for %s
\n
"
,
debugstr_w
((
WCHAR
*
)
pdev
->
pi
->
pi
->
FontSubTable
[
i
].
pData
),
debugstr_w
(
lf
.
lfFaceName
));
if
(
wcslen
((
WCHAR
*
)
pdev
->
pi
->
pi
->
FontSubTable
[
i
].
pData
)
<
LF_FACESIZE
)
{
wcscpy
(
lf
.
lfFaceName
,
(
WCHAR
*
)
pdev
->
pi
->
pi
->
FontSubTable
[
i
].
pData
);
subst
=
TRUE
;
}
else
{
WARN
(
"Facename %s is too long; ignoring substitution
\n
"
,
debugstr_w
((
WCHAR
*
)
pdev
->
pi
->
pi
->
FontSubTable
[
i
].
pData
));
}
break
;
wcscpy
(
lf
.
lfFaceName
,
font_sub
[
i
].
sub
);
subst
=
TRUE
;
}
else
{
WARN
(
"Facename %s is too long; ignoring substitution
\n
"
,
debugstr_w
(
font_sub
[
i
].
sub
));
}
break
;
}
}
...
...
dlls/wineps.drv/unixlib.h
View file @
19eab9c0
...
...
@@ -60,6 +60,12 @@ struct page_size
short
win_page
;
};
struct
font_sub
{
WCHAR
name
[
LF_FACESIZE
];
WCHAR
sub
[
LF_FACESIZE
];
};
/* Unix calls */
enum
wineps_funcs
{
...
...
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