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
032e088c
Commit
032e088c
authored
Feb 05, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 05, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Recognize Type1 .pfb files in Analyze().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
076b3536
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
opentype.c
dlls/dwrite/opentype.c
+30
-0
No files found.
dlls/dwrite/opentype.c
View file @
032e088c
...
...
@@ -785,12 +785,42 @@ static HRESULT opentype_otf_analyzer(IDWriteFontFileStream *stream, UINT32 *font
return
*
file_type
!=
DWRITE_FONT_FILE_TYPE_UNKNOWN
?
S_OK
:
S_FALSE
;
}
static
HRESULT
opentype_type1_analyzer
(
IDWriteFontFileStream
*
stream
,
UINT32
*
font_count
,
DWRITE_FONT_FILE_TYPE
*
file_type
,
DWRITE_FONT_FACE_TYPE
*
face_type
)
{
struct
type1_header
{
WORD
tag
;
char
data
[
14
];
};
const
struct
type1_header
*
header
;
void
*
context
;
HRESULT
hr
;
hr
=
IDWriteFontFileStream_ReadFileFragment
(
stream
,
(
const
void
**
)
&
header
,
0
,
sizeof
(
*
header
),
&
context
);
if
(
FAILED
(
hr
))
return
hr
;
/* tag is followed by plain text section */
if
(
header
->
tag
==
0x8001
&&
(
!
memcmp
(
header
->
data
,
"%!PS-AdobeFont"
,
14
)
||
!
memcmp
(
header
->
data
,
"%!FontType"
,
10
)))
{
*
font_count
=
1
;
*
file_type
=
DWRITE_FONT_FILE_TYPE_TYPE1_PFB
;
*
face_type
=
DWRITE_FONT_FACE_TYPE_TYPE1
;
}
IDWriteFontFileStream_ReleaseFileFragment
(
stream
,
context
);
return
*
file_type
!=
DWRITE_FONT_FILE_TYPE_UNKNOWN
?
S_OK
:
S_FALSE
;
}
HRESULT
opentype_analyze_font
(
IDWriteFontFileStream
*
stream
,
UINT32
*
font_count
,
DWRITE_FONT_FILE_TYPE
*
file_type
,
DWRITE_FONT_FACE_TYPE
*
face_type
,
BOOL
*
supported
)
{
static
dwrite_fontfile_analyzer
fontfile_analyzers
[]
=
{
opentype_ttf_analyzer
,
opentype_otf_analyzer
,
opentype_ttc_analyzer
,
opentype_type1_analyzer
,
NULL
};
dwrite_fontfile_analyzer
*
analyzer
=
fontfile_analyzers
;
...
...
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