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
c0cb341a
Commit
c0cb341a
authored
Feb 01, 2007
by
Huw Davies
Committed by
Alexandre Julliard
Feb 05, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineps.drv: Try to use the PostSript name of a font.
parent
37b671c5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
0 deletions
+67
-0
download.c
dlls/wineps.drv/download.c
+67
-0
No files found.
dlls/wineps.drv/download.c
View file @
c0cb341a
...
...
@@ -52,6 +52,73 @@ static void get_download_name(PSDRV_PDEVICE *physDev, LPOUTLINETEXTMETRICA
{
int
len
;
char
*
p
;
DWORD
size
;
size
=
GetFontData
(
physDev
->
hdc
,
MS_MAKE_TAG
(
'n'
,
'a'
,
'm'
,
'e'
),
0
,
NULL
,
0
);
if
(
size
!=
0
&&
size
!=
GDI_ERROR
)
{
BYTE
*
name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
name
)
{
USHORT
count
,
i
;
BYTE
*
strings
;
struct
{
USHORT
platform_id
;
USHORT
encoding_id
;
USHORT
language_id
;
USHORT
name_id
;
USHORT
length
;
USHORT
offset
;
}
*
name_record
;
GetFontData
(
physDev
->
hdc
,
MS_MAKE_TAG
(
'n'
,
'a'
,
'm'
,
'e'
),
0
,
name
,
size
);
count
=
GET_BE_WORD
(
name
+
2
);
strings
=
name
+
GET_BE_WORD
(
name
+
4
);
name_record
=
(
typeof
(
name_record
))(
name
+
6
);
for
(
i
=
0
;
i
<
count
;
i
++
,
name_record
++
)
{
name_record
->
platform_id
=
GET_BE_WORD
(
&
name_record
->
platform_id
);
name_record
->
encoding_id
=
GET_BE_WORD
(
&
name_record
->
encoding_id
);
name_record
->
language_id
=
GET_BE_WORD
(
&
name_record
->
language_id
);
name_record
->
name_id
=
GET_BE_WORD
(
&
name_record
->
name_id
);
name_record
->
length
=
GET_BE_WORD
(
&
name_record
->
length
);
name_record
->
offset
=
GET_BE_WORD
(
&
name_record
->
offset
);
if
(
name_record
->
platform_id
==
1
&&
name_record
->
encoding_id
==
0
&&
name_record
->
language_id
==
0
&&
name_record
->
name_id
==
6
)
{
TRACE
(
"Got Mac PS name %s
\n
"
,
debugstr_an
((
char
*
)
strings
+
name_record
->
offset
,
name_record
->
length
));
*
str
=
HeapAlloc
(
GetProcessHeap
(),
0
,
name_record
->
length
+
1
);
memcpy
(
*
str
,
strings
+
name_record
->
offset
,
name_record
->
length
);
*
(
*
str
+
name_record
->
length
)
=
'\0'
;
HeapFree
(
GetProcessHeap
(),
0
,
name
);
return
;
}
if
(
name_record
->
platform_id
==
3
&&
name_record
->
encoding_id
==
1
&&
name_record
->
language_id
==
0x409
&&
name_record
->
name_id
==
6
)
{
WCHAR
*
unicode
=
HeapAlloc
(
GetProcessHeap
(),
0
,
name_record
->
length
+
2
);
DWORD
len
;
int
c
;
for
(
c
=
0
;
c
<
name_record
->
length
/
2
;
c
++
)
unicode
[
c
]
=
GET_BE_WORD
(
strings
+
name_record
->
offset
+
c
*
2
);
unicode
[
c
]
=
0
;
TRACE
(
"Got Windows PS name %s
\n
"
,
debugstr_w
(
unicode
));
len
=
WideCharToMultiByte
(
1252
,
0
,
unicode
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
*
str
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
WideCharToMultiByte
(
1252
,
0
,
unicode
,
-
1
,
*
str
,
len
,
NULL
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
unicode
);
HeapFree
(
GetProcessHeap
(),
0
,
name
);
return
;
}
}
TRACE
(
"Unable to find PostScript name
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
name
);
}
}
len
=
strlen
((
char
*
)
potm
+
(
ptrdiff_t
)
potm
->
otmpFullName
)
+
1
;
*
str
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
strcpy
(
*
str
,
(
char
*
)
potm
+
(
ptrdiff_t
)
potm
->
otmpFullName
);
...
...
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