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
28bf9356
Commit
28bf9356
authored
Apr 04, 2012
by
Huw Davies
Committed by
Alexandre Julliard
Apr 04, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineps: Add a helper to retrieve the font substitution table.
parent
a2e6c734
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
28 deletions
+27
-28
init.c
dlls/wineps.drv/init.c
+27
-28
No files found.
dlls/wineps.drv/init.c
View file @
28bf9356
...
...
@@ -530,6 +530,31 @@ static INT PSDRV_GetDeviceCaps( PHYSDEV dev, INT cap )
}
}
static
PRINTER_ENUM_VALUESA
*
load_font_sub_table
(
HANDLE
printer
,
DWORD
*
num_entries
)
{
DWORD
res
,
needed
,
num
;
PRINTER_ENUM_VALUESA
*
table
=
NULL
;
static
const
char
fontsubkey
[]
=
"PrinterDriverData
\\
FontSubTable"
;
*
num_entries
=
0
;
res
=
EnumPrinterDataExA
(
printer
,
fontsubkey
,
NULL
,
0
,
&
needed
,
&
num
);
if
(
res
!=
ERROR_MORE_DATA
)
return
NULL
;
table
=
HeapAlloc
(
PSDRV_Heap
,
0
,
needed
);
if
(
!
table
)
return
NULL
;
res
=
EnumPrinterDataExA
(
printer
,
fontsubkey
,
(
LPBYTE
)
table
,
needed
,
&
needed
,
&
num
);
if
(
res
!=
ERROR_SUCCESS
)
{
HeapFree
(
PSDRV_Heap
,
0
,
table
);
return
NULL
;
}
*
num_entries
=
num
;
return
table
;
}
static
struct
list
printer_list
=
LIST_INIT
(
printer_list
);
/**********************************************************************
...
...
@@ -742,35 +767,9 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCWSTR name)
pi
->
Devmode
->
dmPublic
.
dmDuplex
=
DMDUP_SIMPLEX
;
}
res
=
EnumPrinterDataExA
(
hPrinter
,
"PrinterDriverData
\\
FontSubTable"
,
NULL
,
0
,
&
needed
,
&
pi
->
FontSubTableSize
);
if
(
res
==
ERROR_SUCCESS
||
res
==
ERROR_FILE_NOT_FOUND
)
{
TRACE
(
"No 'FontSubTable' for printer '%s'
\n
"
,
debugstr_w
(
name
));
}
else
if
(
res
==
ERROR_MORE_DATA
)
{
pi
->
FontSubTable
=
HeapAlloc
(
PSDRV_Heap
,
0
,
needed
);
if
(
pi
->
FontSubTable
==
NULL
)
{
ERR
(
"Failed to allocate %i bytes from heap
\n
"
,
needed
);
goto
closeprinter
;
}
res
=
EnumPrinterDataExA
(
hPrinter
,
"PrinterDriverData
\\
FontSubTable"
,
(
LPBYTE
)
pi
->
FontSubTable
,
needed
,
&
needed
,
&
pi
->
FontSubTableSize
);
if
(
res
!=
ERROR_SUCCESS
)
{
ERR
(
"EnumPrinterDataExA returned %i
\n
"
,
res
);
goto
closeprinter
;
}
}
else
{
ERR
(
"EnumPrinterDataExA returned %i
\n
"
,
res
);
goto
closeprinter
;
}
pi
->
FontSubTable
=
load_font_sub_table
(
hPrinter
,
&
pi
->
FontSubTableSize
);
if
(
ClosePrinter
(
hPrinter
)
==
0
)
{
ERR
(
"ClosePrinter failed with code %i
\n
"
,
GetLastError
());
goto
cleanup
;
}
ClosePrinter
(
hPrinter
);
pi
->
Fonts
=
NULL
;
...
...
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