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
1e65a32e
Commit
1e65a32e
authored
Oct 08, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 08, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Pass stream pointer to OpenType parsing code.
parent
fdc77282
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
13 deletions
+18
-13
dwrite_private.h
dlls/dwrite/dwrite_private.h
+1
-1
font.c
dlls/dwrite/font.c
+5
-10
opentype.c
dlls/dwrite/opentype.c
+12
-2
No files found.
dlls/dwrite/dwrite_private.h
View file @
1e65a32e
...
...
@@ -106,7 +106,7 @@ extern HRESULT create_localfontfileloader(IDWriteLocalFontFileLoader** iface) DE
extern
HRESULT
font_create_fontface
(
IDWriteFactory
*
iface
,
DWRITE_FONT_FACE_TYPE
facetype
,
UINT32
files_number
,
IDWriteFontFile
*
const
*
font_files
,
UINT32
index
,
DWRITE_FONT_SIMULATIONS
sim_flags
,
IDWriteFontFace
**
font_face
)
DECLSPEC_HIDDEN
;
/* Opentype font table functions */
extern
HRESULT
analyze_opentype_font
(
const
void
*
font_data
,
UINT32
*
font_count
,
DWRITE_FONT_FILE_TYPE
*
file_type
,
DWRITE_FONT_FACE_TYPE
*
face_type
,
BOOL
*
supported
)
DECLSPEC_HIDDEN
;
extern
HRESULT
opentype_analyze_font
(
IDWriteFontFileStream
*
,
UINT32
*
,
DWRITE_FONT_FILE_TYPE
*
,
DWRITE_FONT_FACE_TYPE
*
,
BOOL
*
)
DECLSPEC_HIDDEN
;
extern
HRESULT
find_font_table
(
IDWriteFontFileStream
*
stream
,
UINT32
font_index
,
UINT32
tag
,
const
void
**
table_data
,
void
**
table_context
,
UINT32
*
table_size
,
BOOL
*
found
)
DECLSPEC_HIDDEN
;
extern
VOID
OpenType_CMAP_GetGlyphIndex
(
LPVOID
data
,
DWORD
utf32c
,
LPWORD
pgi
,
DWORD
flags
)
DECLSPEC_HIDDEN
;
extern
VOID
get_font_properties
(
LPCVOID
os2
,
LPCVOID
head
,
LPCVOID
post
,
DWRITE_FONT_METRICS
*
metrics
,
DWRITE_FONT_STRETCH
*
stretch
,
DWRITE_FONT_WEIGHT
*
weight
,
DWRITE_FONT_STYLE
*
style
)
DECLSPEC_HIDDEN
;
...
...
dlls/dwrite/font.c
View file @
1e65a32e
...
...
@@ -1276,12 +1276,10 @@ static HRESULT WINAPI dwritefontfile_GetLoader(IDWriteFontFile *iface, IDWriteFo
static
HRESULT
WINAPI
dwritefontfile_Analyze
(
IDWriteFontFile
*
iface
,
BOOL
*
isSupportedFontType
,
DWRITE_FONT_FILE_TYPE
*
fontFileType
,
DWRITE_FONT_FACE_TYPE
*
fontFaceType
,
UINT32
*
numberOfFaces
)
{
HRESULT
hr
;
const
void
*
font_data
;
void
*
context
;
struct
dwrite_fontfile
*
This
=
impl_from_IDWriteFontFile
(
iface
);
IDWriteFontFileStream
*
stream
;
HRESULT
hr
;
struct
dwrite_fontfile
*
This
=
impl_from_IDWriteFontFile
(
iface
);
FIXME
(
"(%p)->(%p, %p, %p, %p): Stub
\n
"
,
This
,
isSupportedFontType
,
fontFileType
,
fontFaceType
,
numberOfFaces
);
*
isSupportedFontType
=
FALSE
;
...
...
@@ -1293,12 +1291,9 @@ static HRESULT WINAPI dwritefontfile_Analyze(IDWriteFontFile *iface, BOOL *isSup
hr
=
IDWriteFontFileLoader_CreateStreamFromKey
(
This
->
loader
,
This
->
reference_key
,
This
->
key_size
,
&
stream
);
if
(
FAILED
(
hr
))
return
S_OK
;
hr
=
IDWriteFontFileStream_ReadFileFragment
(
stream
,
&
font_data
,
0
,
28
,
&
context
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
analyze_opentype_font
(
font_data
,
numberOfFaces
,
fontFileType
,
fontFaceType
,
isSupportedFontType
);
IDWriteFontFileStream_ReleaseFileFragment
(
stream
,
context
);
}
hr
=
opentype_analyze_font
(
stream
,
numberOfFaces
,
fontFileType
,
fontFaceType
,
isSupportedFontType
);
/* TODO: Further Analysis */
IDWriteFontFileStream_Release
(
stream
);
return
S_OK
;
...
...
dlls/dwrite/opentype.c
View file @
1e65a32e
...
...
@@ -180,11 +180,19 @@ typedef struct
}
TT_OS2_V2
;
#include "poppack.h"
HRESULT
analyze_opentype_font
(
const
void
*
font_data
,
UINT32
*
font_count
,
DWRITE_FONT_FILE_TYPE
*
file_type
,
DWRITE_FONT_FACE_TYPE
*
face_type
,
BOOL
*
supported
)
HRESULT
opentype_analyze_font
(
IDWriteFontFileStream
*
stream
,
UINT32
*
font_count
,
DWRITE_FONT_FILE_TYPE
*
file_type
,
DWRITE_FONT_FACE_TYPE
*
face_type
,
BOOL
*
supported
)
{
/* TODO: Do font validation */
const
char
*
tag
=
font_data
;
const
void
*
font_data
;
const
char
*
tag
;
void
*
context
;
HRESULT
hr
;
hr
=
IDWriteFontFileStream_ReadFileFragment
(
stream
,
&
font_data
,
0
,
sizeof
(
TTC_Header_V1
),
&
context
);
if
(
FAILED
(
hr
))
return
hr
;
tag
=
font_data
;
*
supported
=
FALSE
;
*
file_type
=
DWRITE_FONT_FILE_TYPE_UNKNOWN
;
if
(
face_type
)
...
...
@@ -212,6 +220,8 @@ HRESULT analyze_opentype_font(const void* font_data, UINT32* font_count, DWRITE_
{
*
file_type
=
DWRITE_FONT_FILE_TYPE_CFF
;
}
IDWriteFontFileStream_ReleaseFileFragment
(
stream
,
context
);
return
S_OK
;
}
...
...
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