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
9bf1114d
Commit
9bf1114d
authored
Oct 29, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 30, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Update to IDWriteFontFace4.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1316520a
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
242 additions
and
208 deletions
+242
-208
dwrite_private.h
dlls/dwrite/dwrite_private.h
+14
-14
font.c
dlls/dwrite/font.c
+196
-162
freetype.c
dlls/dwrite/freetype.c
+22
-22
main.c
dlls/dwrite/main.c
+7
-7
opentype.c
dlls/dwrite/opentype.c
+3
-3
No files found.
dlls/dwrite/dwrite_private.h
View file @
9bf1114d
...
...
@@ -180,7 +180,7 @@ extern HRESULT get_eudc_fontcollection(IDWriteFactory4*,IDWriteFontCollection**)
extern
HRESULT
get_textanalyzer
(
IDWriteTextAnalyzer
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_font_file
(
IDWriteFontFileLoader
*
loader
,
const
void
*
reference_key
,
UINT32
key_size
,
IDWriteFontFile
**
font_file
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_localfontfileloader
(
IDWriteLocalFontFileLoader
**
iface
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_fontface
(
const
struct
fontface_desc
*
,
IDWriteFontFace
3
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_fontface
(
const
struct
fontface_desc
*
,
IDWriteFontFace
4
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_font_collection
(
IDWriteFactory4
*
,
IDWriteFontFileEnumerator
*
,
BOOL
,
IDWriteFontCollection1
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_glyphrunanalysis
(
const
struct
glyphrunanalysis_desc
*
,
IDWriteGlyphRunAnalysis
**
)
DECLSPEC_HIDDEN
;
extern
BOOL
is_system_collection
(
IDWriteFontCollection
*
)
DECLSPEC_HIDDEN
;
...
...
@@ -199,7 +199,7 @@ extern HRESULT create_fontfacereference(IDWriteFactory4*,IDWriteFontFile*,UINT32
IDWriteFontFaceReference
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
factory_get_cached_fontface
(
IDWriteFactory4
*
,
IDWriteFontFile
*
const
*
,
UINT32
,
DWRITE_FONT_SIMULATIONS
,
IDWriteFontFace
**
,
struct
list
**
)
DECLSPEC_HIDDEN
;
extern
void
factory_cache_fontface
(
struct
list
*
,
IDWriteFontFace
3
*
)
DECLSPEC_HIDDEN
;
extern
void
factory_cache_fontface
(
struct
list
*
,
IDWriteFontFace
4
*
)
DECLSPEC_HIDDEN
;
/* Opentype font table functions */
struct
dwrite_font_props
{
...
...
@@ -229,7 +229,7 @@ extern UINT32 opentype_get_cpal_palettecount(const void*) DECLSPEC_HIDDEN;
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
(
IDWriteFontFace
3
*
)
DECLSPEC_HIDDEN
;
extern
BOOL
opentype_has_vertical_variants
(
IDWriteFontFace
4
*
)
DECLSPEC_HIDDEN
;
struct
dwrite_colorglyph
{
USHORT
layer
;
/* [0, num_layers) index indicating current layer */
...
...
@@ -259,7 +259,7 @@ extern WCHAR bidi_get_mirrored_char(WCHAR) DECLSPEC_HIDDEN;
/* FreeType integration */
struct
dwrite_glyphbitmap
{
IDWriteFontFace
3
*
fontface
;
IDWriteFontFace
4
*
fontface
;
FLOAT
emsize
;
BOOL
nohint
;
UINT16
index
;
...
...
@@ -272,19 +272,19 @@ struct dwrite_glyphbitmap {
extern
BOOL
init_freetype
(
void
)
DECLSPEC_HIDDEN
;
extern
void
release_freetype
(
void
)
DECLSPEC_HIDDEN
;
extern
HRESULT
freetype_get_design_glyph_metrics
(
IDWriteFontFace
3
*
,
UINT16
,
UINT16
,
DWRITE_GLYPH_METRICS
*
)
DECLSPEC_HIDDEN
;
extern
void
freetype_notify_cacheremove
(
IDWriteFontFace
3
*
)
DECLSPEC_HIDDEN
;
extern
BOOL
freetype_is_monospaced
(
IDWriteFontFace
3
*
)
DECLSPEC_HIDDEN
;
extern
HRESULT
freetype_get_glyphrun_outline
(
IDWriteFontFace
3
*
,
FLOAT
,
UINT16
const
*
,
FLOAT
const
*
,
DWRITE_GLYPH_OFFSET
const
*
,
extern
HRESULT
freetype_get_design_glyph_metrics
(
IDWriteFontFace
4
*
,
UINT16
,
UINT16
,
DWRITE_GLYPH_METRICS
*
)
DECLSPEC_HIDDEN
;
extern
void
freetype_notify_cacheremove
(
IDWriteFontFace
4
*
)
DECLSPEC_HIDDEN
;
extern
BOOL
freetype_is_monospaced
(
IDWriteFontFace
4
*
)
DECLSPEC_HIDDEN
;
extern
HRESULT
freetype_get_glyphrun_outline
(
IDWriteFontFace
4
*
,
FLOAT
,
UINT16
const
*
,
FLOAT
const
*
,
DWRITE_GLYPH_OFFSET
const
*
,
UINT32
,
BOOL
,
IDWriteGeometrySink
*
)
DECLSPEC_HIDDEN
;
extern
UINT16
freetype_get_glyphcount
(
IDWriteFontFace
3
*
)
DECLSPEC_HIDDEN
;
extern
void
freetype_get_glyphs
(
IDWriteFontFace
3
*
,
INT
,
UINT32
const
*
,
UINT32
,
UINT16
*
)
DECLSPEC_HIDDEN
;
extern
BOOL
freetype_has_kerning_pairs
(
IDWriteFontFace
3
*
)
DECLSPEC_HIDDEN
;
extern
INT32
freetype_get_kerning_pair_adjustment
(
IDWriteFontFace
3
*
,
UINT16
,
UINT16
)
DECLSPEC_HIDDEN
;
extern
UINT16
freetype_get_glyphcount
(
IDWriteFontFace
4
*
)
DECLSPEC_HIDDEN
;
extern
void
freetype_get_glyphs
(
IDWriteFontFace
4
*
,
INT
,
UINT32
const
*
,
UINT32
,
UINT16
*
)
DECLSPEC_HIDDEN
;
extern
BOOL
freetype_has_kerning_pairs
(
IDWriteFontFace
4
*
)
DECLSPEC_HIDDEN
;
extern
INT32
freetype_get_kerning_pair_adjustment
(
IDWriteFontFace
4
*
,
UINT16
,
UINT16
)
DECLSPEC_HIDDEN
;
extern
void
freetype_get_glyph_bbox
(
struct
dwrite_glyphbitmap
*
)
DECLSPEC_HIDDEN
;
extern
BOOL
freetype_get_glyph_bitmap
(
struct
dwrite_glyphbitmap
*
)
DECLSPEC_HIDDEN
;
extern
INT
freetype_get_charmap_index
(
IDWriteFontFace
3
*
,
BOOL
*
)
DECLSPEC_HIDDEN
;
extern
INT32
freetype_get_glyph_advance
(
IDWriteFontFace
3
*
,
FLOAT
,
UINT16
,
DWRITE_MEASURING_MODE
)
DECLSPEC_HIDDEN
;
extern
INT
freetype_get_charmap_index
(
IDWriteFontFace
4
*
,
BOOL
*
)
DECLSPEC_HIDDEN
;
extern
INT32
freetype_get_glyph_advance
(
IDWriteFontFace
4
*
,
FLOAT
,
UINT16
,
DWRITE_MEASURING_MODE
)
DECLSPEC_HIDDEN
;
/* Glyph shaping */
enum
SCRIPT_JUSTIFY
...
...
dlls/dwrite/font.c
View file @
9bf1114d
...
...
@@ -184,7 +184,7 @@ struct dwrite_colorglyphenum {
FLOAT
origin_x
;
/* original run origin */
FLOAT
origin_y
;
IDWriteFontFace
3
*
fontface
;
/* for convenience */
IDWriteFontFace
4
*
fontface
;
/* for convenience */
DWRITE_COLOR_GLYPH_RUN
colorrun
;
/* returned with GetCurrentRun() */
DWRITE_GLYPH_RUN
run
;
/* base run */
UINT32
palette
;
/* palette index to get layer color from */
...
...
@@ -213,7 +213,7 @@ enum fontface_flags {
};
struct
dwrite_fontface
{
IDWriteFontFace
3
IDWriteFontFace3
_iface
;
IDWriteFontFace
4
IDWriteFontFace4
_iface
;
LONG
ref
;
IDWriteFontFileStream
**
streams
;
...
...
@@ -261,9 +261,9 @@ struct dwrite_fontfacereference {
IDWriteFactory4
*
factory
;
};
static
inline
struct
dwrite_fontface
*
impl_from_IDWriteFontFace
3
(
IDWriteFontFace3
*
iface
)
static
inline
struct
dwrite_fontface
*
impl_from_IDWriteFontFace
4
(
IDWriteFontFace4
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
dwrite_fontface
,
IDWriteFontFace
3
_iface
);
return
CONTAINING_RECORD
(
iface
,
struct
dwrite_fontface
,
IDWriteFontFace
4
_iface
);
}
static
inline
struct
dwrite_font
*
impl_from_IDWriteFont3
(
IDWriteFont3
*
iface
)
...
...
@@ -336,7 +336,7 @@ static HRESULT set_cached_glyph_metrics(struct dwrite_fontface *fontface, UINT16
return
S_OK
;
}
static
void
*
get_fontface_table
(
IDWriteFontFace
3
*
fontface
,
UINT32
tag
,
struct
dwrite_fonttable
*
table
)
static
void
*
get_fontface_table
(
IDWriteFontFace
4
*
fontface
,
UINT32
tag
,
struct
dwrite_fonttable
*
table
)
{
HRESULT
hr
;
...
...
@@ -344,7 +344,7 @@ static void* get_fontface_table(IDWriteFontFace3 *fontface, UINT32 tag, struct d
return
table
->
data
;
table
->
exists
=
FALSE
;
hr
=
IDWriteFontFace
3
_TryGetFontTable
(
fontface
,
tag
,
(
const
void
**
)
&
table
->
data
,
&
table
->
size
,
&
table
->
context
,
hr
=
IDWriteFontFace
4
_TryGetFontTable
(
fontface
,
tag
,
(
const
void
**
)
&
table
->
data
,
&
table
->
size
,
&
table
->
context
,
&
table
->
exists
);
if
(
FAILED
(
hr
)
||
!
table
->
exists
)
{
WARN
(
"Font does not have a %s table
\n
"
,
debugstr_tag
(
tag
));
...
...
@@ -374,29 +374,29 @@ static FLOAT get_font_prop_vec_dotproduct(const struct dwrite_font_propvec *left
static
inline
void
*
get_fontface_cmap
(
struct
dwrite_fontface
*
fontface
)
{
return
get_fontface_table
(
&
fontface
->
IDWriteFontFace
3
_iface
,
MS_CMAP_TAG
,
&
fontface
->
cmap
);
return
get_fontface_table
(
&
fontface
->
IDWriteFontFace
4
_iface
,
MS_CMAP_TAG
,
&
fontface
->
cmap
);
}
static
inline
void
*
get_fontface_vdmx
(
struct
dwrite_fontface
*
fontface
)
{
return
get_fontface_table
(
&
fontface
->
IDWriteFontFace
3
_iface
,
MS_VDMX_TAG
,
&
fontface
->
vdmx
);
return
get_fontface_table
(
&
fontface
->
IDWriteFontFace
4
_iface
,
MS_VDMX_TAG
,
&
fontface
->
vdmx
);
}
static
inline
void
*
get_fontface_gasp
(
struct
dwrite_fontface
*
fontface
,
UINT32
*
size
)
{
void
*
ptr
=
get_fontface_table
(
&
fontface
->
IDWriteFontFace
3
_iface
,
MS_GASP_TAG
,
&
fontface
->
gasp
);
void
*
ptr
=
get_fontface_table
(
&
fontface
->
IDWriteFontFace
4
_iface
,
MS_GASP_TAG
,
&
fontface
->
gasp
);
*
size
=
fontface
->
gasp
.
size
;
return
ptr
;
}
static
inline
void
*
get_fontface_cpal
(
struct
dwrite_fontface
*
fontface
)
{
return
get_fontface_table
(
&
fontface
->
IDWriteFontFace
3
_iface
,
MS_CPAL_TAG
,
&
fontface
->
cpal
);
return
get_fontface_table
(
&
fontface
->
IDWriteFontFace
4
_iface
,
MS_CPAL_TAG
,
&
fontface
->
cpal
);
}
static
inline
void
*
get_fontface_colr
(
struct
dwrite_fontface
*
fontface
)
{
return
get_fontface_table
(
&
fontface
->
IDWriteFontFace
3
_iface
,
MS_COLR_TAG
,
&
fontface
->
colr
);
return
get_fontface_table
(
&
fontface
->
IDWriteFontFace
4
_iface
,
MS_COLR_TAG
,
&
fontface
->
colr
);
}
static
void
release_font_data
(
struct
dwrite_font_data
*
data
)
...
...
@@ -433,20 +433,21 @@ static void release_fontfamily_data(struct dwrite_fontfamily_data *data)
heap_free
(
data
);
}
static
HRESULT
WINAPI
dwritefontface_QueryInterface
(
IDWriteFontFace
3
*
iface
,
REFIID
riid
,
void
**
obj
)
static
HRESULT
WINAPI
dwritefontface_QueryInterface
(
IDWriteFontFace
4
*
iface
,
REFIID
riid
,
void
**
obj
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
obj
);
if
(
IsEqualIID
(
riid
,
&
IID_IDWriteFontFace3
)
||
if
(
IsEqualIID
(
riid
,
&
IID_IDWriteFontFace4
)
||
IsEqualIID
(
riid
,
&
IID_IDWriteFontFace3
)
||
IsEqualIID
(
riid
,
&
IID_IDWriteFontFace2
)
||
IsEqualIID
(
riid
,
&
IID_IDWriteFontFace1
)
||
IsEqualIID
(
riid
,
&
IID_IDWriteFontFace
)
||
IsEqualIID
(
riid
,
&
IID_IUnknown
))
{
*
obj
=
iface
;
IDWriteFontFace
3
_AddRef
(
iface
);
IDWriteFontFace
4
_AddRef
(
iface
);
return
S_OK
;
}
...
...
@@ -454,17 +455,17 @@ static HRESULT WINAPI dwritefontface_QueryInterface(IDWriteFontFace3 *iface, REF
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
dwritefontface_AddRef
(
IDWriteFontFace
3
*
iface
)
static
ULONG
WINAPI
dwritefontface_AddRef
(
IDWriteFontFace
4
*
iface
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
dwritefontface_Release
(
IDWriteFontFace
3
*
iface
)
static
ULONG
WINAPI
dwritefontface_Release
(
IDWriteFontFace
4
*
iface
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
ref
);
...
...
@@ -473,15 +474,15 @@ static ULONG WINAPI dwritefontface_Release(IDWriteFontFace3 *iface)
UINT32
i
;
if
(
This
->
cmap
.
context
)
IDWriteFontFace
3
_ReleaseFontTable
(
iface
,
This
->
cmap
.
context
);
IDWriteFontFace
4
_ReleaseFontTable
(
iface
,
This
->
cmap
.
context
);
if
(
This
->
vdmx
.
context
)
IDWriteFontFace
3
_ReleaseFontTable
(
iface
,
This
->
vdmx
.
context
);
IDWriteFontFace
4
_ReleaseFontTable
(
iface
,
This
->
vdmx
.
context
);
if
(
This
->
gasp
.
context
)
IDWriteFontFace
3
_ReleaseFontTable
(
iface
,
This
->
gasp
.
context
);
IDWriteFontFace
4
_ReleaseFontTable
(
iface
,
This
->
gasp
.
context
);
if
(
This
->
cpal
.
context
)
IDWriteFontFace
3
_ReleaseFontTable
(
iface
,
This
->
cpal
.
context
);
IDWriteFontFace
4
_ReleaseFontTable
(
iface
,
This
->
cpal
.
context
);
if
(
This
->
colr
.
context
)
IDWriteFontFace
3
_ReleaseFontTable
(
iface
,
This
->
colr
.
context
);
IDWriteFontFace
4
_ReleaseFontTable
(
iface
,
This
->
colr
.
context
);
for
(
i
=
0
;
i
<
This
->
file_count
;
i
++
)
{
if
(
This
->
streams
[
i
])
IDWriteFontFileStream_Release
(
This
->
streams
[
i
]);
...
...
@@ -501,17 +502,17 @@ static ULONG WINAPI dwritefontface_Release(IDWriteFontFace3 *iface)
return
ref
;
}
static
DWRITE_FONT_FACE_TYPE
WINAPI
dwritefontface_GetType
(
IDWriteFontFace
3
*
iface
)
static
DWRITE_FONT_FACE_TYPE
WINAPI
dwritefontface_GetType
(
IDWriteFontFace
4
*
iface
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
This
->
type
;
}
static
HRESULT
WINAPI
dwritefontface_GetFiles
(
IDWriteFontFace
3
*
iface
,
UINT32
*
number_of_files
,
static
HRESULT
WINAPI
dwritefontface_GetFiles
(
IDWriteFontFace
4
*
iface
,
UINT32
*
number_of_files
,
IDWriteFontFile
**
fontfiles
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
int
i
;
TRACE
(
"(%p)->(%p %p)
\n
"
,
This
,
number_of_files
,
fontfiles
);
...
...
@@ -532,45 +533,45 @@ static HRESULT WINAPI dwritefontface_GetFiles(IDWriteFontFace3 *iface, UINT32 *n
return
S_OK
;
}
static
UINT32
WINAPI
dwritefontface_GetIndex
(
IDWriteFontFace
3
*
iface
)
static
UINT32
WINAPI
dwritefontface_GetIndex
(
IDWriteFontFace
4
*
iface
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
This
->
index
;
}
static
DWRITE_FONT_SIMULATIONS
WINAPI
dwritefontface_GetSimulations
(
IDWriteFontFace
3
*
iface
)
static
DWRITE_FONT_SIMULATIONS
WINAPI
dwritefontface_GetSimulations
(
IDWriteFontFace
4
*
iface
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
This
->
simulations
;
}
static
BOOL
WINAPI
dwritefontface_IsSymbolFont
(
IDWriteFontFace
3
*
iface
)
static
BOOL
WINAPI
dwritefontface_IsSymbolFont
(
IDWriteFontFace
4
*
iface
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
!!
(
This
->
flags
&
FONTFACE_IS_SYMBOL
);
}
static
void
WINAPI
dwritefontface_GetMetrics
(
IDWriteFontFace
3
*
iface
,
DWRITE_FONT_METRICS
*
metrics
)
static
void
WINAPI
dwritefontface_GetMetrics
(
IDWriteFontFace
4
*
iface
,
DWRITE_FONT_METRICS
*
metrics
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
metrics
);
memcpy
(
metrics
,
&
This
->
metrics
,
sizeof
(
*
metrics
));
}
static
UINT16
WINAPI
dwritefontface_GetGlyphCount
(
IDWriteFontFace
3
*
iface
)
static
UINT16
WINAPI
dwritefontface_GetGlyphCount
(
IDWriteFontFace
4
*
iface
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
freetype_get_glyphcount
(
iface
);
}
static
HRESULT
WINAPI
dwritefontface_GetDesignGlyphMetrics
(
IDWriteFontFace
3
*
iface
,
static
HRESULT
WINAPI
dwritefontface_GetDesignGlyphMetrics
(
IDWriteFontFace
4
*
iface
,
UINT16
const
*
glyphs
,
UINT32
glyph_count
,
DWRITE_GLYPH_METRICS
*
ret
,
BOOL
is_sideways
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
HRESULT
hr
;
UINT32
i
;
...
...
@@ -598,10 +599,10 @@ static HRESULT WINAPI dwritefontface_GetDesignGlyphMetrics(IDWriteFontFace3 *ifa
return
S_OK
;
}
static
HRESULT
WINAPI
dwritefontface_GetGlyphIndices
(
IDWriteFontFace
3
*
iface
,
UINT32
const
*
codepoints
,
static
HRESULT
WINAPI
dwritefontface_GetGlyphIndices
(
IDWriteFontFace
4
*
iface
,
UINT32
const
*
codepoints
,
UINT32
count
,
UINT16
*
glyph_indices
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
TRACE
(
"(%p)->(%p %u %p)
\n
"
,
This
,
codepoints
,
count
,
glyph_indices
);
...
...
@@ -617,10 +618,10 @@ static HRESULT WINAPI dwritefontface_GetGlyphIndices(IDWriteFontFace3 *iface, UI
return
S_OK
;
}
static
HRESULT
WINAPI
dwritefontface_TryGetFontTable
(
IDWriteFontFace
3
*
iface
,
UINT32
table_tag
,
static
HRESULT
WINAPI
dwritefontface_TryGetFontTable
(
IDWriteFontFace
4
*
iface
,
UINT32
table_tag
,
const
void
**
table_data
,
UINT32
*
table_size
,
void
**
context
,
BOOL
*
exists
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
struct
file_stream_desc
stream_desc
;
TRACE
(
"(%p)->(%s %p %p %p %p)
\n
"
,
This
,
debugstr_tag
(
table_tag
),
table_data
,
table_size
,
context
,
exists
);
...
...
@@ -631,20 +632,20 @@ static HRESULT WINAPI dwritefontface_TryGetFontTable(IDWriteFontFace3 *iface, UI
return
opentype_get_font_table
(
&
stream_desc
,
table_tag
,
table_data
,
context
,
table_size
,
exists
);
}
static
void
WINAPI
dwritefontface_ReleaseFontTable
(
IDWriteFontFace
3
*
iface
,
void
*
table_context
)
static
void
WINAPI
dwritefontface_ReleaseFontTable
(
IDWriteFontFace
4
*
iface
,
void
*
table_context
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
table_context
);
IDWriteFontFileStream_ReleaseFileFragment
(
This
->
streams
[
0
],
table_context
);
}
static
HRESULT
WINAPI
dwritefontface_GetGlyphRunOutline
(
IDWriteFontFace
3
*
iface
,
FLOAT
emSize
,
static
HRESULT
WINAPI
dwritefontface_GetGlyphRunOutline
(
IDWriteFontFace
4
*
iface
,
FLOAT
emSize
,
UINT16
const
*
glyphs
,
FLOAT
const
*
advances
,
DWRITE_GLYPH_OFFSET
const
*
offsets
,
UINT32
count
,
BOOL
is_sideways
,
BOOL
is_rtl
,
IDWriteGeometrySink
*
sink
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
TRACE
(
"(%p)->(%.2f %p %p %p %u %d %d %p)
\n
"
,
This
,
emSize
,
glyphs
,
advances
,
offsets
,
count
,
is_sideways
,
is_rtl
,
sink
);
...
...
@@ -686,10 +687,10 @@ static DWRITE_RENDERING_MODE fontface_renderingmode_from_measuringmode(DWRITE_ME
return
mode
;
}
static
HRESULT
WINAPI
dwritefontface_GetRecommendedRenderingMode
(
IDWriteFontFace
3
*
iface
,
FLOAT
emSize
,
static
HRESULT
WINAPI
dwritefontface_GetRecommendedRenderingMode
(
IDWriteFontFace
4
*
iface
,
FLOAT
emSize
,
FLOAT
ppdip
,
DWRITE_MEASURING_MODE
measuring
,
IDWriteRenderingParams
*
params
,
DWRITE_RENDERING_MODE
*
mode
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
WORD
gasp
,
*
ptr
;
UINT32
size
;
FLOAT
ppem
;
...
...
@@ -718,11 +719,11 @@ static HRESULT WINAPI dwritefontface_GetRecommendedRenderingMode(IDWriteFontFace
return
S_OK
;
}
static
HRESULT
WINAPI
dwritefontface_GetGdiCompatibleMetrics
(
IDWriteFontFace
3
*
iface
,
FLOAT
emSize
,
FLOAT
pixels_per_dip
,
static
HRESULT
WINAPI
dwritefontface_GetGdiCompatibleMetrics
(
IDWriteFontFace
4
*
iface
,
FLOAT
emSize
,
FLOAT
pixels_per_dip
,
DWRITE_MATRIX
const
*
transform
,
DWRITE_FONT_METRICS
*
metrics
)
{
DWRITE_FONT_METRICS1
metrics1
;
HRESULT
hr
=
IDWriteFontFace
3
_GetGdiCompatibleMetrics
(
iface
,
emSize
,
pixels_per_dip
,
transform
,
&
metrics1
);
HRESULT
hr
=
IDWriteFontFace
4
_GetGdiCompatibleMetrics
(
iface
,
emSize
,
pixels_per_dip
,
transform
,
&
metrics1
);
memcpy
(
metrics
,
&
metrics1
,
sizeof
(
*
metrics
));
return
hr
;
}
...
...
@@ -732,11 +733,11 @@ static inline int round_metric(FLOAT metric)
return
(
int
)
floorf
(
metric
+
0
.
5
f
);
}
static
HRESULT
WINAPI
dwritefontface_GetGdiCompatibleGlyphMetrics
(
IDWriteFontFace
3
*
iface
,
FLOAT
emSize
,
FLOAT
ppdip
,
static
HRESULT
WINAPI
dwritefontface_GetGdiCompatibleGlyphMetrics
(
IDWriteFontFace
4
*
iface
,
FLOAT
emSize
,
FLOAT
ppdip
,
DWRITE_MATRIX
const
*
m
,
BOOL
use_gdi_natural
,
UINT16
const
*
glyphs
,
UINT32
glyph_count
,
DWRITE_GLYPH_METRICS
*
metrics
,
BOOL
is_sideways
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
DWRITE_MEASURING_MODE
mode
;
FLOAT
scale
,
size
;
HRESULT
hr
;
...
...
@@ -756,7 +757,7 @@ static HRESULT WINAPI dwritefontface_GetGdiCompatibleGlyphMetrics(IDWriteFontFac
DWRITE_GLYPH_METRICS
*
ret
=
metrics
+
i
;
DWRITE_GLYPH_METRICS
design
;
hr
=
IDWriteFontFace
3
_GetDesignGlyphMetrics
(
iface
,
glyphs
+
i
,
1
,
&
design
,
is_sideways
);
hr
=
IDWriteFontFace
4
_GetDesignGlyphMetrics
(
iface
,
glyphs
+
i
,
1
,
&
design
,
is_sideways
);
if
(
FAILED
(
hr
))
return
hr
;
...
...
@@ -776,17 +777,17 @@ static HRESULT WINAPI dwritefontface_GetGdiCompatibleGlyphMetrics(IDWriteFontFac
return
S_OK
;
}
static
void
WINAPI
dwritefontface1_GetMetrics
(
IDWriteFontFace
3
*
iface
,
DWRITE_FONT_METRICS1
*
metrics
)
static
void
WINAPI
dwritefontface1_GetMetrics
(
IDWriteFontFace
4
*
iface
,
DWRITE_FONT_METRICS1
*
metrics
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
metrics
);
*
metrics
=
This
->
metrics
;
}
static
HRESULT
WINAPI
dwritefontface1_GetGdiCompatibleMetrics
(
IDWriteFontFace
3
*
iface
,
FLOAT
em_size
,
FLOAT
pixels_per_dip
,
static
HRESULT
WINAPI
dwritefontface1_GetGdiCompatibleMetrics
(
IDWriteFontFace
4
*
iface
,
FLOAT
em_size
,
FLOAT
pixels_per_dip
,
const
DWRITE_MATRIX
*
m
,
DWRITE_FONT_METRICS1
*
metrics
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
const
DWRITE_FONT_METRICS1
*
design
=
&
This
->
metrics
;
UINT16
ascent
,
descent
;
FLOAT
scale
;
...
...
@@ -839,17 +840,17 @@ static HRESULT WINAPI dwritefontface1_GetGdiCompatibleMetrics(IDWriteFontFace3 *
return
S_OK
;
}
static
void
WINAPI
dwritefontface1_GetCaretMetrics
(
IDWriteFontFace
3
*
iface
,
DWRITE_CARET_METRICS
*
metrics
)
static
void
WINAPI
dwritefontface1_GetCaretMetrics
(
IDWriteFontFace
4
*
iface
,
DWRITE_CARET_METRICS
*
metrics
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
metrics
);
*
metrics
=
This
->
caret
;
}
static
HRESULT
WINAPI
dwritefontface1_GetUnicodeRanges
(
IDWriteFontFace
3
*
iface
,
UINT32
max_count
,
static
HRESULT
WINAPI
dwritefontface1_GetUnicodeRanges
(
IDWriteFontFace
4
*
iface
,
UINT32
max_count
,
DWRITE_UNICODE_RANGE
*
ranges
,
UINT32
*
count
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
TRACE
(
"(%p)->(%u %p %p)
\n
"
,
This
,
max_count
,
ranges
,
count
);
...
...
@@ -860,17 +861,17 @@ static HRESULT WINAPI dwritefontface1_GetUnicodeRanges(IDWriteFontFace3 *iface,
return
opentype_cmap_get_unicode_ranges
(
get_fontface_cmap
(
This
),
max_count
,
ranges
,
count
);
}
static
BOOL
WINAPI
dwritefontface1_IsMonospacedFont
(
IDWriteFontFace
3
*
iface
)
static
BOOL
WINAPI
dwritefontface1_IsMonospacedFont
(
IDWriteFontFace
4
*
iface
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
!!
(
This
->
flags
&
FONTFACE_IS_MONOSPACED
);
}
static
HRESULT
WINAPI
dwritefontface1_GetDesignGlyphAdvances
(
IDWriteFontFace
3
*
iface
,
static
HRESULT
WINAPI
dwritefontface1_GetDesignGlyphAdvances
(
IDWriteFontFace
4
*
iface
,
UINT32
glyph_count
,
UINT16
const
*
glyphs
,
INT32
*
advances
,
BOOL
is_sideways
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
UINT32
i
;
TRACE
(
"(%p)->(%u %p %p %d)
\n
"
,
This
,
glyph_count
,
glyphs
,
advances
,
is_sideways
);
...
...
@@ -884,11 +885,11 @@ static HRESULT WINAPI dwritefontface1_GetDesignGlyphAdvances(IDWriteFontFace3 *i
return
S_OK
;
}
static
HRESULT
WINAPI
dwritefontface1_GetGdiCompatibleGlyphAdvances
(
IDWriteFontFace
3
*
iface
,
static
HRESULT
WINAPI
dwritefontface1_GetGdiCompatibleGlyphAdvances
(
IDWriteFontFace
4
*
iface
,
FLOAT
em_size
,
FLOAT
ppdip
,
const
DWRITE_MATRIX
*
m
,
BOOL
use_gdi_natural
,
BOOL
is_sideways
,
UINT32
glyph_count
,
UINT16
const
*
glyphs
,
INT32
*
advances
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
DWRITE_MEASURING_MODE
mode
;
UINT32
i
;
...
...
@@ -918,10 +919,10 @@ static HRESULT WINAPI dwritefontface1_GetGdiCompatibleGlyphAdvances(IDWriteFontF
return
S_OK
;
}
static
HRESULT
WINAPI
dwritefontface1_GetKerningPairAdjustments
(
IDWriteFontFace
3
*
iface
,
UINT32
count
,
static
HRESULT
WINAPI
dwritefontface1_GetKerningPairAdjustments
(
IDWriteFontFace
4
*
iface
,
UINT32
count
,
const
UINT16
*
indices
,
INT32
*
adjustments
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
UINT32
i
;
TRACE
(
"(%p)->(%u %p %p)
\n
"
,
This
,
count
,
indices
,
adjustments
);
...
...
@@ -946,14 +947,14 @@ static HRESULT WINAPI dwritefontface1_GetKerningPairAdjustments(IDWriteFontFace3
return
S_OK
;
}
static
BOOL
WINAPI
dwritefontface1_HasKerningPairs
(
IDWriteFontFace
3
*
iface
)
static
BOOL
WINAPI
dwritefontface1_HasKerningPairs
(
IDWriteFontFace
4
*
iface
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
!!
(
This
->
flags
&
FONTFACE_HAS_KERN_PAIRS
);
}
static
HRESULT
WINAPI
dwritefontface1_GetRecommendedRenderingMode
(
IDWriteFontFace
3
*
iface
,
static
HRESULT
WINAPI
dwritefontface1_GetRecommendedRenderingMode
(
IDWriteFontFace
4
*
iface
,
FLOAT
font_emsize
,
FLOAT
dpiX
,
FLOAT
dpiY
,
const
DWRITE_MATRIX
*
transform
,
BOOL
is_sideways
,
DWRITE_OUTLINE_THRESHOLD
threshold
,
DWRITE_MEASURING_MODE
measuring_mode
,
DWRITE_RENDERING_MODE
*
rendering_mode
)
{
...
...
@@ -962,56 +963,56 @@ static HRESULT WINAPI dwritefontface1_GetRecommendedRenderingMode(IDWriteFontFac
threshold
,
measuring_mode
,
NULL
,
rendering_mode
,
&
gridfitmode
);
}
static
HRESULT
WINAPI
dwritefontface1_GetVerticalGlyphVariants
(
IDWriteFontFace
3
*
iface
,
UINT32
glyph_count
,
static
HRESULT
WINAPI
dwritefontface1_GetVerticalGlyphVariants
(
IDWriteFontFace
4
*
iface
,
UINT32
glyph_count
,
const
UINT16
*
nominal_indices
,
UINT16
*
vertical_indices
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
FIXME
(
"(%p)->(%u %p %p): stub
\n
"
,
This
,
glyph_count
,
nominal_indices
,
vertical_indices
);
return
E_NOTIMPL
;
}
static
BOOL
WINAPI
dwritefontface1_HasVerticalGlyphVariants
(
IDWriteFontFace
3
*
iface
)
static
BOOL
WINAPI
dwritefontface1_HasVerticalGlyphVariants
(
IDWriteFontFace
4
*
iface
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
!!
(
This
->
flags
&
FONTFACE_HAS_VERTICAL_VARIANTS
);
}
static
BOOL
WINAPI
dwritefontface2_IsColorFont
(
IDWriteFontFace
3
*
iface
)
static
BOOL
WINAPI
dwritefontface2_IsColorFont
(
IDWriteFontFace
4
*
iface
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
get_fontface_cpal
(
This
)
&&
get_fontface_colr
(
This
);
}
static
UINT32
WINAPI
dwritefontface2_GetColorPaletteCount
(
IDWriteFontFace
3
*
iface
)
static
UINT32
WINAPI
dwritefontface2_GetColorPaletteCount
(
IDWriteFontFace
4
*
iface
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
opentype_get_cpal_palettecount
(
get_fontface_cpal
(
This
));
}
static
UINT32
WINAPI
dwritefontface2_GetPaletteEntryCount
(
IDWriteFontFace
3
*
iface
)
static
UINT32
WINAPI
dwritefontface2_GetPaletteEntryCount
(
IDWriteFontFace
4
*
iface
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
opentype_get_cpal_paletteentrycount
(
get_fontface_cpal
(
This
));
}
static
HRESULT
WINAPI
dwritefontface2_GetPaletteEntries
(
IDWriteFontFace
3
*
iface
,
UINT32
palette_index
,
static
HRESULT
WINAPI
dwritefontface2_GetPaletteEntries
(
IDWriteFontFace
4
*
iface
,
UINT32
palette_index
,
UINT32
first_entry_index
,
UINT32
entry_count
,
DWRITE_COLOR_F
*
entries
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
TRACE
(
"(%p)->(%u %u %u %p)
\n
"
,
This
,
palette_index
,
first_entry_index
,
entry_count
,
entries
);
return
opentype_get_cpal_entries
(
get_fontface_cpal
(
This
),
palette_index
,
first_entry_index
,
entry_count
,
entries
);
}
static
HRESULT
WINAPI
dwritefontface2_GetRecommendedRenderingMode
(
IDWriteFontFace
3
*
iface
,
FLOAT
emSize
,
static
HRESULT
WINAPI
dwritefontface2_GetRecommendedRenderingMode
(
IDWriteFontFace
4
*
iface
,
FLOAT
emSize
,
FLOAT
dpiX
,
FLOAT
dpiY
,
DWRITE_MATRIX
const
*
m
,
BOOL
is_sideways
,
DWRITE_OUTLINE_THRESHOLD
threshold
,
DWRITE_MEASURING_MODE
measuringmode
,
IDWriteRenderingParams
*
params
,
DWRITE_RENDERING_MODE
*
renderingmode
,
DWRITE_GRID_FIT_MODE
*
gridfitmode
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
FLOAT
emthreshold
;
WORD
gasp
,
*
ptr
;
UINT32
size
;
...
...
@@ -1067,84 +1068,84 @@ static HRESULT WINAPI dwritefontface2_GetRecommendedRenderingMode(IDWriteFontFac
return
S_OK
;
}
static
HRESULT
WINAPI
dwritefontface3_GetFontFaceReference
(
IDWriteFontFace
3
*
iface
,
IDWriteFontFaceReference
**
ref
)
static
HRESULT
WINAPI
dwritefontface3_GetFontFaceReference
(
IDWriteFontFace
4
*
iface
,
IDWriteFontFaceReference
**
ref
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
FIXME
(
"(%p)->(%p): stub
\n
"
,
This
,
ref
);
return
E_NOTIMPL
;
}
static
void
WINAPI
dwritefontface3_GetPanose
(
IDWriteFontFace
3
*
iface
,
DWRITE_PANOSE
*
panose
)
static
void
WINAPI
dwritefontface3_GetPanose
(
IDWriteFontFace
4
*
iface
,
DWRITE_PANOSE
*
panose
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
panose
);
*
panose
=
This
->
panose
;
}
static
DWRITE_FONT_WEIGHT
WINAPI
dwritefontface3_GetWeight
(
IDWriteFontFace
3
*
iface
)
static
DWRITE_FONT_WEIGHT
WINAPI
dwritefontface3_GetWeight
(
IDWriteFontFace
4
*
iface
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
This
->
weight
;
}
static
DWRITE_FONT_STRETCH
WINAPI
dwritefontface3_GetStretch
(
IDWriteFontFace
3
*
iface
)
static
DWRITE_FONT_STRETCH
WINAPI
dwritefontface3_GetStretch
(
IDWriteFontFace
4
*
iface
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
This
->
stretch
;
}
static
DWRITE_FONT_STYLE
WINAPI
dwritefontface3_GetStyle
(
IDWriteFontFace
3
*
iface
)
static
DWRITE_FONT_STYLE
WINAPI
dwritefontface3_GetStyle
(
IDWriteFontFace
4
*
iface
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
This
->
style
;
}
static
HRESULT
WINAPI
dwritefontface3_GetFamilyNames
(
IDWriteFontFace
3
*
iface
,
IDWriteLocalizedStrings
**
names
)
static
HRESULT
WINAPI
dwritefontface3_GetFamilyNames
(
IDWriteFontFace
4
*
iface
,
IDWriteLocalizedStrings
**
names
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
FIXME
(
"(%p)->(%p): stub
\n
"
,
This
,
names
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
dwritefontface3_GetFaceNames
(
IDWriteFontFace
3
*
iface
,
IDWriteLocalizedStrings
**
names
)
static
HRESULT
WINAPI
dwritefontface3_GetFaceNames
(
IDWriteFontFace
4
*
iface
,
IDWriteLocalizedStrings
**
names
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
FIXME
(
"(%p)->(%p): stub
\n
"
,
This
,
names
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
dwritefontface3_GetInformationalStrings
(
IDWriteFontFace
3
*
iface
,
DWRITE_INFORMATIONAL_STRING_ID
stringid
,
static
HRESULT
WINAPI
dwritefontface3_GetInformationalStrings
(
IDWriteFontFace
4
*
iface
,
DWRITE_INFORMATIONAL_STRING_ID
stringid
,
IDWriteLocalizedStrings
**
strings
,
BOOL
*
exists
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
FIXME
(
"(%p)->(%u %p %p): stub
\n
"
,
This
,
stringid
,
strings
,
exists
);
return
E_NOTIMPL
;
}
static
BOOL
WINAPI
dwritefontface3_HasCharacter
(
IDWriteFontFace
3
*
iface
,
UINT32
ch
)
static
BOOL
WINAPI
dwritefontface3_HasCharacter
(
IDWriteFontFace
4
*
iface
,
UINT32
ch
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
UINT16
index
;
HRESULT
hr
;
TRACE
(
"(%p)->(0x%08x)
\n
"
,
This
,
ch
);
index
=
0
;
hr
=
IDWriteFontFace
3
_GetGlyphIndices
(
iface
,
&
ch
,
1
,
&
index
);
hr
=
IDWriteFontFace
4
_GetGlyphIndices
(
iface
,
&
ch
,
1
,
&
index
);
if
(
FAILED
(
hr
))
return
FALSE
;
return
index
!=
0
;
}
static
HRESULT
WINAPI
dwritefontface3_GetRecommendedRenderingMode
(
IDWriteFontFace
3
*
iface
,
FLOAT
emSize
,
FLOAT
dpiX
,
FLOAT
dpiY
,
static
HRESULT
WINAPI
dwritefontface3_GetRecommendedRenderingMode
(
IDWriteFontFace
4
*
iface
,
FLOAT
emSize
,
FLOAT
dpiX
,
FLOAT
dpiY
,
DWRITE_MATRIX
const
*
m
,
BOOL
is_sideways
,
DWRITE_OUTLINE_THRESHOLD
threshold
,
DWRITE_MEASURING_MODE
measuring_mode
,
IDWriteRenderingParams
*
params
,
DWRITE_RENDERING_MODE1
*
rendering_mode
,
DWRITE_GRID_FIT_MODE
*
gridfit_mode
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
FLOAT
emthreshold
;
WORD
gasp
,
*
ptr
;
UINT32
size
;
...
...
@@ -1200,37 +1201,66 @@ static HRESULT WINAPI dwritefontface3_GetRecommendedRenderingMode(IDWriteFontFac
return
S_OK
;
}
static
BOOL
WINAPI
dwritefontface3_IsCharacterLocal
(
IDWriteFontFace
3
*
iface
,
UINT32
ch
)
static
BOOL
WINAPI
dwritefontface3_IsCharacterLocal
(
IDWriteFontFace
4
*
iface
,
UINT32
ch
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
FIXME
(
"(%p)->(0x%x): stub
\n
"
,
This
,
ch
);
return
FALSE
;
}
static
BOOL
WINAPI
dwritefontface3_IsGlyphLocal
(
IDWriteFontFace
3
*
iface
,
UINT16
glyph
)
static
BOOL
WINAPI
dwritefontface3_IsGlyphLocal
(
IDWriteFontFace
4
*
iface
,
UINT16
glyph
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
FIXME
(
"(%p)->(%u): stub
\n
"
,
This
,
glyph
);
return
FALSE
;
}
static
HRESULT
WINAPI
dwritefontface3_AreCharactersLocal
(
IDWriteFontFace
3
*
iface
,
WCHAR
const
*
text
,
static
HRESULT
WINAPI
dwritefontface3_AreCharactersLocal
(
IDWriteFontFace
4
*
iface
,
WCHAR
const
*
text
,
UINT32
count
,
BOOL
enqueue_if_not
,
BOOL
*
are_local
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
FIXME
(
"(%p)->(%s:%u %d %p): stub
\n
"
,
This
,
debugstr_wn
(
text
,
count
),
count
,
enqueue_if_not
,
are_local
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
dwritefontface3_AreGlyphsLocal
(
IDWriteFontFace
3
*
iface
,
UINT16
const
*
glyphs
,
static
HRESULT
WINAPI
dwritefontface3_AreGlyphsLocal
(
IDWriteFontFace
4
*
iface
,
UINT16
const
*
glyphs
,
UINT32
count
,
BOOL
enqueue_if_not
,
BOOL
*
are_local
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
3
(
iface
);
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace
4
(
iface
);
FIXME
(
"(%p)->(%p %u %d %p): stub
\n
"
,
This
,
glyphs
,
count
,
enqueue_if_not
,
are_local
);
return
E_NOTIMPL
;
}
static
const
IDWriteFontFace3Vtbl
dwritefontfacevtbl
=
{
static
HRESULT
WINAPI
dwritefontface4_GetGlyphImageFormats_
(
IDWriteFontFace4
*
iface
,
UINT16
glyph
,
UINT32
ppem_first
,
UINT32
ppem_last
,
DWRITE_GLYPH_IMAGE_FORMATS
*
formats
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace4
(
iface
);
FIXME
(
"(%p)->(%u %u %u %p): stub
\n
"
,
This
,
glyph
,
ppem_first
,
ppem_last
,
formats
);
return
E_NOTIMPL
;
}
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
;
}
static
HRESULT
WINAPI
dwritefontface4_GetGlyphImageData
(
IDWriteFontFace4
*
iface
,
UINT16
glyph
,
UINT32
ppem
,
DWRITE_GLYPH_IMAGE_FORMATS
format
,
DWRITE_GLYPH_IMAGE_DATA
*
data
,
void
**
context
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace4
(
iface
);
FIXME
(
"(%p)->(%u %u %d %p %p): stub
\n
"
,
This
,
glyph
,
ppem
,
format
,
data
,
context
);
return
E_NOTIMPL
;
}
static
void
WINAPI
dwritefontface4_ReleaseGlyphImageData
(
IDWriteFontFace4
*
iface
,
void
*
context
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace4
(
iface
);
FIXME
(
"(%p)->(%p): stub
\n
"
,
This
,
context
);
}
static
const
IDWriteFontFace4Vtbl
dwritefontfacevtbl
=
{
dwritefontface_QueryInterface
,
dwritefontface_AddRef
,
dwritefontface_Release
,
...
...
@@ -1279,10 +1309,14 @@ static const IDWriteFontFace3Vtbl dwritefontfacevtbl = {
dwritefontface3_IsCharacterLocal
,
dwritefontface3_IsGlyphLocal
,
dwritefontface3_AreCharactersLocal
,
dwritefontface3_AreGlyphsLocal
dwritefontface3_AreGlyphsLocal
,
dwritefontface4_GetGlyphImageFormats_
,
dwritefontface4_GetGlyphImageFormats
,
dwritefontface4_GetGlyphImageData
,
dwritefontface4_ReleaseGlyphImageData
};
static
HRESULT
get_fontface_from_font
(
struct
dwrite_font
*
font
,
IDWriteFontFace
3
**
fontface
)
static
HRESULT
get_fontface_from_font
(
struct
dwrite_font
*
font
,
IDWriteFontFace
4
**
fontface
)
{
struct
dwrite_font_data
*
data
=
font
->
data
;
struct
fontface_desc
desc
;
...
...
@@ -1391,7 +1425,7 @@ static DWRITE_FONT_STYLE WINAPI dwritefont_GetStyle(IDWriteFont3 *iface)
static
BOOL
WINAPI
dwritefont_IsSymbolFont
(
IDWriteFont3
*
iface
)
{
struct
dwrite_font
*
This
=
impl_from_IDWriteFont3
(
iface
);
IDWriteFontFace
3
*
fontface
;
IDWriteFontFace
4
*
fontface
;
HRESULT
hr
;
TRACE
(
"(%p)
\n
"
,
This
);
...
...
@@ -1400,7 +1434,7 @@ static BOOL WINAPI dwritefont_IsSymbolFont(IDWriteFont3 *iface)
if
(
FAILED
(
hr
))
return
FALSE
;
return
IDWriteFontFace
3
_IsSymbolFont
(
fontface
);
return
IDWriteFontFace
4
_IsSymbolFont
(
fontface
);
}
static
HRESULT
WINAPI
dwritefont_GetFaceNames
(
IDWriteFont3
*
iface
,
IDWriteLocalizedStrings
**
names
)
...
...
@@ -1426,7 +1460,7 @@ static HRESULT WINAPI dwritefont_GetInformationalStrings(IDWriteFont3 *iface,
return
S_OK
;
if
(
!
data
->
info_strings
[
stringid
])
{
IDWriteFontFace
3
*
fontface
;
IDWriteFontFace
4
*
fontface
;
const
void
*
table_data
;
BOOL
table_exists
;
void
*
context
;
...
...
@@ -1437,7 +1471,7 @@ static HRESULT WINAPI dwritefont_GetInformationalStrings(IDWriteFont3 *iface,
return
hr
;
table_exists
=
FALSE
;
hr
=
IDWriteFontFace
3
_TryGetFontTable
(
fontface
,
MS_NAME_TAG
,
&
table_data
,
&
size
,
&
context
,
&
table_exists
);
hr
=
IDWriteFontFace
4
_TryGetFontTable
(
fontface
,
MS_NAME_TAG
,
&
table_data
,
&
size
,
&
context
,
&
table_exists
);
if
(
FAILED
(
hr
)
||
!
table_exists
)
WARN
(
"no NAME table found.
\n
"
);
...
...
@@ -1445,7 +1479,7 @@ static HRESULT WINAPI dwritefont_GetInformationalStrings(IDWriteFont3 *iface,
hr
=
opentype_get_font_info_strings
(
table_data
,
stringid
,
&
data
->
info_strings
[
stringid
]);
if
(
FAILED
(
hr
)
||
!
data
->
info_strings
[
stringid
])
return
hr
;
IDWriteFontFace
3
_ReleaseFontTable
(
fontface
,
context
);
IDWriteFontFace
4
_ReleaseFontTable
(
fontface
,
context
);
}
}
...
...
@@ -1475,7 +1509,7 @@ static void WINAPI dwritefont_GetMetrics(IDWriteFont3 *iface, DWRITE_FONT_METRIC
static
HRESULT
WINAPI
dwritefont_HasCharacter
(
IDWriteFont3
*
iface
,
UINT32
value
,
BOOL
*
exists
)
{
struct
dwrite_font
*
This
=
impl_from_IDWriteFont3
(
iface
);
IDWriteFontFace
3
*
fontface
;
IDWriteFontFace
4
*
fontface
;
UINT16
index
;
HRESULT
hr
;
...
...
@@ -1488,7 +1522,7 @@ static HRESULT WINAPI dwritefont_HasCharacter(IDWriteFont3 *iface, UINT32 value,
return
hr
;
index
=
0
;
hr
=
IDWriteFontFace
3
_GetGlyphIndices
(
fontface
,
&
value
,
1
,
&
index
);
hr
=
IDWriteFontFace
4
_GetGlyphIndices
(
fontface
,
&
value
,
1
,
&
index
);
if
(
FAILED
(
hr
))
return
hr
;
...
...
@@ -1520,7 +1554,7 @@ static void WINAPI dwritefont1_GetPanose(IDWriteFont3 *iface, DWRITE_PANOSE *pan
static
HRESULT
WINAPI
dwritefont1_GetUnicodeRanges
(
IDWriteFont3
*
iface
,
UINT32
max_count
,
DWRITE_UNICODE_RANGE
*
ranges
,
UINT32
*
count
)
{
struct
dwrite_font
*
This
=
impl_from_IDWriteFont3
(
iface
);
IDWriteFontFace
3
*
fontface
;
IDWriteFontFace
4
*
fontface
;
HRESULT
hr
;
TRACE
(
"(%p)->(%u %p %p)
\n
"
,
This
,
max_count
,
ranges
,
count
);
...
...
@@ -1529,13 +1563,13 @@ static HRESULT WINAPI dwritefont1_GetUnicodeRanges(IDWriteFont3 *iface, UINT32 m
if
(
FAILED
(
hr
))
return
hr
;
return
IDWriteFontFace
3
_GetUnicodeRanges
(
fontface
,
max_count
,
ranges
,
count
);
return
IDWriteFontFace
4
_GetUnicodeRanges
(
fontface
,
max_count
,
ranges
,
count
);
}
static
BOOL
WINAPI
dwritefont1_IsMonospacedFont
(
IDWriteFont3
*
iface
)
{
struct
dwrite_font
*
This
=
impl_from_IDWriteFont3
(
iface
);
IDWriteFontFace
3
*
fontface
;
IDWriteFontFace
4
*
fontface
;
HRESULT
hr
;
TRACE
(
"(%p)
\n
"
,
This
);
...
...
@@ -1544,13 +1578,13 @@ static BOOL WINAPI dwritefont1_IsMonospacedFont(IDWriteFont3 *iface)
if
(
FAILED
(
hr
))
return
FALSE
;
return
IDWriteFontFace
3
_IsMonospacedFont
(
fontface
);
return
IDWriteFontFace
4
_IsMonospacedFont
(
fontface
);
}
static
BOOL
WINAPI
dwritefont2_IsColorFont
(
IDWriteFont3
*
iface
)
{
struct
dwrite_font
*
This
=
impl_from_IDWriteFont3
(
iface
);
IDWriteFontFace
3
*
fontface
;
IDWriteFontFace
4
*
fontface
;
HRESULT
hr
;
TRACE
(
"(%p)
\n
"
,
This
);
...
...
@@ -1559,7 +1593,7 @@ static BOOL WINAPI dwritefont2_IsColorFont(IDWriteFont3 *iface)
if
(
FAILED
(
hr
))
return
FALSE
;
return
IDWriteFontFace
3
_IsColorFont
(
fontface
);
return
IDWriteFontFace
4
_IsColorFont
(
fontface
);
}
static
HRESULT
WINAPI
dwritefont3_CreateFontFace
(
IDWriteFont3
*
iface
,
IDWriteFontFace3
**
fontface
)
...
...
@@ -1569,7 +1603,7 @@ static HRESULT WINAPI dwritefont3_CreateFontFace(IDWriteFont3 *iface, IDWriteFon
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
fontface
);
hr
=
get_fontface_from_font
(
This
,
fontface
);
hr
=
get_fontface_from_font
(
This
,
(
IDWriteFontFace4
**
)
fontface
);
if
(
hr
==
S_OK
)
IDWriteFontFace3_AddRef
(
*
fontface
);
...
...
@@ -4141,7 +4175,7 @@ static HRESULT get_stream_from_file(IDWriteFontFile *file, IDWriteFontFileStream
return
hr
;
}
HRESULT
create_fontface
(
const
struct
fontface_desc
*
desc
,
IDWriteFontFace
3
**
ret
)
HRESULT
create_fontface
(
const
struct
fontface_desc
*
desc
,
IDWriteFontFace
4
**
ret
)
{
struct
file_stream_desc
stream_desc
;
struct
dwrite_fontface
*
fontface
;
...
...
@@ -4165,7 +4199,7 @@ HRESULT create_fontface(const struct fontface_desc *desc, IDWriteFontFace3 **ret
return
E_OUTOFMEMORY
;
}
fontface
->
IDWriteFontFace
3
_iface
.
lpVtbl
=
&
dwritefontfacevtbl
;
fontface
->
IDWriteFontFace
4
_iface
.
lpVtbl
=
&
dwritefontfacevtbl
;
fontface
->
ref
=
1
;
fontface
->
type
=
desc
->
face_type
;
fontface
->
file_count
=
desc
->
files_number
;
...
...
@@ -4186,7 +4220,7 @@ HRESULT create_fontface(const struct fontface_desc *desc, IDWriteFontFace3 **ret
for
(
i
=
0
;
i
<
fontface
->
file_count
;
i
++
)
{
hr
=
get_stream_from_file
(
desc
->
files
[
i
],
&
fontface
->
streams
[
i
]);
if
(
FAILED
(
hr
))
{
IDWriteFontFace
3_Release
(
&
fontface
->
IDWriteFontFace3
_iface
);
IDWriteFontFace
4_Release
(
&
fontface
->
IDWriteFontFace4
_iface
);
return
hr
;
}
...
...
@@ -4207,14 +4241,14 @@ HRESULT create_fontface(const struct fontface_desc *desc, IDWriteFontFace3 **ret
}
fontface
->
flags
=
0
;
fontface
->
charmap
=
freetype_get_charmap_index
(
&
fontface
->
IDWriteFontFace
3
_iface
,
&
is_symbol
);
fontface
->
charmap
=
freetype_get_charmap_index
(
&
fontface
->
IDWriteFontFace
4
_iface
,
&
is_symbol
);
if
(
is_symbol
)
fontface
->
flags
|=
FONTFACE_IS_SYMBOL
;
if
(
freetype_has_kerning_pairs
(
&
fontface
->
IDWriteFontFace
3
_iface
))
if
(
freetype_has_kerning_pairs
(
&
fontface
->
IDWriteFontFace
4
_iface
))
fontface
->
flags
|=
FONTFACE_HAS_KERN_PAIRS
;
if
(
freetype_is_monospaced
(
&
fontface
->
IDWriteFontFace
3
_iface
))
if
(
freetype_is_monospaced
(
&
fontface
->
IDWriteFontFace
4
_iface
))
fontface
->
flags
|=
FONTFACE_IS_MONOSPACED
;
if
(
opentype_has_vertical_variants
(
&
fontface
->
IDWriteFontFace
3
_iface
))
if
(
opentype_has_vertical_variants
(
&
fontface
->
IDWriteFontFace
4
_iface
))
fontface
->
flags
|=
FONTFACE_HAS_VERTICAL_VARIANTS
;
/* Font properties are reused from font object when 'normal' face creation path is used:
...
...
@@ -4234,7 +4268,7 @@ HRESULT create_fontface(const struct fontface_desc *desc, IDWriteFontFace3 **ret
hr
=
init_font_data
(
desc
,
&
names
,
&
data
);
if
(
FAILED
(
hr
))
{
IDWriteFontFace
3_Release
(
&
fontface
->
IDWriteFontFace3
_iface
);
IDWriteFontFace
4_Release
(
&
fontface
->
IDWriteFontFace4
_iface
);
return
hr
;
}
...
...
@@ -4247,7 +4281,7 @@ HRESULT create_fontface(const struct fontface_desc *desc, IDWriteFontFace3 **ret
release_font_data
(
data
);
}
*
ret
=
&
fontface
->
IDWriteFontFace
3
_iface
;
*
ret
=
&
fontface
->
IDWriteFontFace
4
_iface
;
return
S_OK
;
}
...
...
@@ -4684,7 +4718,7 @@ static ULONG WINAPI glyphrunanalysis_Release(IDWriteGlyphRunAnalysis *iface)
static
void
glyphrunanalysis_get_texturebounds
(
struct
dwrite_glyphrunanalysis
*
analysis
,
RECT
*
bounds
)
{
struct
dwrite_glyphbitmap
glyph_bitmap
;
IDWriteFontFace
3
*
fontface3
;
IDWriteFontFace
4
*
fontface3
;
D2D_POINT_2F
origin
;
BOOL
is_rtl
;
HRESULT
hr
;
...
...
@@ -4698,9 +4732,9 @@ static void glyphrunanalysis_get_texturebounds(struct dwrite_glyphrunanalysis *a
if
(
analysis
->
run
.
isSideways
)
FIXME
(
"sideways runs are not supported.
\n
"
);
hr
=
IDWriteFontFace_QueryInterface
(
analysis
->
run
.
fontFace
,
&
IID_IDWriteFontFace
3
,
(
void
**
)
&
fontface3
);
hr
=
IDWriteFontFace_QueryInterface
(
analysis
->
run
.
fontFace
,
&
IID_IDWriteFontFace
4
,
(
void
**
)
&
fontface3
);
if
(
FAILED
(
hr
))
WARN
(
"failed to get IDWriteFontFace
3
, 0x%08x
\n
"
,
hr
);
WARN
(
"failed to get IDWriteFontFace
4
, 0x%08x
\n
"
,
hr
);
/* Start with empty bounds at (0,0) origin, returned bounds are not translated back to (0,0), e.g. for
RTL run negative left bound is returned, same goes for vertical direction - top bound will be negative
...
...
@@ -4738,7 +4772,7 @@ static void glyphrunanalysis_get_texturebounds(struct dwrite_glyphrunanalysis *a
origin
.
y
+=
advance
->
y
;
}
IDWriteFontFace
3
_Release
(
fontface3
);
IDWriteFontFace
4
_Release
(
fontface3
);
/* translate to given run origin */
OffsetRect
(
&
analysis
->
bounds
,
analysis
->
origin
.
x
,
analysis
->
origin
.
y
);
...
...
@@ -4789,16 +4823,16 @@ static void glyphrunanalysis_render(struct dwrite_glyphrunanalysis *analysis, DW
{
static
const
BYTE
masks
[
8
]
=
{
0x80
,
0x40
,
0x20
,
0x10
,
0x08
,
0x04
,
0x02
,
0x01
};
struct
dwrite_glyphbitmap
glyph_bitmap
;
IDWriteFontFace
3
*
fontface2
;
IDWriteFontFace
4
*
fontface2
;
D2D_POINT_2F
origin
;
UINT32
i
,
size
;
BOOL
is_rtl
;
HRESULT
hr
;
RECT
*
bbox
;
hr
=
IDWriteFontFace_QueryInterface
(
analysis
->
run
.
fontFace
,
&
IID_IDWriteFontFace
3
,
(
void
**
)
&
fontface2
);
hr
=
IDWriteFontFace_QueryInterface
(
analysis
->
run
.
fontFace
,
&
IID_IDWriteFontFace
4
,
(
void
**
)
&
fontface2
);
if
(
FAILED
(
hr
))
{
WARN
(
"failed to get IDWriteFontFace
3
, 0x%08x
\n
"
,
hr
);
WARN
(
"failed to get IDWriteFontFace
4
, 0x%08x
\n
"
,
hr
);
return
;
}
...
...
@@ -4900,7 +4934,7 @@ static void glyphrunanalysis_render(struct dwrite_glyphrunanalysis *analysis, DW
origin
.
y
+=
advance
->
y
;
}
IDWriteFontFace
3
_Release
(
fontface2
);
IDWriteFontFace
4
_Release
(
fontface2
);
analysis
->
flags
|=
RUNANALYSIS_BITMAP_READY
;
...
...
@@ -5226,8 +5260,8 @@ static ULONG WINAPI colorglyphenum_Release(IDWriteColorGlyphRunEnumerator *iface
heap_free
(
This
->
glyphindices
);
heap_free
(
This
->
glyphs
);
if
(
This
->
colr
.
context
)
IDWriteFontFace
3
_ReleaseFontTable
(
This
->
fontface
,
This
->
colr
.
context
);
IDWriteFontFace
3
_Release
(
This
->
fontface
);
IDWriteFontFace
4
_ReleaseFontTable
(
This
->
fontface
,
This
->
colr
.
context
);
IDWriteFontFace
4
_Release
(
This
->
fontface
);
heap_free
(
This
);
}
...
...
@@ -5301,7 +5335,7 @@ static BOOL colorglyphenum_build_color_run(struct dwrite_colorglyphenum *glyphen
/* use foreground color or request one from the font */
memset
(
&
colorrun
->
runColor
,
0
,
sizeof
(
colorrun
->
runColor
));
if
(
colorrun
->
paletteIndex
!=
0xffff
)
{
HRESULT
hr
=
IDWriteFontFace
3
_GetPaletteEntries
(
glyphenum
->
fontface
,
glyphenum
->
palette
,
colorrun
->
paletteIndex
,
HRESULT
hr
=
IDWriteFontFace
4
_GetPaletteEntries
(
glyphenum
->
fontface
,
glyphenum
->
palette
,
colorrun
->
paletteIndex
,
1
,
&
colorrun
->
runColor
);
if
(
FAILED
(
hr
))
WARN
(
"failed to get palette entry, fontface %p, palette %u, index %u, 0x%08x
\n
"
,
glyphenum
->
fontface
,
...
...
@@ -5384,19 +5418,19 @@ HRESULT create_colorglyphenum(FLOAT originX, FLOAT originY, const DWRITE_GLYPH_R
{
struct
dwrite_colorglyphenum
*
colorglyphenum
;
BOOL
colorfont
,
has_colored_glyph
;
IDWriteFontFace
3
*
fontface3
;
IDWriteFontFace
4
*
fontface3
;
HRESULT
hr
;
UINT32
i
;
*
ret
=
NULL
;
hr
=
IDWriteFontFace_QueryInterface
(
run
->
fontFace
,
&
IID_IDWriteFontFace
3
,
(
void
**
)
&
fontface3
);
hr
=
IDWriteFontFace_QueryInterface
(
run
->
fontFace
,
&
IID_IDWriteFontFace
4
,
(
void
**
)
&
fontface3
);
if
(
FAILED
(
hr
))
{
WARN
(
"failed to get IDWriteFontFace
3
, 0x%08x
\n
"
,
hr
);
WARN
(
"failed to get IDWriteFontFace
4
, 0x%08x
\n
"
,
hr
);
return
hr
;
}
colorfont
=
IDWriteFontFace
3_IsColorFont
(
fontface3
)
&&
IDWriteFontFace3
_GetColorPaletteCount
(
fontface3
)
>
palette
;
colorfont
=
IDWriteFontFace
4_IsColorFont
(
fontface3
)
&&
IDWriteFontFace4
_GetColorPaletteCount
(
fontface3
)
>
palette
;
if
(
!
colorfont
)
{
hr
=
DWRITE_E_NOCOLOR
;
goto
failed
;
...
...
@@ -5472,14 +5506,14 @@ HRESULT create_colorglyphenum(FLOAT originX, FLOAT originY, const DWRITE_GLYPH_R
switch
(
measuring_mode
)
{
case
DWRITE_MEASURING_MODE_NATURAL
:
hr
=
IDWriteFontFace
3
_GetDesignGlyphAdvances
(
fontface3
,
1
,
run
->
glyphIndices
+
i
,
&
a
,
run
->
isSideways
);
hr
=
IDWriteFontFace
4
_GetDesignGlyphAdvances
(
fontface3
,
1
,
run
->
glyphIndices
+
i
,
&
a
,
run
->
isSideways
);
if
(
FAILED
(
hr
))
a
=
0
;
colorglyphenum
->
advances
[
i
]
=
get_scaled_advance_width
(
a
,
run
->
fontEmSize
,
&
metrics
);
break
;
case
DWRITE_MEASURING_MODE_GDI_CLASSIC
:
case
DWRITE_MEASURING_MODE_GDI_NATURAL
:
hr
=
IDWriteFontFace
3
_GetGdiCompatibleGlyphAdvances
(
fontface3
,
run
->
fontEmSize
,
1
.
0
f
,
transform
,
hr
=
IDWriteFontFace
4
_GetGdiCompatibleGlyphAdvances
(
fontface3
,
run
->
fontEmSize
,
1
.
0
f
,
transform
,
measuring_mode
==
DWRITE_MEASURING_MODE_GDI_NATURAL
,
run
->
isSideways
,
1
,
run
->
glyphIndices
+
i
,
&
a
);
if
(
FAILED
(
hr
))
colorglyphenum
->
advances
[
i
]
=
0
.
0
f
;
...
...
@@ -5496,7 +5530,7 @@ HRESULT create_colorglyphenum(FLOAT originX, FLOAT originY, const DWRITE_GLYPH_R
return
S_OK
;
failed:
IDWriteFontFace
3
_Release
(
fontface3
);
IDWriteFontFace
4
_Release
(
fontface3
);
return
hr
;
}
...
...
@@ -5570,7 +5604,7 @@ static HRESULT WINAPI fontfacereference_CreateFontFaceWithSimulations(IDWriteFon
hr
=
IDWriteFactory4_CreateFontFace
(
This
->
factory
,
face_type
,
1
,
&
This
->
file
,
This
->
index
,
simulations
,
&
fontface
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IDWriteFontFace_QueryInterface
(
fontface
,
&
IID_IDWriteFontFace
3
,
(
void
**
)
ret
);
hr
=
IDWriteFontFace_QueryInterface
(
fontface
,
&
IID_IDWriteFontFace
4
,
(
void
**
)
ret
);
IDWriteFontFace_Release
(
fontface
);
}
...
...
dlls/dwrite/freetype.c
View file @
9bf1114d
...
...
@@ -222,14 +222,14 @@ void release_freetype(void)
pFT_Done_FreeType
(
library
);
}
void
freetype_notify_cacheremove
(
IDWriteFontFace
3
*
fontface
)
void
freetype_notify_cacheremove
(
IDWriteFontFace
4
*
fontface
)
{
EnterCriticalSection
(
&
freetype_cs
);
pFTC_Manager_RemoveFaceID
(
cache_manager
,
fontface
);
LeaveCriticalSection
(
&
freetype_cs
);
}
HRESULT
freetype_get_design_glyph_metrics
(
IDWriteFontFace
3
*
fontface
,
UINT16
unitsperEm
,
UINT16
glyph
,
DWRITE_GLYPH_METRICS
*
ret
)
HRESULT
freetype_get_design_glyph_metrics
(
IDWriteFontFace
4
*
fontface
,
UINT16
unitsperEm
,
UINT16
glyph
,
DWRITE_GLYPH_METRICS
*
ret
)
{
FTC_ScalerRec
scaler
;
FT_Size
size
;
...
...
@@ -260,7 +260,7 @@ HRESULT freetype_get_design_glyph_metrics(IDWriteFontFace3 *fontface, UINT16 uni
return
S_OK
;
}
BOOL
freetype_is_monospaced
(
IDWriteFontFace
3
*
fontface
)
BOOL
freetype_is_monospaced
(
IDWriteFontFace
4
*
fontface
)
{
BOOL
is_monospaced
=
FALSE
;
FT_Face
face
;
...
...
@@ -417,7 +417,7 @@ static void decompose_outline(FT_Outline *outline, FLOAT xoffset, FLOAT yoffset,
ID2D1SimplifiedGeometrySink_EndFigure
(
sink
,
D2D1_FIGURE_END_CLOSED
);
}
HRESULT
freetype_get_glyphrun_outline
(
IDWriteFontFace
3
*
fontface
,
FLOAT
emSize
,
UINT16
const
*
glyphs
,
FLOAT
const
*
advances
,
HRESULT
freetype_get_glyphrun_outline
(
IDWriteFontFace
4
*
fontface
,
FLOAT
emSize
,
UINT16
const
*
glyphs
,
FLOAT
const
*
advances
,
DWRITE_GLYPH_OFFSET
const
*
offsets
,
UINT32
count
,
BOOL
is_rtl
,
IDWriteGeometrySink
*
sink
)
{
FTC_ScalerRec
scaler
;
...
...
@@ -430,7 +430,7 @@ HRESULT freetype_get_glyphrun_outline(IDWriteFontFace3 *fontface, FLOAT emSize,
ID2D1SimplifiedGeometrySink_SetFillMode
(
sink
,
D2D1_FILL_MODE_WINDING
);
simulations
=
IDWriteFontFace
3
_GetSimulations
(
fontface
);
simulations
=
IDWriteFontFace
4
_GetSimulations
(
fontface
);
scaler
.
face_id
=
fontface
;
scaler
.
width
=
emSize
;
...
...
@@ -485,7 +485,7 @@ HRESULT freetype_get_glyphrun_outline(IDWriteFontFace3 *fontface, FLOAT emSize,
return
hr
;
}
UINT16
freetype_get_glyphcount
(
IDWriteFontFace
3
*
fontface
)
UINT16
freetype_get_glyphcount
(
IDWriteFontFace
4
*
fontface
)
{
UINT16
count
=
0
;
FT_Face
face
;
...
...
@@ -498,7 +498,7 @@ UINT16 freetype_get_glyphcount(IDWriteFontFace3 *fontface)
return
count
;
}
void
freetype_get_glyphs
(
IDWriteFontFace
3
*
fontface
,
INT
charmap
,
UINT32
const
*
codepoints
,
UINT32
count
,
void
freetype_get_glyphs
(
IDWriteFontFace
4
*
fontface
,
INT
charmap
,
UINT32
const
*
codepoints
,
UINT32
count
,
UINT16
*
glyphs
)
{
UINT32
i
;
...
...
@@ -519,7 +519,7 @@ void freetype_get_glyphs(IDWriteFontFace3 *fontface, INT charmap, UINT32 const *
LeaveCriticalSection
(
&
freetype_cs
);
}
BOOL
freetype_has_kerning_pairs
(
IDWriteFontFace
3
*
fontface
)
BOOL
freetype_has_kerning_pairs
(
IDWriteFontFace
4
*
fontface
)
{
BOOL
has_kerning_pairs
=
FALSE
;
FT_Face
face
;
...
...
@@ -532,7 +532,7 @@ BOOL freetype_has_kerning_pairs(IDWriteFontFace3 *fontface)
return
has_kerning_pairs
;
}
INT32
freetype_get_kerning_pair_adjustment
(
IDWriteFontFace
3
*
fontface
,
UINT16
left
,
UINT16
right
)
INT32
freetype_get_kerning_pair_adjustment
(
IDWriteFontFace
4
*
fontface
,
UINT16
left
,
UINT16
right
)
{
INT32
adjustment
=
0
;
FT_Face
face
;
...
...
@@ -559,7 +559,7 @@ static inline void ft_matrix_from_dwrite_matrix(const DWRITE_MATRIX *m, FT_Matri
}
/* Should be used only while holding 'freetype_cs' */
static
BOOL
is_face_scalable
(
IDWriteFontFace
3
*
fontface
)
static
BOOL
is_face_scalable
(
IDWriteFontFace
4
*
fontface
)
{
FT_Face
face
;
if
(
pFTC_Manager_LookupFace
(
cache_manager
,
fontface
,
&
face
)
==
0
)
...
...
@@ -749,7 +749,7 @@ BOOL freetype_get_glyph_bitmap(struct dwrite_glyphbitmap *bitmap)
return
ret
;
}
INT
freetype_get_charmap_index
(
IDWriteFontFace
3
*
fontface
,
BOOL
*
is_symbol
)
INT
freetype_get_charmap_index
(
IDWriteFontFace
4
*
fontface
,
BOOL
*
is_symbol
)
{
INT
charmap_index
=
-
1
;
FT_Face
face
;
...
...
@@ -781,7 +781,7 @@ INT freetype_get_charmap_index(IDWriteFontFace3 *fontface, BOOL *is_symbol)
return
charmap_index
;
}
INT32
freetype_get_glyph_advance
(
IDWriteFontFace
3
*
fontface
,
FLOAT
emSize
,
UINT16
index
,
DWRITE_MEASURING_MODE
mode
)
INT32
freetype_get_glyph_advance
(
IDWriteFontFace
4
*
fontface
,
FLOAT
emSize
,
UINT16
index
,
DWRITE_MEASURING_MODE
mode
)
{
FTC_ImageTypeRec
imagetype
;
FT_Glyph
glyph
;
...
...
@@ -815,43 +815,43 @@ void release_freetype(void)
{
}
void
freetype_notify_cacheremove
(
IDWriteFontFace
3
*
fontface
)
void
freetype_notify_cacheremove
(
IDWriteFontFace
4
*
fontface
)
{
}
HRESULT
freetype_get_design_glyph_metrics
(
IDWriteFontFace
3
*
fontface
,
UINT16
unitsperEm
,
UINT16
glyph
,
DWRITE_GLYPH_METRICS
*
ret
)
HRESULT
freetype_get_design_glyph_metrics
(
IDWriteFontFace
4
*
fontface
,
UINT16
unitsperEm
,
UINT16
glyph
,
DWRITE_GLYPH_METRICS
*
ret
)
{
return
E_NOTIMPL
;
}
BOOL
freetype_is_monospaced
(
IDWriteFontFace
3
*
fontface
)
BOOL
freetype_is_monospaced
(
IDWriteFontFace
4
*
fontface
)
{
return
FALSE
;
}
HRESULT
freetype_get_glyphrun_outline
(
IDWriteFontFace
3
*
fontface
,
FLOAT
emSize
,
UINT16
const
*
glyphs
,
FLOAT
const
*
advances
,
HRESULT
freetype_get_glyphrun_outline
(
IDWriteFontFace
4
*
fontface
,
FLOAT
emSize
,
UINT16
const
*
glyphs
,
FLOAT
const
*
advances
,
DWRITE_GLYPH_OFFSET
const
*
offsets
,
UINT32
count
,
BOOL
is_rtl
,
IDWriteGeometrySink
*
sink
)
{
return
E_NOTIMPL
;
}
UINT16
freetype_get_glyphcount
(
IDWriteFontFace
3
*
fontface
)
UINT16
freetype_get_glyphcount
(
IDWriteFontFace
4
*
fontface
)
{
return
0
;
}
void
freetype_get_glyphs
(
IDWriteFontFace
3
*
fontface
,
INT
charmap
,
UINT32
const
*
codepoints
,
UINT32
count
,
void
freetype_get_glyphs
(
IDWriteFontFace
4
*
fontface
,
INT
charmap
,
UINT32
const
*
codepoints
,
UINT32
count
,
UINT16
*
glyphs
)
{
memset
(
glyphs
,
0
,
count
*
sizeof
(
*
glyphs
));
}
BOOL
freetype_has_kerning_pairs
(
IDWriteFontFace
3
*
fontface
)
BOOL
freetype_has_kerning_pairs
(
IDWriteFontFace
4
*
fontface
)
{
return
FALSE
;
}
INT32
freetype_get_kerning_pair_adjustment
(
IDWriteFontFace
3
*
fontface
,
UINT16
left
,
UINT16
right
)
INT32
freetype_get_kerning_pair_adjustment
(
IDWriteFontFace
4
*
fontface
,
UINT16
left
,
UINT16
right
)
{
return
0
;
}
...
...
@@ -866,13 +866,13 @@ BOOL freetype_get_glyph_bitmap(struct dwrite_glyphbitmap *bitmap)
return
FALSE
;
}
INT
freetype_get_charmap_index
(
IDWriteFontFace
3
*
fontface
,
BOOL
*
is_symbol
)
INT
freetype_get_charmap_index
(
IDWriteFontFace
4
*
fontface
,
BOOL
*
is_symbol
)
{
*
is_symbol
=
FALSE
;
return
-
1
;
}
INT32
freetype_get_glyph_advance
(
IDWriteFontFace
3
*
fontface
,
FLOAT
emSize
,
UINT16
index
,
DWRITE_MEASURING_MODE
mode
)
INT32
freetype_get_glyph_advance
(
IDWriteFontFace
4
*
fontface
,
FLOAT
emSize
,
UINT16
index
,
DWRITE_MEASURING_MODE
mode
)
{
return
0
;
}
...
...
dlls/dwrite/main.c
View file @
9bf1114d
...
...
@@ -508,7 +508,7 @@ struct collectionloader
struct
fontfacecached
{
struct
list
entry
;
IDWriteFontFace
3
*
fontface
;
IDWriteFontFace
4
*
fontface
;
};
struct
fileloader
...
...
@@ -544,7 +544,7 @@ static void release_fontface_cache(struct list *fontfaces)
struct
fontfacecached
*
fontface
,
*
fontface2
;
LIST_FOR_EACH_ENTRY_SAFE
(
fontface
,
fontface2
,
fontfaces
,
struct
fontfacecached
,
entry
)
{
list_remove
(
&
fontface
->
entry
);
IDWriteFontFace
3
_Release
(
fontface
->
fontface
);
IDWriteFontFace
4
_Release
(
fontface
->
fontface
);
heap_free
(
fontface
);
}
}
...
...
@@ -835,14 +835,14 @@ HRESULT factory_get_cached_fontface(IDWriteFactory4 *iface, IDWriteFontFile * co
const
void
*
cached_key
;
IDWriteFontFile
*
file
;
cached_face_index
=
IDWriteFontFace
3
_GetIndex
(
cached
->
fontface
);
cached_simulations
=
IDWriteFontFace
3
_GetSimulations
(
cached
->
fontface
);
cached_face_index
=
IDWriteFontFace
4
_GetIndex
(
cached
->
fontface
);
cached_simulations
=
IDWriteFontFace
4
_GetSimulations
(
cached
->
fontface
);
/* skip earlier */
if
(
cached_face_index
!=
index
||
cached_simulations
!=
simulations
)
continue
;
hr
=
IDWriteFontFace
3
_GetFiles
(
cached
->
fontface
,
&
count
,
&
file
);
hr
=
IDWriteFontFace
4
_GetFiles
(
cached
->
fontface
,
&
count
,
&
file
);
if
(
FAILED
(
hr
))
return
hr
;
...
...
@@ -861,7 +861,7 @@ HRESULT factory_get_cached_fontface(IDWriteFactory4 *iface, IDWriteFontFile * co
return
S_FALSE
;
}
void
factory_cache_fontface
(
struct
list
*
fontfaces
,
IDWriteFontFace
3
*
fontface
)
void
factory_cache_fontface
(
struct
list
*
fontfaces
,
IDWriteFontFace
4
*
fontface
)
{
struct
fontfacecached
*
cached
;
...
...
@@ -883,7 +883,7 @@ static HRESULT WINAPI dwritefactory_CreateFontFace(IDWriteFactory4 *iface,
DWRITE_FONT_FACE_TYPE
face_type
;
struct
fontface_desc
desc
;
struct
list
*
fontfaces
;
IDWriteFontFace
3
*
face
;
IDWriteFontFace
4
*
face
;
BOOL
is_supported
;
UINT32
count
;
HRESULT
hr
;
...
...
dlls/dwrite/opentype.c
View file @
9bf1114d
...
...
@@ -1932,7 +1932,7 @@ HRESULT opentype_get_font_signature(struct file_stream_desc *stream_desc, FONTSI
return
hr
;
}
BOOL
opentype_has_vertical_variants
(
IDWriteFontFace
3
*
fontface
)
BOOL
opentype_has_vertical_variants
(
IDWriteFontFace
4
*
fontface
)
{
const
OT_FeatureList
*
featurelist
;
const
OT_LookupList
*
lookup_list
;
...
...
@@ -1944,7 +1944,7 @@ BOOL opentype_has_vertical_variants(IDWriteFontFace3 *fontface)
HRESULT
hr
;
UINT16
i
;
hr
=
IDWriteFontFace
3
_TryGetFontTable
(
fontface
,
MS_GSUB_TAG
,
&
data
,
&
size
,
&
context
,
&
exists
);
hr
=
IDWriteFontFace
4
_TryGetFontTable
(
fontface
,
MS_GSUB_TAG
,
&
data
,
&
size
,
&
context
,
&
exists
);
if
(
FAILED
(
hr
)
||
!
exists
)
return
FALSE
;
...
...
@@ -2002,7 +2002,7 @@ BOOL opentype_has_vertical_variants(IDWriteFontFace3 *fontface)
}
}
IDWriteFontFace
3
_ReleaseFontTable
(
fontface
,
context
);
IDWriteFontFace
4
_ReleaseFontTable
(
fontface
,
context
);
return
ret
;
}
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