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
38a99b2f
Commit
38a99b2f
authored
Feb 11, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 11, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Add support for PFM files in Analyze().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b9e58dd7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
opentype.c
dlls/dwrite/opentype.c
+48
-0
No files found.
dlls/dwrite/opentype.c
View file @
38a99b2f
...
...
@@ -811,6 +811,16 @@ static HRESULT opentype_otf_analyzer(IDWriteFontFileStream *stream, UINT32 *font
static
HRESULT
opentype_type1_analyzer
(
IDWriteFontFileStream
*
stream
,
UINT32
*
font_count
,
DWRITE_FONT_FILE_TYPE
*
file_type
,
DWRITE_FONT_FACE_TYPE
*
face_type
)
{
#include "pshpack1.h"
/* Specified in Adobe TechNote #5178 */
struct
pfm_header
{
WORD
dfVersion
;
DWORD
dfSize
;
char
data0
[
95
];
DWORD
dfDevice
;
char
data1
[
12
];
};
#include "poppack.h"
struct
type1_header
{
WORD
tag
;
char
data
[
14
];
...
...
@@ -834,6 +844,44 @@ static HRESULT opentype_type1_analyzer(IDWriteFontFileStream *stream, UINT32 *fo
IDWriteFontFileStream_ReleaseFileFragment
(
stream
,
context
);
/* let's see if it's a .pfm metrics file */
if
(
*
file_type
==
DWRITE_FONT_FILE_TYPE_UNKNOWN
)
{
const
struct
pfm_header
*
pfm_header
;
UINT64
filesize
;
DWORD
offset
;
BOOL
header_checked
;
hr
=
IDWriteFontFileStream_GetFileSize
(
stream
,
&
filesize
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
IDWriteFontFileStream_ReadFileFragment
(
stream
,
(
const
void
**
)
&
pfm_header
,
0
,
sizeof
(
*
pfm_header
),
&
context
);
if
(
FAILED
(
hr
))
return
hr
;
offset
=
pfm_header
->
dfDevice
;
header_checked
=
pfm_header
->
dfVersion
==
0x100
&&
pfm_header
->
dfSize
==
filesize
;
IDWriteFontFileStream_ReleaseFileFragment
(
stream
,
context
);
/* as a last test check static string in PostScript information section */
if
(
header_checked
)
{
static
const
char
postscript
[]
=
"PostScript"
;
char
*
devtype_name
;
hr
=
IDWriteFontFileStream_ReadFileFragment
(
stream
,
(
const
void
**
)
&
devtype_name
,
offset
,
sizeof
(
postscript
),
&
context
);
if
(
FAILED
(
hr
))
return
hr
;
if
(
!
memcmp
(
devtype_name
,
postscript
,
sizeof
(
postscript
)))
{
*
font_count
=
1
;
*
file_type
=
DWRITE_FONT_FILE_TYPE_TYPE1_PFM
;
*
face_type
=
DWRITE_FONT_FACE_TYPE_TYPE1
;
}
IDWriteFontFileStream_ReleaseFileFragment
(
stream
,
context
);
}
}
return
*
file_type
!=
DWRITE_FONT_FILE_TYPE_UNKNOWN
?
S_OK
:
S_FALSE
;
}
...
...
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