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
b0f50e7e
Commit
b0f50e7e
authored
Apr 21, 2017
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 21, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Partially implement GetGlyphImageFormats().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
377d0e26
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
3 deletions
+45
-3
dwrite_private.h
dlls/dwrite/dwrite_private.h
+1
-0
font.c
dlls/dwrite/font.c
+6
-2
opentype.c
dlls/dwrite/opentype.c
+38
-0
font.c
dlls/dwrite/tests/font.c
+0
-1
No files found.
dlls/dwrite/dwrite_private.h
View file @
b0f50e7e
...
...
@@ -229,6 +229,7 @@ extern UINT32 opentype_get_cpal_paletteentrycount(const void*) DECLSPEC_HIDDEN;
extern
HRESULT
opentype_get_cpal_entries
(
const
void
*
,
UINT32
,
UINT32
,
UINT32
,
DWRITE_COLOR_F
*
)
DECLSPEC_HIDDEN
;
extern
HRESULT
opentype_get_font_signature
(
struct
file_stream_desc
*
,
FONTSIGNATURE
*
)
DECLSPEC_HIDDEN
;
extern
BOOL
opentype_has_vertical_variants
(
IDWriteFontFace4
*
)
DECLSPEC_HIDDEN
;
extern
UINT32
opentype_get_glyph_image_formats
(
IDWriteFontFace4
*
)
DECLSPEC_HIDDEN
;
struct
dwrite_colorglyph
{
USHORT
layer
;
/* [0, num_layers) index indicating current layer */
...
...
dlls/dwrite/font.c
View file @
b0f50e7e
...
...
@@ -242,6 +242,7 @@ struct dwrite_fontface {
DWRITE_FONT_STRETCH
stretch
;
DWRITE_FONT_WEIGHT
weight
;
DWRITE_PANOSE
panose
;
UINT32
glyph_image_formats
;
LOGFONTW
lf
;
};
...
...
@@ -1278,8 +1279,10 @@ static HRESULT WINAPI dwritefontface4_GetGlyphImageFormats_(IDWriteFontFace4 *if
static
DWRITE_GLYPH_IMAGE_FORMATS
WINAPI
dwritefontface4_GetGlyphImageFormats
(
IDWriteFontFace4
*
iface
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace4
(
iface
);
FIXME
(
"(%p): stub
\n
"
,
This
);
return
DWRITE_GLYPH_IMAGE_FORMATS_NONE
;
TRACE
(
"(%p)
\n
"
,
This
);
return
This
->
glyph_image_formats
;
}
static
HRESULT
WINAPI
dwritefontface4_GetGlyphImageData
(
IDWriteFontFace4
*
iface
,
UINT16
glyph
,
...
...
@@ -4345,6 +4348,7 @@ HRESULT create_fontface(const struct fontface_desc *desc, struct list *cached_li
fontface
->
flags
|=
FONTFACE_IS_MONOSPACED
;
if
(
opentype_has_vertical_variants
(
&
fontface
->
IDWriteFontFace4_iface
))
fontface
->
flags
|=
FONTFACE_HAS_VERTICAL_VARIANTS
;
fontface
->
glyph_image_formats
=
opentype_get_glyph_image_formats
(
&
fontface
->
IDWriteFontFace4_iface
);
/* Font properties are reused from font object when 'normal' face creation path is used:
collection -> family -> matching font -> fontface.
...
...
dlls/dwrite/opentype.c
View file @
b0f50e7e
...
...
@@ -34,6 +34,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(dwrite);
#define MS_GPOS_TAG DWRITE_MAKE_OPENTYPE_TAG('G','P','O','S')
#define MS_GSUB_TAG DWRITE_MAKE_OPENTYPE_TAG('G','S','U','B')
#define MS_NAME_TAG DWRITE_MAKE_OPENTYPE_TAG('n','a','m','e')
#define MS_GLYF_TAG DWRITE_MAKE_OPENTYPE_TAG('g','l','y','f')
#define MS_CFF__TAG DWRITE_MAKE_OPENTYPE_TAG('C','F','F',' ')
#define MS_COLR_TAG DWRITE_MAKE_OPENTYPE_TAG('C','O','L','R')
#ifdef WORDS_BIGENDIAN
#define GET_BE_WORD(x) (x)
...
...
@@ -2034,3 +2037,38 @@ BOOL opentype_has_vertical_variants(IDWriteFontFace4 *fontface)
return
ret
;
}
static
BOOL
opentype_has_font_table
(
IDWriteFontFace4
*
fontface
,
UINT32
tag
)
{
BOOL
exists
=
FALSE
;
const
void
*
data
;
void
*
context
;
UINT32
size
;
HRESULT
hr
;
hr
=
IDWriteFontFace4_TryGetFontTable
(
fontface
,
tag
,
&
data
,
&
size
,
&
context
,
&
exists
);
if
(
FAILED
(
hr
))
return
FALSE
;
if
(
exists
)
IDWriteFontFace4_ReleaseFontTable
(
fontface
,
context
);
return
exists
;
}
UINT32
opentype_get_glyph_image_formats
(
IDWriteFontFace4
*
fontface
)
{
UINT32
ret
=
DWRITE_GLYPH_IMAGE_FORMATS_NONE
;
if
(
opentype_has_font_table
(
fontface
,
MS_GLYF_TAG
))
ret
|=
DWRITE_GLYPH_IMAGE_FORMATS_TRUETYPE
;
if
(
opentype_has_font_table
(
fontface
,
MS_CFF__TAG
))
ret
|=
DWRITE_GLYPH_IMAGE_FORMATS_CFF
;
if
(
opentype_has_font_table
(
fontface
,
MS_COLR_TAG
))
ret
|=
DWRITE_GLYPH_IMAGE_FORMATS_COLR
;
/* TODO: handle SVG and bitmap data */
return
ret
;
}
dlls/dwrite/tests/font.c
View file @
b0f50e7e
...
...
@@ -7504,7 +7504,6 @@ static void test_GetGlyphImageFormats(void)
/* Mask describes font as a whole. */
formats
=
IDWriteFontFace4_GetGlyphImageFormats
(
fontface4
);
expected_formats
=
get_face_glyph_image_formats
(
fontface4
);
todo_wine
ok
(
formats
==
expected_formats
,
"%s - %s, expected formats %#x, got formats %#x.
\n
"
,
wine_dbgstr_w
(
familynameW
),
wine_dbgstr_w
(
facenameW
),
expected_formats
,
formats
);
...
...
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