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
d04a5485
Commit
d04a5485
authored
Mar 28, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 28, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Update to IDWriteFactory3.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7c6dcab7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
253 additions
and
141 deletions
+253
-141
analyzer.c
dlls/dwrite/analyzer.c
+5
-5
dwrite_private.h
dlls/dwrite/dwrite_private.h
+8
-8
font.c
dlls/dwrite/font.c
+18
-18
gdiinterop.c
dlls/dwrite/gdiinterop.c
+7
-7
layout.c
dlls/dwrite/layout.c
+9
-9
main.c
dlls/dwrite/main.c
+204
-93
font.c
dlls/dwrite/tests/font.c
+2
-1
No files found.
dlls/dwrite/analyzer.c
View file @
d04a5485
...
...
@@ -198,7 +198,7 @@ static const struct fallback_mapping fontfallback_neutral_data[] = {
struct
dwrite_fontfallback
{
IDWriteFontFallback
IDWriteFontFallback_iface
;
IDWriteFactory
2
*
factory
;
IDWriteFactory
3
*
factory
;
IDWriteFontCollection
*
systemcollection
;
const
struct
fallback_mapping
*
mappings
;
UINT32
count
;
...
...
@@ -1748,14 +1748,14 @@ static ULONG WINAPI fontfallback_AddRef(IDWriteFontFallback *iface)
{
struct
dwrite_fontfallback
*
fallback
=
impl_from_IDWriteFontFallback
(
iface
);
TRACE
(
"(%p)
\n
"
,
fallback
);
return
IDWriteFactory
2
_AddRef
(
fallback
->
factory
);
return
IDWriteFactory
3
_AddRef
(
fallback
->
factory
);
}
static
ULONG
WINAPI
fontfallback_Release
(
IDWriteFontFallback
*
iface
)
{
struct
dwrite_fontfallback
*
fallback
=
impl_from_IDWriteFontFallback
(
iface
);
TRACE
(
"(%p)
\n
"
,
fallback
);
return
IDWriteFactory
2
_Release
(
fallback
->
factory
);
return
IDWriteFactory
3
_Release
(
fallback
->
factory
);
}
static
int
compare_fallback_mapping
(
const
void
*
a
,
const
void
*
b
)
...
...
@@ -1931,7 +1931,7 @@ static const IDWriteFontFallbackVtbl fontfallbackvtbl = {
fontfallback_MapCharacters
};
HRESULT
create_system_fontfallback
(
IDWriteFactory
2
*
factory
,
IDWriteFontFallback
**
ret
)
HRESULT
create_system_fontfallback
(
IDWriteFactory
3
*
factory
,
IDWriteFontFallback
**
ret
)
{
struct
dwrite_fontfallback
*
fallback
;
...
...
@@ -1945,7 +1945,7 @@ HRESULT create_system_fontfallback(IDWriteFactory2 *factory, IDWriteFontFallback
fallback
->
factory
=
factory
;
fallback
->
mappings
=
fontfallback_neutral_data
;
fallback
->
count
=
sizeof
(
fontfallback_neutral_data
)
/
sizeof
(
fontfallback_neutral_data
[
0
]);
IDWriteFactory2_GetSystemFontCollection
(
fallback
->
factory
,
&
fallback
->
systemcollection
,
FALSE
);
IDWriteFactory2_GetSystemFontCollection
(
(
IDWriteFactory2
*
)
fallback
->
factory
,
&
fallback
->
systemcollection
,
FALSE
);
*
ret
=
&
fallback
->
IDWriteFontFallback_iface
;
return
S_OK
;
...
...
dlls/dwrite/dwrite_private.h
View file @
d04a5485
...
...
@@ -115,24 +115,24 @@ extern HRESULT convert_fontface_to_logfont(IDWriteFontFace*, LOGFONTW*) DECLSPEC
extern
HRESULT
create_numbersubstitution
(
DWRITE_NUMBER_SUBSTITUTION_METHOD
,
const
WCHAR
*
locale
,
BOOL
,
IDWriteNumberSubstitution
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_textformat
(
const
WCHAR
*
,
IDWriteFontCollection
*
,
DWRITE_FONT_WEIGHT
,
DWRITE_FONT_STYLE
,
DWRITE_FONT_STRETCH
,
FLOAT
,
const
WCHAR
*
,
IDWriteTextFormat
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_textlayout
(
IDWriteFactory
2
*
,
const
WCHAR
*
,
UINT32
,
IDWriteTextFormat
*
,
FLOAT
,
FLOAT
,
IDWriteTextLayout
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_gdicompat_textlayout
(
IDWriteFactory
2
*
,
const
WCHAR
*
,
UINT32
,
IDWriteTextFormat
*
,
FLOAT
,
FLOAT
,
FLOAT
,
extern
HRESULT
create_textlayout
(
IDWriteFactory
3
*
,
const
WCHAR
*
,
UINT32
,
IDWriteTextFormat
*
,
FLOAT
,
FLOAT
,
IDWriteTextLayout
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_gdicompat_textlayout
(
IDWriteFactory
3
*
,
const
WCHAR
*
,
UINT32
,
IDWriteTextFormat
*
,
FLOAT
,
FLOAT
,
FLOAT
,
const
DWRITE_MATRIX
*
,
BOOL
,
IDWriteTextLayout
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_trimmingsign
(
IDWriteFactory
2
*
,
IDWriteTextFormat
*
,
IDWriteInlineObject
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_trimmingsign
(
IDWriteFactory
3
*
,
IDWriteTextFormat
*
,
IDWriteInlineObject
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_typography
(
IDWriteTypography
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_gdiinterop
(
IDWriteFactory
2
*
,
IDWriteGdiInterop
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_gdiinterop
(
IDWriteFactory
3
*
,
IDWriteGdiInterop
**
)
DECLSPEC_HIDDEN
;
extern
void
release_gdiinterop
(
IDWriteGdiInterop
*
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_localizedstrings
(
IDWriteLocalizedStrings
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
add_localizedstring
(
IDWriteLocalizedStrings
*
,
const
WCHAR
*
,
const
WCHAR
*
)
DECLSPEC_HIDDEN
;
extern
HRESULT
clone_localizedstring
(
IDWriteLocalizedStrings
*
iface
,
IDWriteLocalizedStrings
**
strings
)
DECLSPEC_HIDDEN
;
extern
void
set_en_localizedstring
(
IDWriteLocalizedStrings
*
,
const
WCHAR
*
)
DECLSPEC_HIDDEN
;
extern
HRESULT
get_system_fontcollection
(
IDWriteFactory
2
*
,
IDWriteFontCollection
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
get_eudc_fontcollection
(
IDWriteFactory
2
*
,
IDWriteFontCollection
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
get_system_fontcollection
(
IDWriteFactory
3
*
,
IDWriteFontCollection
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
get_eudc_fontcollection
(
IDWriteFactory
3
*
,
IDWriteFontCollection
**
)
DECLSPEC_HIDDEN
;
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
(
DWRITE_FONT_FACE_TYPE
,
UINT32
,
IDWriteFontFile
*
const
*
,
UINT32
,
DWRITE_FONT_SIMULATIONS
,
IDWriteFontFace3
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_font_collection
(
IDWriteFactory
2
*
,
IDWriteFontFileEnumerator
*
,
BOOL
,
IDWriteFontCollection
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_font_collection
(
IDWriteFactory
3
*
,
IDWriteFontFileEnumerator
*
,
BOOL
,
IDWriteFontCollection
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_glyphrunanalysis
(
DWRITE_RENDERING_MODE
,
DWRITE_MEASURING_MODE
,
DWRITE_GLYPH_RUN
const
*
,
FLOAT
,
const
DWRITE_MATRIX
*
,
DWRITE_GRID_FIT_MODE
,
DWRITE_TEXT_ANTIALIAS_MODE
,
FLOAT
,
FLOAT
,
IDWriteGlyphRunAnalysis
**
)
DECLSPEC_HIDDEN
;
extern
BOOL
is_system_collection
(
IDWriteFontCollection
*
)
DECLSPEC_HIDDEN
;
...
...
@@ -143,7 +143,7 @@ extern HRESULT get_family_names_from_stream(IDWriteFontFileStream*,UINT32,DWRITE
extern
HRESULT
create_colorglyphenum
(
FLOAT
,
FLOAT
,
const
DWRITE_GLYPH_RUN
*
,
const
DWRITE_GLYPH_RUN_DESCRIPTION
*
,
DWRITE_MEASURING_MODE
,
const
DWRITE_MATRIX
*
,
UINT32
,
IDWriteColorGlyphRunEnumerator
**
)
DECLSPEC_HIDDEN
;
extern
BOOL
lb_is_newline_char
(
WCHAR
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_system_fontfallback
(
IDWriteFactory
2
*
,
IDWriteFontFallback
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_system_fontfallback
(
IDWriteFactory
3
*
,
IDWriteFontFallback
**
)
DECLSPEC_HIDDEN
;
extern
void
release_system_fontfallback
(
IDWriteFontFallback
*
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_matching_font
(
IDWriteFontCollection
*
,
const
WCHAR
*
,
DWRITE_FONT_WEIGHT
,
DWRITE_FONT_STYLE
,
DWRITE_FONT_STRETCH
,
IDWriteFont
**
)
DECLSPEC_HIDDEN
;
...
...
dlls/dwrite/font.c
View file @
d04a5485
...
...
@@ -82,7 +82,7 @@ struct dwrite_font_data {
IDWriteLocalizedStrings
*
names
;
/* data needed to create fontface instance */
IDWriteFactory
2
*
factory
;
IDWriteFactory
3
*
factory
;
DWRITE_FONT_FACE_TYPE
face_type
;
IDWriteFontFile
*
file
;
UINT32
face_index
;
...
...
@@ -390,7 +390,7 @@ static void release_font_data(struct dwrite_font_data *data)
IDWriteLocalizedStrings_Release
(
data
->
names
);
IDWriteFontFile_Release
(
data
->
file
);
IDWriteFactory
2
_Release
(
data
->
factory
);
IDWriteFactory
3
_Release
(
data
->
factory
);
heap_free
(
data
->
facename
);
heap_free
(
data
);
}
...
...
@@ -1211,7 +1211,7 @@ static HRESULT get_fontface_from_font(struct dwrite_font *font, IDWriteFontFace3
*
fontface
=
NULL
;
hr
=
IDWriteFactory
2
_CreateFontFace
(
data
->
factory
,
data
->
face_type
,
1
,
&
data
->
file
,
hr
=
IDWriteFactory
3
_CreateFontFace
(
data
->
factory
,
data
->
face_type
,
1
,
&
data
->
file
,
data
->
face_index
,
font
->
data
->
simulations
,
&
face
);
if
(
FAILED
(
hr
))
return
hr
;
...
...
@@ -3022,7 +3022,7 @@ static BOOL font_apply_differentiation_rules(struct dwrite_font_data *font, WCHA
return
TRUE
;
}
static
HRESULT
init_font_data
(
IDWriteFactory
2
*
factory
,
IDWriteFontFile
*
file
,
DWRITE_FONT_FACE_TYPE
face_type
,
UINT32
face_index
,
static
HRESULT
init_font_data
(
IDWriteFactory
3
*
factory
,
IDWriteFontFile
*
file
,
DWRITE_FONT_FACE_TYPE
face_type
,
UINT32
face_index
,
IDWriteLocalizedStrings
**
family_name
,
struct
dwrite_font_data
**
ret
)
{
struct
dwrite_font_props
props
;
...
...
@@ -3051,7 +3051,7 @@ static HRESULT init_font_data(IDWriteFactory2 *factory, IDWriteFontFile *file, D
data
->
bold_sim_tested
=
0
;
data
->
oblique_sim_tested
=
0
;
IDWriteFontFile_AddRef
(
file
);
IDWriteFactory
2
_AddRef
(
factory
);
IDWriteFactory
3
_AddRef
(
factory
);
opentype_get_font_properties
(
stream
,
face_type
,
face_index
,
&
props
);
opentype_get_font_metrics
(
stream
,
face_type
,
face_index
,
&
data
->
metrics
,
NULL
);
...
...
@@ -3103,7 +3103,7 @@ static HRESULT init_font_data_from_font(const struct dwrite_font_data *src, DWRI
data
->
style
=
DWRITE_FONT_STYLE_OBLIQUE
;
memset
(
data
->
info_strings
,
0
,
sizeof
(
data
->
info_strings
));
data
->
names
=
NULL
;
IDWriteFactory
2
_AddRef
(
data
->
factory
);
IDWriteFactory
3
_AddRef
(
data
->
factory
);
IDWriteFontFile_AddRef
(
data
->
file
);
create_localizedstrings
(
&
data
->
names
);
...
...
@@ -3359,7 +3359,7 @@ static void fontcollection_add_replacements(struct dwrite_fontcollection *collec
RegCloseKey
(
hkey
);
}
HRESULT
create_font_collection
(
IDWriteFactory
2
*
factory
,
IDWriteFontFileEnumerator
*
enumerator
,
BOOL
is_system
,
IDWriteFontCollection
**
ret
)
HRESULT
create_font_collection
(
IDWriteFactory
3
*
factory
,
IDWriteFontFileEnumerator
*
enumerator
,
BOOL
is_system
,
IDWriteFontCollection
**
ret
)
{
struct
fontfile_enum
{
struct
list
entry
;
...
...
@@ -3493,7 +3493,7 @@ struct system_fontfile_enumerator
IDWriteFontFileEnumerator
IDWriteFontFileEnumerator_iface
;
LONG
ref
;
IDWriteFactory
2
*
factory
;
IDWriteFactory
3
*
factory
;
HKEY
hkey
;
int
index
;
};
...
...
@@ -3528,7 +3528,7 @@ static ULONG WINAPI systemfontfileenumerator_Release(IDWriteFontFileEnumerator *
ULONG
ref
=
InterlockedDecrement
(
&
enumerator
->
ref
);
if
(
!
ref
)
{
IDWriteFactory
2
_Release
(
enumerator
->
factory
);
IDWriteFactory
3
_Release
(
enumerator
->
factory
);
RegCloseKey
(
enumerator
->
hkey
);
heap_free
(
enumerator
);
}
...
...
@@ -3536,7 +3536,7 @@ static ULONG WINAPI systemfontfileenumerator_Release(IDWriteFontFileEnumerator *
return
ref
;
}
static
HRESULT
create_local_file_reference
(
IDWriteFactory
2
*
factory
,
const
WCHAR
*
filename
,
IDWriteFontFile
**
file
)
static
HRESULT
create_local_file_reference
(
IDWriteFactory
3
*
factory
,
const
WCHAR
*
filename
,
IDWriteFontFile
**
file
)
{
HRESULT
hr
;
...
...
@@ -3549,10 +3549,10 @@ static HRESULT create_local_file_reference(IDWriteFactory2 *factory, const WCHAR
strcatW
(
fullpathW
,
fontsW
);
strcatW
(
fullpathW
,
filename
);
hr
=
IDWriteFactory
2
_CreateFontFileReference
(
factory
,
fullpathW
,
NULL
,
file
);
hr
=
IDWriteFactory
3
_CreateFontFileReference
(
factory
,
fullpathW
,
NULL
,
file
);
}
else
hr
=
IDWriteFactory
2
_CreateFontFileReference
(
factory
,
filename
,
NULL
,
file
);
hr
=
IDWriteFactory
3
_CreateFontFileReference
(
factory
,
filename
,
NULL
,
file
);
return
hr
;
}
...
...
@@ -3640,7 +3640,7 @@ static const struct IDWriteFontFileEnumeratorVtbl systemfontfileenumeratorvtbl =
systemfontfileenumerator_GetCurrentFontFile
};
static
HRESULT
create_system_fontfile_enumerator
(
IDWriteFactory
2
*
factory
,
IDWriteFontFileEnumerator
**
ret
)
static
HRESULT
create_system_fontfile_enumerator
(
IDWriteFactory
3
*
factory
,
IDWriteFontFileEnumerator
**
ret
)
{
struct
system_fontfile_enumerator
*
enumerator
;
static
const
WCHAR
fontslistW
[]
=
{
...
...
@@ -3659,11 +3659,11 @@ static HRESULT create_system_fontfile_enumerator(IDWriteFactory2 *factory, IDWri
enumerator
->
ref
=
1
;
enumerator
->
factory
=
factory
;
enumerator
->
index
=
-
1
;
IDWriteFactory
2
_AddRef
(
factory
);
IDWriteFactory
3
_AddRef
(
factory
);
if
(
RegOpenKeyExW
(
HKEY_LOCAL_MACHINE
,
fontslistW
,
0
,
GENERIC_READ
,
&
enumerator
->
hkey
))
{
ERR
(
"failed to open fonts list key
\n
"
);
IDWriteFactory
2
_Release
(
factory
);
IDWriteFactory
3
_Release
(
factory
);
heap_free
(
enumerator
);
return
E_FAIL
;
}
...
...
@@ -3673,7 +3673,7 @@ static HRESULT create_system_fontfile_enumerator(IDWriteFactory2 *factory, IDWri
return
S_OK
;
}
HRESULT
get_system_fontcollection
(
IDWriteFactory
2
*
factory
,
IDWriteFontCollection
**
collection
)
HRESULT
get_system_fontcollection
(
IDWriteFactory
3
*
factory
,
IDWriteFontCollection
**
collection
)
{
IDWriteFontFileEnumerator
*
enumerator
;
HRESULT
hr
;
...
...
@@ -3690,7 +3690,7 @@ HRESULT get_system_fontcollection(IDWriteFactory2 *factory, IDWriteFontCollectio
return
hr
;
}
static
HRESULT
eudc_collection_add_family
(
IDWriteFactory
2
*
factory
,
struct
dwrite_fontcollection
*
collection
,
static
HRESULT
eudc_collection_add_family
(
IDWriteFactory
3
*
factory
,
struct
dwrite_fontcollection
*
collection
,
const
WCHAR
*
keynameW
,
const
WCHAR
*
pathW
)
{
static
const
WCHAR
defaultfontW
[]
=
{
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'D'
,
'e'
,
'f'
,
'a'
,
'u'
,
'l'
,
't'
,
'E'
,
'U'
,
'D'
,
'C'
,
'F'
,
'o'
,
'n'
,
't'
,
0
};
...
...
@@ -3760,7 +3760,7 @@ static HRESULT eudc_collection_add_family(IDWriteFactory2 *factory, struct dwrit
return
hr
;
}
HRESULT
get_eudc_fontcollection
(
IDWriteFactory
2
*
factory
,
IDWriteFontCollection
**
ret
)
HRESULT
get_eudc_fontcollection
(
IDWriteFactory
3
*
factory
,
IDWriteFontCollection
**
ret
)
{
static
const
WCHAR
eudckeyfmtW
[]
=
{
'E'
,
'U'
,
'D'
,
'C'
,
'\\'
,
'%'
,
'u'
,
0
};
struct
dwrite_fontcollection
*
collection
;
...
...
dlls/dwrite/gdiinterop.c
View file @
d04a5485
...
...
@@ -34,7 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dwrite);
struct
gdiinterop
{
IDWriteGdiInterop
IDWriteGdiInterop_iface
;
IDWriteFactory
2
*
factory
;
IDWriteFactory
3
*
factory
;
};
struct
dib_data
{
...
...
@@ -605,14 +605,14 @@ static ULONG WINAPI gdiinterop_AddRef(IDWriteGdiInterop *iface)
{
struct
gdiinterop
*
This
=
impl_from_IDWriteGdiInterop
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
IDWriteFactory
2
_AddRef
(
This
->
factory
);
return
IDWriteFactory
3
_AddRef
(
This
->
factory
);
}
static
ULONG
WINAPI
gdiinterop_Release
(
IDWriteGdiInterop
*
iface
)
{
struct
gdiinterop
*
This
=
impl_from_IDWriteGdiInterop
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
IDWriteFactory
2
_Release
(
This
->
factory
);
return
IDWriteFactory
3
_Release
(
This
->
factory
);
}
static
HRESULT
WINAPI
gdiinterop_CreateFontFromLOGFONT
(
IDWriteGdiInterop
*
iface
,
...
...
@@ -632,7 +632,7 @@ static HRESULT WINAPI gdiinterop_CreateFontFromLOGFONT(IDWriteGdiInterop *iface,
if
(
!
logfont
)
return
E_INVALIDARG
;
hr
=
IDWriteFactory2_GetSystemFontCollection
(
This
->
factory
,
&
collection
,
FALSE
);
hr
=
IDWriteFactory2_GetSystemFontCollection
(
(
IDWriteFactory2
*
)
This
->
factory
,
&
collection
,
FALSE
);
if
(
FAILED
(
hr
))
{
ERR
(
"failed to get system font collection: 0x%08x.
\n
"
,
hr
);
return
hr
;
...
...
@@ -847,7 +847,7 @@ static HRESULT WINAPI gdiinterop_CreateFontFaceFromHdc(IDWriteGdiInterop *iface,
return
E_FAIL
;
}
hr
=
IDWriteFactory
2
_CreateFontFileReference
(
This
->
factory
,
fileinfo
->
path
,
&
fileinfo
->
writetime
,
hr
=
IDWriteFactory
3
_CreateFontFileReference
(
This
->
factory
,
fileinfo
->
path
,
&
fileinfo
->
writetime
,
&
file
);
heap_free
(
fileinfo
);
if
(
FAILED
(
hr
))
...
...
@@ -861,7 +861,7 @@ static HRESULT WINAPI gdiinterop_CreateFontFaceFromHdc(IDWriteGdiInterop *iface,
}
/* Simulations flags values match DWRITE_FONT_SIMULATIONS */
hr
=
IDWriteFactory
2
_CreateFontFace
(
This
->
factory
,
facetype
,
1
,
&
file
,
info
.
face_index
,
info
.
simulations
,
hr
=
IDWriteFactory
3
_CreateFontFace
(
This
->
factory
,
facetype
,
1
,
&
file
,
info
.
face_index
,
info
.
simulations
,
fontface
);
IDWriteFontFile_Release
(
file
);
return
hr
;
...
...
@@ -886,7 +886,7 @@ static const struct IDWriteGdiInteropVtbl gdiinteropvtbl = {
gdiinterop_CreateBitmapRenderTarget
};
HRESULT
create_gdiinterop
(
IDWriteFactory
2
*
factory
,
IDWriteGdiInterop
**
ret
)
HRESULT
create_gdiinterop
(
IDWriteFactory
3
*
factory
,
IDWriteGdiInterop
**
ret
)
{
struct
gdiinterop
*
This
;
...
...
dlls/dwrite/layout.c
View file @
d04a5485
...
...
@@ -238,7 +238,7 @@ struct dwrite_textlayout {
IDWriteTextAnalysisSource1
IDWriteTextAnalysisSource1_iface
;
LONG
ref
;
IDWriteFactory
2
*
factory
;
IDWriteFactory
3
*
factory
;
WCHAR
*
str
;
UINT32
len
;
...
...
@@ -781,7 +781,7 @@ static HRESULT layout_compute_runs(struct dwrite_textlayout *layout)
IDWriteFontFallback_AddRef
(
fallback
);
}
else
{
hr
=
IDWriteFactory
2
_GetSystemFontFallback
(
layout
->
factory
,
&
fallback
);
hr
=
IDWriteFactory
3
_GetSystemFontFallback
(
layout
->
factory
,
&
fallback
);
if
(
FAILED
(
hr
))
return
hr
;
}
...
...
@@ -2599,7 +2599,7 @@ static ULONG WINAPI dwritetextlayout_Release(IDWriteTextLayout3 *iface)
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
IDWriteFactory
2
_Release
(
This
->
factory
);
IDWriteFactory
3
_Release
(
This
->
factory
);
free_layout_ranges_list
(
This
);
free_layout_eruns
(
This
);
free_layout_runs
(
This
);
...
...
@@ -4441,7 +4441,7 @@ static HRESULT layout_format_from_textformat(struct dwrite_textlayout *layout, I
return
IDWriteTextFormat_GetFontCollection
(
format
,
&
layout
->
format
.
collection
);
}
static
HRESULT
init_textlayout
(
IDWriteFactory
2
*
factory
,
const
WCHAR
*
str
,
UINT32
len
,
IDWriteTextFormat
*
format
,
static
HRESULT
init_textlayout
(
IDWriteFactory
3
*
factory
,
const
WCHAR
*
str
,
UINT32
len
,
IDWriteTextFormat
*
format
,
FLOAT
maxwidth
,
FLOAT
maxheight
,
struct
dwrite_textlayout
*
layout
)
{
struct
layout_range_header
*
range
,
*
strike
,
*
underline
,
*
effect
,
*
spacing
,
*
typography
;
...
...
@@ -4511,7 +4511,7 @@ static HRESULT init_textlayout(IDWriteFactory2 *factory, const WCHAR *str, UINT3
}
layout
->
factory
=
factory
;
IDWriteFactory
2
_AddRef
(
layout
->
factory
);
IDWriteFactory
3
_AddRef
(
layout
->
factory
);
list_add_head
(
&
layout
->
ranges
,
&
range
->
entry
);
list_add_head
(
&
layout
->
strike_ranges
,
&
strike
->
entry
);
list_add_head
(
&
layout
->
underline_ranges
,
&
underline
->
entry
);
...
...
@@ -4525,7 +4525,7 @@ fail:
return
hr
;
}
HRESULT
create_textlayout
(
IDWriteFactory
2
*
factory
,
const
WCHAR
*
str
,
UINT32
len
,
IDWriteTextFormat
*
format
,
HRESULT
create_textlayout
(
IDWriteFactory
3
*
factory
,
const
WCHAR
*
str
,
UINT32
len
,
IDWriteTextFormat
*
format
,
FLOAT
maxwidth
,
FLOAT
maxheight
,
IDWriteTextLayout
**
ret
)
{
struct
dwrite_textlayout
*
layout
;
...
...
@@ -4546,7 +4546,7 @@ HRESULT create_textlayout(IDWriteFactory2 *factory, const WCHAR *str, UINT32 len
return
hr
;
}
HRESULT
create_gdicompat_textlayout
(
IDWriteFactory
2
*
factory
,
const
WCHAR
*
str
,
UINT32
len
,
IDWriteTextFormat
*
format
,
HRESULT
create_gdicompat_textlayout
(
IDWriteFactory
3
*
factory
,
const
WCHAR
*
str
,
UINT32
len
,
IDWriteTextFormat
*
format
,
FLOAT
maxwidth
,
FLOAT
maxheight
,
FLOAT
ppdip
,
const
DWRITE_MATRIX
*
transform
,
BOOL
use_gdi_natural
,
IDWriteTextLayout
**
ret
)
{
struct
dwrite_textlayout
*
layout
;
...
...
@@ -4701,7 +4701,7 @@ static inline BOOL is_flow_direction_vert(DWRITE_FLOW_DIRECTION direction)
(
direction
==
DWRITE_FLOW_DIRECTION_BOTTOM_TO_TOP
);
}
HRESULT
create_trimmingsign
(
IDWriteFactory
2
*
factory
,
IDWriteTextFormat
*
format
,
IDWriteInlineObject
**
sign
)
HRESULT
create_trimmingsign
(
IDWriteFactory
3
*
factory
,
IDWriteTextFormat
*
format
,
IDWriteInlineObject
**
sign
)
{
static
const
WCHAR
ellipsisW
=
0x2026
;
struct
dwrite_trimmingsign
*
This
;
...
...
@@ -4727,7 +4727,7 @@ HRESULT create_trimmingsign(IDWriteFactory2 *factory, IDWriteTextFormat *format,
This
->
IDWriteInlineObject_iface
.
lpVtbl
=
&
dwritetrimmingsignvtbl
;
This
->
ref
=
1
;
hr
=
IDWriteFactory
2
_CreateTextLayout
(
factory
,
&
ellipsisW
,
1
,
format
,
0
.
0
f
,
0
.
0
f
,
&
This
->
layout
);
hr
=
IDWriteFactory
3
_CreateTextLayout
(
factory
,
&
ellipsisW
,
1
,
format
,
0
.
0
f
,
0
.
0
f
,
&
This
->
layout
);
if
(
FAILED
(
hr
))
{
heap_free
(
This
);
return
hr
;
...
...
dlls/dwrite/main.c
View file @
d04a5485
...
...
@@ -34,8 +34,8 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
dwrite
);
static
IDWriteFactory
2
*
shared_factory
;
static
void
release_shared_factory
(
IDWriteFactory
2
*
);
static
IDWriteFactory
3
*
shared_factory
;
static
void
release_shared_factory
(
IDWriteFactory
3
*
);
BOOL
WINAPI
DllMain
(
HINSTANCE
hinstDLL
,
DWORD
reason
,
LPVOID
reserved
)
{
...
...
@@ -506,7 +506,7 @@ struct fileloader
};
struct
dwritefactory
{
IDWriteFactory
2
IDWriteFactory2
_iface
;
IDWriteFactory
3
IDWriteFactory3
_iface
;
LONG
ref
;
IDWriteFontCollection
*
system_collection
;
...
...
@@ -521,14 +521,14 @@ struct dwritefactory {
struct
list
file_loaders
;
};
static
inline
struct
dwritefactory
*
impl_from_IDWriteFactory
2
(
IDWriteFactory2
*
iface
)
static
inline
struct
dwritefactory
*
impl_from_IDWriteFactory
3
(
IDWriteFactory3
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
dwritefactory
,
IDWriteFactory
2
_iface
);
return
CONTAINING_RECORD
(
iface
,
struct
dwritefactory
,
IDWriteFactory
3
_iface
);
}
void
notify_factory_fallback_removed
(
IDWriteFactory
2
*
iface
)
void
notify_factory_fallback_removed
(
IDWriteFactory
3
*
iface
)
{
struct
dwritefactory
*
factory
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
factory
=
impl_from_IDWriteFactory
3
(
iface
);
factory
->
fallback
=
NULL
;
}
...
...
@@ -579,11 +579,11 @@ static void release_dwritefactory(struct dwritefactory *factory)
heap_free
(
factory
);
}
static
void
release_shared_factory
(
IDWriteFactory
2
*
iface
)
static
void
release_shared_factory
(
IDWriteFactory
3
*
iface
)
{
struct
dwritefactory
*
factory
;
if
(
!
iface
)
return
;
factory
=
impl_from_IDWriteFactory
2
(
iface
);
factory
=
impl_from_IDWriteFactory
3
(
iface
);
release_dwritefactory
(
factory
);
}
...
...
@@ -615,19 +615,20 @@ static struct collectionloader *factory_get_collection_loader(struct dwritefacto
return
found
;
}
static
HRESULT
WINAPI
dwritefactory_QueryInterface
(
IDWriteFactory
2
*
iface
,
REFIID
riid
,
void
**
obj
)
static
HRESULT
WINAPI
dwritefactory_QueryInterface
(
IDWriteFactory
3
*
iface
,
REFIID
riid
,
void
**
obj
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
obj
);
if
(
IsEqualIID
(
riid
,
&
IID_IDWriteFactory2
)
||
if
(
IsEqualIID
(
riid
,
&
IID_IDWriteFactory3
)
||
IsEqualIID
(
riid
,
&
IID_IDWriteFactory2
)
||
IsEqualIID
(
riid
,
&
IID_IDWriteFactory1
)
||
IsEqualIID
(
riid
,
&
IID_IDWriteFactory
)
||
IsEqualIID
(
riid
,
&
IID_IUnknown
))
{
*
obj
=
iface
;
IDWriteFactory
2
_AddRef
(
iface
);
IDWriteFactory
3
_AddRef
(
iface
);
return
S_OK
;
}
...
...
@@ -636,17 +637,17 @@ static HRESULT WINAPI dwritefactory_QueryInterface(IDWriteFactory2 *iface, REFII
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
dwritefactory_AddRef
(
IDWriteFactory
2
*
iface
)
static
ULONG
WINAPI
dwritefactory_AddRef
(
IDWriteFactory
3
*
iface
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
dwritefactory_Release
(
IDWriteFactory
2
*
iface
)
static
ULONG
WINAPI
dwritefactory_Release
(
IDWriteFactory
3
*
iface
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
ref
);
...
...
@@ -657,11 +658,11 @@ static ULONG WINAPI dwritefactory_Release(IDWriteFactory2 *iface)
return
ref
;
}
static
HRESULT
WINAPI
dwritefactory_GetSystemFontCollection
(
IDWriteFactory
2
*
iface
,
static
HRESULT
WINAPI
dwritefactory_GetSystemFontCollection
(
IDWriteFactory
3
*
iface
,
IDWriteFontCollection
**
collection
,
BOOL
check_for_updates
)
{
HRESULT
hr
=
S_OK
;
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
TRACE
(
"(%p)->(%p %d)
\n
"
,
This
,
collection
,
check_for_updates
);
if
(
check_for_updates
)
...
...
@@ -678,10 +679,10 @@ static HRESULT WINAPI dwritefactory_GetSystemFontCollection(IDWriteFactory2 *ifa
return
hr
;
}
static
HRESULT
WINAPI
dwritefactory_CreateCustomFontCollection
(
IDWriteFactory
2
*
iface
,
static
HRESULT
WINAPI
dwritefactory_CreateCustomFontCollection
(
IDWriteFactory
3
*
iface
,
IDWriteFontCollectionLoader
*
loader
,
void
const
*
key
,
UINT32
key_size
,
IDWriteFontCollection
**
collection
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
IDWriteFontFileEnumerator
*
enumerator
;
struct
collectionloader
*
found
;
HRESULT
hr
;
...
...
@@ -706,10 +707,10 @@ static HRESULT WINAPI dwritefactory_CreateCustomFontCollection(IDWriteFactory2 *
return
hr
;
}
static
HRESULT
WINAPI
dwritefactory_RegisterFontCollectionLoader
(
IDWriteFactory
2
*
iface
,
static
HRESULT
WINAPI
dwritefactory_RegisterFontCollectionLoader
(
IDWriteFactory
3
*
iface
,
IDWriteFontCollectionLoader
*
loader
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
struct
collectionloader
*
entry
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
loader
);
...
...
@@ -731,10 +732,10 @@ static HRESULT WINAPI dwritefactory_RegisterFontCollectionLoader(IDWriteFactory2
return
S_OK
;
}
static
HRESULT
WINAPI
dwritefactory_UnregisterFontCollectionLoader
(
IDWriteFactory
2
*
iface
,
static
HRESULT
WINAPI
dwritefactory_UnregisterFontCollectionLoader
(
IDWriteFactory
3
*
iface
,
IDWriteFontCollectionLoader
*
loader
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
struct
collectionloader
*
found
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
loader
);
...
...
@@ -753,10 +754,10 @@ static HRESULT WINAPI dwritefactory_UnregisterFontCollectionLoader(IDWriteFactor
return
S_OK
;
}
static
HRESULT
WINAPI
dwritefactory_CreateFontFileReference
(
IDWriteFactory
2
*
iface
,
static
HRESULT
WINAPI
dwritefactory_CreateFontFileReference
(
IDWriteFactory
3
*
iface
,
WCHAR
const
*
path
,
FILETIME
const
*
writetime
,
IDWriteFontFile
**
font_file
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
UINT32
key_size
;
HRESULT
hr
;
void
*
key
;
...
...
@@ -781,10 +782,10 @@ static HRESULT WINAPI dwritefactory_CreateFontFileReference(IDWriteFactory2 *ifa
return
hr
;
}
static
HRESULT
WINAPI
dwritefactory_CreateCustomFontFileReference
(
IDWriteFactory
2
*
iface
,
static
HRESULT
WINAPI
dwritefactory_CreateCustomFontFileReference
(
IDWriteFactory
3
*
iface
,
void
const
*
reference_key
,
UINT32
key_size
,
IDWriteFontFileLoader
*
loader
,
IDWriteFontFile
**
font_file
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
TRACE
(
"(%p)->(%p %u %p %p)
\n
"
,
This
,
reference_key
,
key_size
,
loader
,
font_file
);
...
...
@@ -796,11 +797,11 @@ static HRESULT WINAPI dwritefactory_CreateCustomFontFileReference(IDWriteFactory
return
create_font_file
(
loader
,
reference_key
,
key_size
,
font_file
);
}
static
HRESULT
WINAPI
dwritefactory_CreateFontFace
(
IDWriteFactory
2
*
iface
,
static
HRESULT
WINAPI
dwritefactory_CreateFontFace
(
IDWriteFactory
3
*
iface
,
DWRITE_FONT_FACE_TYPE
req_facetype
,
UINT32
files_number
,
IDWriteFontFile
*
const
*
font_files
,
UINT32
index
,
DWRITE_FONT_SIMULATIONS
simulations
,
IDWriteFontFace
**
font_face
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
DWRITE_FONT_FILE_TYPE
file_type
;
DWRITE_FONT_FACE_TYPE
face_type
;
IDWriteFontFileLoader
*
loader
;
...
...
@@ -906,9 +907,9 @@ static HRESULT WINAPI dwritefactory_CreateFontFace(IDWriteFactory2 *iface,
return
S_OK
;
}
static
HRESULT
WINAPI
dwritefactory_CreateRenderingParams
(
IDWriteFactory
2
*
iface
,
IDWriteRenderingParams
**
params
)
static
HRESULT
WINAPI
dwritefactory_CreateRenderingParams
(
IDWriteFactory
3
*
iface
,
IDWriteRenderingParams
**
params
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
HMONITOR
monitor
;
POINT
pt
;
...
...
@@ -916,13 +917,13 @@ static HRESULT WINAPI dwritefactory_CreateRenderingParams(IDWriteFactory2 *iface
pt
.
x
=
pt
.
y
=
0
;
monitor
=
MonitorFromPoint
(
pt
,
MONITOR_DEFAULTTOPRIMARY
);
return
IDWriteFactory
2
_CreateMonitorRenderingParams
(
iface
,
monitor
,
params
);
return
IDWriteFactory
3
_CreateMonitorRenderingParams
(
iface
,
monitor
,
params
);
}
static
HRESULT
WINAPI
dwritefactory_CreateMonitorRenderingParams
(
IDWriteFactory
2
*
iface
,
HMONITOR
monitor
,
static
HRESULT
WINAPI
dwritefactory_CreateMonitorRenderingParams
(
IDWriteFactory
3
*
iface
,
HMONITOR
monitor
,
IDWriteRenderingParams
**
params
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
IDWriteRenderingParams2
*
params2
;
static
int
fixme_once
=
0
;
HRESULT
hr
;
...
...
@@ -932,30 +933,30 @@ static HRESULT WINAPI dwritefactory_CreateMonitorRenderingParams(IDWriteFactory2
if
(
!
fixme_once
++
)
FIXME
(
"(%p): monitor setting ignored
\n
"
,
monitor
);
hr
=
IDWriteFactory2_CreateCustomRenderingParams
(
iface
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
DWRITE_PIXEL_GEOMETRY_FLAT
,
DWRITE_RENDERING_MODE_DEFAULT
,
hr
=
IDWriteFactory2_CreateCustomRenderingParams
(
(
IDWriteFactory2
*
)
iface
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
DWRITE_PIXEL_GEOMETRY_FLAT
,
DWRITE_RENDERING_MODE_DEFAULT
,
DWRITE_GRID_FIT_MODE_DEFAULT
,
&
params2
);
*
params
=
(
IDWriteRenderingParams
*
)
params2
;
return
hr
;
}
static
HRESULT
WINAPI
dwritefactory_CreateCustomRenderingParams
(
IDWriteFactory
2
*
iface
,
FLOAT
gamma
,
FLOAT
enhancedContrast
,
static
HRESULT
WINAPI
dwritefactory_CreateCustomRenderingParams
(
IDWriteFactory
3
*
iface
,
FLOAT
gamma
,
FLOAT
enhancedContrast
,
FLOAT
cleartype_level
,
DWRITE_PIXEL_GEOMETRY
geometry
,
DWRITE_RENDERING_MODE
mode
,
IDWriteRenderingParams
**
params
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
IDWriteRenderingParams2
*
params2
;
HRESULT
hr
;
TRACE
(
"(%p)->(%f %f %f %d %d %p)
\n
"
,
This
,
gamma
,
enhancedContrast
,
cleartype_level
,
geometry
,
mode
,
params
);
hr
=
IDWriteFactory2_CreateCustomRenderingParams
(
iface
,
gamma
,
enhancedContrast
,
1
.
0
f
,
cleartype_level
,
geometry
,
hr
=
IDWriteFactory2_CreateCustomRenderingParams
(
(
IDWriteFactory2
*
)
iface
,
gamma
,
enhancedContrast
,
1
.
0
f
,
cleartype_level
,
geometry
,
mode
,
DWRITE_GRID_FIT_MODE_DEFAULT
,
&
params2
);
*
params
=
(
IDWriteRenderingParams
*
)
params2
;
return
hr
;
}
static
HRESULT
WINAPI
dwritefactory_RegisterFontFileLoader
(
IDWriteFactory
2
*
iface
,
IDWriteFontFileLoader
*
loader
)
static
HRESULT
WINAPI
dwritefactory_RegisterFontFileLoader
(
IDWriteFactory
3
*
iface
,
IDWriteFontFileLoader
*
loader
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
struct
fileloader
*
entry
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
loader
);
...
...
@@ -981,9 +982,9 @@ static HRESULT WINAPI dwritefactory_RegisterFontFileLoader(IDWriteFactory2 *ifac
return
S_OK
;
}
static
HRESULT
WINAPI
dwritefactory_UnregisterFontFileLoader
(
IDWriteFactory
2
*
iface
,
IDWriteFontFileLoader
*
loader
)
static
HRESULT
WINAPI
dwritefactory_UnregisterFontFileLoader
(
IDWriteFactory
3
*
iface
,
IDWriteFontFileLoader
*
loader
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
struct
fileloader
*
found
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
loader
);
...
...
@@ -1002,11 +1003,11 @@ static HRESULT WINAPI dwritefactory_UnregisterFontFileLoader(IDWriteFactory2 *if
return
S_OK
;
}
static
HRESULT
WINAPI
dwritefactory_CreateTextFormat
(
IDWriteFactory
2
*
iface
,
WCHAR
const
*
family_name
,
static
HRESULT
WINAPI
dwritefactory_CreateTextFormat
(
IDWriteFactory
3
*
iface
,
WCHAR
const
*
family_name
,
IDWriteFontCollection
*
collection
,
DWRITE_FONT_WEIGHT
weight
,
DWRITE_FONT_STYLE
style
,
DWRITE_FONT_STRETCH
stretch
,
FLOAT
size
,
WCHAR
const
*
locale
,
IDWriteTextFormat
**
format
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
IDWriteFontCollection
*
syscollection
=
NULL
;
HRESULT
hr
;
...
...
@@ -1014,7 +1015,7 @@ static HRESULT WINAPI dwritefactory_CreateTextFormat(IDWriteFactory2 *iface, WCH
size
,
debugstr_w
(
locale
),
format
);
if
(
!
collection
)
{
hr
=
IDWriteFactory2_GetSystemFontCollection
(
iface
,
&
syscollection
,
FALSE
);
hr
=
IDWriteFactory2_GetSystemFontCollection
(
(
IDWriteFactory2
*
)
iface
,
&
syscollection
,
FALSE
);
if
(
FAILED
(
hr
))
return
hr
;
}
...
...
@@ -1025,16 +1026,16 @@ static HRESULT WINAPI dwritefactory_CreateTextFormat(IDWriteFactory2 *iface, WCH
return
hr
;
}
static
HRESULT
WINAPI
dwritefactory_CreateTypography
(
IDWriteFactory
2
*
iface
,
IDWriteTypography
**
typography
)
static
HRESULT
WINAPI
dwritefactory_CreateTypography
(
IDWriteFactory
3
*
iface
,
IDWriteTypography
**
typography
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
typography
);
return
create_typography
(
typography
);
}
static
HRESULT
WINAPI
dwritefactory_GetGdiInterop
(
IDWriteFactory
2
*
iface
,
IDWriteGdiInterop
**
gdi_interop
)
static
HRESULT
WINAPI
dwritefactory_GetGdiInterop
(
IDWriteFactory
3
*
iface
,
IDWriteGdiInterop
**
gdi_interop
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
gdi_interop
);
...
...
@@ -1052,21 +1053,21 @@ static HRESULT WINAPI dwritefactory_GetGdiInterop(IDWriteFactory2 *iface, IDWrit
return
S_OK
;
}
static
HRESULT
WINAPI
dwritefactory_CreateTextLayout
(
IDWriteFactory
2
*
iface
,
WCHAR
const
*
string
,
static
HRESULT
WINAPI
dwritefactory_CreateTextLayout
(
IDWriteFactory
3
*
iface
,
WCHAR
const
*
string
,
UINT32
len
,
IDWriteTextFormat
*
format
,
FLOAT
max_width
,
FLOAT
max_height
,
IDWriteTextLayout
**
layout
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
TRACE
(
"(%p)->(%s:%u %p %f %f %p)
\n
"
,
This
,
debugstr_wn
(
string
,
len
),
len
,
format
,
max_width
,
max_height
,
layout
);
return
create_textlayout
(
iface
,
string
,
len
,
format
,
max_width
,
max_height
,
layout
);
}
static
HRESULT
WINAPI
dwritefactory_CreateGdiCompatibleTextLayout
(
IDWriteFactory
2
*
iface
,
WCHAR
const
*
string
,
static
HRESULT
WINAPI
dwritefactory_CreateGdiCompatibleTextLayout
(
IDWriteFactory
3
*
iface
,
WCHAR
const
*
string
,
UINT32
len
,
IDWriteTextFormat
*
format
,
FLOAT
layout_width
,
FLOAT
layout_height
,
FLOAT
pixels_per_dip
,
DWRITE_MATRIX
const
*
transform
,
BOOL
use_gdi_natural
,
IDWriteTextLayout
**
layout
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
TRACE
(
"(%p)->(%s:%u %p %f %f %f %p %d %p)
\n
"
,
This
,
debugstr_wn
(
string
,
len
),
len
,
format
,
layout_width
,
layout_height
,
pixels_per_dip
,
transform
,
use_gdi_natural
,
layout
);
...
...
@@ -1075,34 +1076,34 @@ static HRESULT WINAPI dwritefactory_CreateGdiCompatibleTextLayout(IDWriteFactory
use_gdi_natural
,
layout
);
}
static
HRESULT
WINAPI
dwritefactory_CreateEllipsisTrimmingSign
(
IDWriteFactory
2
*
iface
,
IDWriteTextFormat
*
format
,
static
HRESULT
WINAPI
dwritefactory_CreateEllipsisTrimmingSign
(
IDWriteFactory
3
*
iface
,
IDWriteTextFormat
*
format
,
IDWriteInlineObject
**
trimming_sign
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
TRACE
(
"(%p)->(%p %p)
\n
"
,
This
,
format
,
trimming_sign
);
return
create_trimmingsign
(
iface
,
format
,
trimming_sign
);
}
static
HRESULT
WINAPI
dwritefactory_CreateTextAnalyzer
(
IDWriteFactory
2
*
iface
,
IDWriteTextAnalyzer
**
analyzer
)
static
HRESULT
WINAPI
dwritefactory_CreateTextAnalyzer
(
IDWriteFactory
3
*
iface
,
IDWriteTextAnalyzer
**
analyzer
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
analyzer
);
return
get_textanalyzer
(
analyzer
);
}
static
HRESULT
WINAPI
dwritefactory_CreateNumberSubstitution
(
IDWriteFactory
2
*
iface
,
DWRITE_NUMBER_SUBSTITUTION_METHOD
method
,
static
HRESULT
WINAPI
dwritefactory_CreateNumberSubstitution
(
IDWriteFactory
3
*
iface
,
DWRITE_NUMBER_SUBSTITUTION_METHOD
method
,
WCHAR
const
*
locale
,
BOOL
ignore_user_override
,
IDWriteNumberSubstitution
**
substitution
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
TRACE
(
"(%p)->(%d %s %d %p)
\n
"
,
This
,
method
,
debugstr_w
(
locale
),
ignore_user_override
,
substitution
);
return
create_numbersubstitution
(
method
,
locale
,
ignore_user_override
,
substitution
);
}
static
HRESULT
WINAPI
dwritefactory_CreateGlyphRunAnalysis
(
IDWriteFactory
2
*
iface
,
DWRITE_GLYPH_RUN
const
*
run
,
static
HRESULT
WINAPI
dwritefactory_CreateGlyphRunAnalysis
(
IDWriteFactory
3
*
iface
,
DWRITE_GLYPH_RUN
const
*
run
,
FLOAT
ppdip
,
DWRITE_MATRIX
const
*
transform
,
DWRITE_RENDERING_MODE
rendering_mode
,
DWRITE_MEASURING_MODE
measuring_mode
,
FLOAT
originX
,
FLOAT
originY
,
IDWriteGlyphRunAnalysis
**
analysis
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
TRACE
(
"(%p)->(%p %.2f %p %d %d %.2f %.2f %p)
\n
"
,
This
,
run
,
ppdip
,
transform
,
rendering_mode
,
measuring_mode
,
originX
,
originY
,
analysis
);
...
...
@@ -1116,10 +1117,10 @@ static HRESULT WINAPI dwritefactory_CreateGlyphRunAnalysis(IDWriteFactory2 *ifac
DWRITE_TEXT_ANTIALIAS_MODE_CLEARTYPE
,
originX
,
originY
,
analysis
);
}
static
HRESULT
WINAPI
dwritefactory1_GetEudcFontCollection
(
IDWriteFactory
2
*
iface
,
IDWriteFontCollection
**
collection
,
static
HRESULT
WINAPI
dwritefactory1_GetEudcFontCollection
(
IDWriteFactory
3
*
iface
,
IDWriteFontCollection
**
collection
,
BOOL
check_for_updates
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
HRESULT
hr
=
S_OK
;
TRACE
(
"(%p)->(%p %d)
\n
"
,
This
,
collection
,
check_for_updates
);
...
...
@@ -1138,25 +1139,25 @@ static HRESULT WINAPI dwritefactory1_GetEudcFontCollection(IDWriteFactory2 *ifac
return
hr
;
}
static
HRESULT
WINAPI
dwritefactory1_CreateCustomRenderingParams
(
IDWriteFactory
2
*
iface
,
FLOAT
gamma
,
static
HRESULT
WINAPI
dwritefactory1_CreateCustomRenderingParams
(
IDWriteFactory
3
*
iface
,
FLOAT
gamma
,
FLOAT
enhcontrast
,
FLOAT
enhcontrast_grayscale
,
FLOAT
cleartype_level
,
DWRITE_PIXEL_GEOMETRY
geometry
,
DWRITE_RENDERING_MODE
mode
,
IDWriteRenderingParams1
**
params
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
IDWriteRenderingParams2
*
params2
;
HRESULT
hr
;
TRACE
(
"(%p)->(%.2f %.2f %.2f %.2f %d %d %p)
\n
"
,
This
,
gamma
,
enhcontrast
,
enhcontrast_grayscale
,
cleartype_level
,
geometry
,
mode
,
params
);
hr
=
IDWriteFactory2_CreateCustomRenderingParams
(
iface
,
gamma
,
enhcontrast
,
enhcontrast_grayscale
,
hr
=
IDWriteFactory2_CreateCustomRenderingParams
(
(
IDWriteFactory2
*
)
iface
,
gamma
,
enhcontrast
,
enhcontrast_grayscale
,
cleartype_level
,
geometry
,
mode
,
DWRITE_GRID_FIT_MODE_DEFAULT
,
&
params2
);
*
params
=
(
IDWriteRenderingParams1
*
)
params2
;
return
hr
;
}
static
HRESULT
WINAPI
dwritefactory2_GetSystemFontFallback
(
IDWriteFactory
2
*
iface
,
IDWriteFontFallback
**
fallback
)
static
HRESULT
WINAPI
dwritefactory2_GetSystemFontFallback
(
IDWriteFactory
3
*
iface
,
IDWriteFontFallback
**
fallback
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
fallback
);
...
...
@@ -1173,39 +1174,39 @@ static HRESULT WINAPI dwritefactory2_GetSystemFontFallback(IDWriteFactory2 *ifac
return
S_OK
;
}
static
HRESULT
WINAPI
dwritefactory2_CreateFontFallbackBuilder
(
IDWriteFactory
2
*
iface
,
IDWriteFontFallbackBuilder
**
fallbackbuilder
)
static
HRESULT
WINAPI
dwritefactory2_CreateFontFallbackBuilder
(
IDWriteFactory
3
*
iface
,
IDWriteFontFallbackBuilder
**
fallbackbuilder
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
FIXME
(
"(%p)->(%p): stub
\n
"
,
This
,
fallbackbuilder
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
dwritefactory2_TranslateColorGlyphRun
(
IDWriteFactory
2
*
iface
,
FLOAT
originX
,
FLOAT
originY
,
static
HRESULT
WINAPI
dwritefactory2_TranslateColorGlyphRun
(
IDWriteFactory
3
*
iface
,
FLOAT
originX
,
FLOAT
originY
,
const
DWRITE_GLYPH_RUN
*
run
,
const
DWRITE_GLYPH_RUN_DESCRIPTION
*
rundescr
,
DWRITE_MEASURING_MODE
mode
,
const
DWRITE_MATRIX
*
transform
,
UINT32
palette
,
IDWriteColorGlyphRunEnumerator
**
colorlayers
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
TRACE
(
"(%p)->(%.2f %.2f %p %p %d %p %u %p)
\n
"
,
This
,
originX
,
originY
,
run
,
rundescr
,
mode
,
transform
,
palette
,
colorlayers
);
return
create_colorglyphenum
(
originX
,
originY
,
run
,
rundescr
,
mode
,
transform
,
palette
,
colorlayers
);
}
static
HRESULT
WINAPI
dwritefactory2_CreateCustomRenderingParams
(
IDWriteFactory
2
*
iface
,
FLOAT
gamma
,
FLOAT
contrast
,
static
HRESULT
WINAPI
dwritefactory2_CreateCustomRenderingParams
(
IDWriteFactory
3
*
iface
,
FLOAT
gamma
,
FLOAT
contrast
,
FLOAT
grayscalecontrast
,
FLOAT
cleartype_level
,
DWRITE_PIXEL_GEOMETRY
geometry
,
DWRITE_RENDERING_MODE
mode
,
DWRITE_GRID_FIT_MODE
gridfit
,
IDWriteRenderingParams2
**
params
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
TRACE
(
"(%p)->(%.2f %.2f %.2f %.2f %d %d %d %p)
\n
"
,
This
,
gamma
,
contrast
,
grayscalecontrast
,
cleartype_level
,
geometry
,
mode
,
gridfit
,
params
);
return
create_renderingparams
(
gamma
,
contrast
,
grayscalecontrast
,
cleartype_level
,
geometry
,
mode
,
gridfit
,
params
);
}
static
HRESULT
WINAPI
dwritefactory2_CreateGlyphRunAnalysis
(
IDWriteFactory
2
*
iface
,
const
DWRITE_GLYPH_RUN
*
run
,
static
HRESULT
WINAPI
dwritefactory2_CreateGlyphRunAnalysis
(
IDWriteFactory
3
*
iface
,
const
DWRITE_GLYPH_RUN
*
run
,
const
DWRITE_MATRIX
*
transform
,
DWRITE_RENDERING_MODE
rendering_mode
,
DWRITE_MEASURING_MODE
measuring_mode
,
DWRITE_GRID_FIT_MODE
gridfit_mode
,
DWRITE_TEXT_ANTIALIAS_MODE
aa_mode
,
FLOAT
originX
,
FLOAT
originY
,
IDWriteGlyphRunAnalysis
**
analysis
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
TRACE
(
"(%p)->(%p %p %d %d %d %d %.2f %.2f %p)
\n
"
,
This
,
run
,
transform
,
rendering_mode
,
measuring_mode
,
gridfit_mode
,
aa_mode
,
originX
,
originY
,
analysis
);
...
...
@@ -1213,7 +1214,99 @@ static HRESULT WINAPI dwritefactory2_CreateGlyphRunAnalysis(IDWriteFactory2 *ifa
return
create_glyphrunanalysis
(
rendering_mode
,
measuring_mode
,
run
,
1
.
0
f
,
transform
,
gridfit_mode
,
aa_mode
,
originX
,
originY
,
analysis
);
}
static
const
struct
IDWriteFactory2Vtbl
dwritefactoryvtbl
=
{
static
HRESULT
WINAPI
dwritefactory3_CreateGlyphRunAnalysis
(
IDWriteFactory3
*
iface
,
DWRITE_GLYPH_RUN
const
*
run
,
DWRITE_MATRIX
const
*
transform
,
DWRITE_RENDERING_MODE1
rendering_mode
,
DWRITE_MEASURING_MODE
measuring_mode
,
DWRITE_GRID_FIT_MODE
gridfit_mode
,
DWRITE_TEXT_ANTIALIAS_MODE
aa_mode
,
FLOAT
originX
,
FLOAT
originY
,
IDWriteGlyphRunAnalysis
**
analysis
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory3
(
iface
);
FIXME
(
"(%p)->(%p %p %d %d %d %d %.2f %.2f %p): stub
\n
"
,
This
,
run
,
transform
,
rendering_mode
,
measuring_mode
,
gridfit_mode
,
aa_mode
,
originX
,
originY
,
analysis
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
dwritefactory3_CreateCustomRenderingParams
(
IDWriteFactory3
*
iface
,
FLOAT
gamma
,
FLOAT
contrast
,
FLOAT
grayscale_contrast
,
FLOAT
cleartype_level
,
DWRITE_PIXEL_GEOMETRY
pixel_geometry
,
DWRITE_RENDERING_MODE1
rendering_mode
,
DWRITE_GRID_FIT_MODE
gridfit_mode
,
IDWriteRenderingParams3
**
params
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory3
(
iface
);
FIXME
(
"(%p)->(%.2f %.2f %.2f %.2f %d %d %d %p): stub
\n
"
,
This
,
gamma
,
contrast
,
grayscale_contrast
,
cleartype_level
,
pixel_geometry
,
rendering_mode
,
gridfit_mode
,
params
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
dwritefactory3_CreateFontFaceReference
(
IDWriteFactory3
*
iface
,
WCHAR
const
*
path
,
FILETIME
const
*
writetime
,
UINT32
index
,
DWRITE_FONT_SIMULATIONS
simulations
,
IDWriteFontFaceReference
**
reference
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory3
(
iface
);
FIXME
(
"(%p)->(%s %p %u %x, %p): stub
\n
"
,
This
,
debugstr_w
(
path
),
writetime
,
index
,
simulations
,
reference
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
dwritefactory3_CreateFontFaceReference_
(
IDWriteFactory3
*
iface
,
IDWriteFontFile
*
file
,
UINT32
index
,
DWRITE_FONT_SIMULATIONS
simulations
,
IDWriteFontFaceReference
**
reference
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory3
(
iface
);
FIXME
(
"(%p)->(%p %u %x %p): stub
\n
"
,
This
,
file
,
index
,
simulations
,
reference
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
dwritefactory3_GetSystemFontSet
(
IDWriteFactory3
*
iface
,
IDWriteFontSet
**
fontset
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory3
(
iface
);
FIXME
(
"(%p)->(%p): stub
\n
"
,
This
,
fontset
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
dwritefactory3_CreateFontSetBuilder
(
IDWriteFactory3
*
iface
,
IDWriteFontSetBuilder
**
builder
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory3
(
iface
);
FIXME
(
"(%p)->(%p): stub
\n
"
,
This
,
builder
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
dwritefactory3_CreateFontCollectionFromFontSet
(
IDWriteFactory3
*
iface
,
IDWriteFontSet
*
fontset
,
IDWriteFontCollection1
**
collection
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory3
(
iface
);
FIXME
(
"(%p)->(%p %p): stub
\n
"
,
This
,
fontset
,
collection
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
dwritefactory3_GetSystemFontCollection
(
IDWriteFactory3
*
iface
,
BOOL
include_downloadable
,
IDWriteFontCollection1
**
collection
,
BOOL
check_for_updates
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory3
(
iface
);
FIXME
(
"(%p)->(%d %p %d): stub
\n
"
,
This
,
include_downloadable
,
collection
,
check_for_updates
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
dwritefactory3_GetFontDownloadQueue
(
IDWriteFactory3
*
iface
,
IDWriteFontDownloadQueue
**
queue
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory3
(
iface
);
FIXME
(
"(%p)->(%p): stub
\n
"
,
This
,
queue
);
return
E_NOTIMPL
;
}
static
const
struct
IDWriteFactory3Vtbl
dwritefactoryvtbl
=
{
dwritefactory_QueryInterface
,
dwritefactory_AddRef
,
dwritefactory_Release
,
...
...
@@ -1244,24 +1337,33 @@ static const struct IDWriteFactory2Vtbl dwritefactoryvtbl = {
dwritefactory2_CreateFontFallbackBuilder
,
dwritefactory2_TranslateColorGlyphRun
,
dwritefactory2_CreateCustomRenderingParams
,
dwritefactory2_CreateGlyphRunAnalysis
dwritefactory2_CreateGlyphRunAnalysis
,
dwritefactory3_CreateGlyphRunAnalysis
,
dwritefactory3_CreateCustomRenderingParams
,
dwritefactory3_CreateFontFaceReference
,
dwritefactory3_CreateFontFaceReference_
,
dwritefactory3_GetSystemFontSet
,
dwritefactory3_CreateFontSetBuilder
,
dwritefactory3_CreateFontCollectionFromFontSet
,
dwritefactory3_GetSystemFontCollection
,
dwritefactory3_GetFontDownloadQueue
};
static
ULONG
WINAPI
shareddwritefactory_AddRef
(
IDWriteFactory
2
*
iface
)
static
ULONG
WINAPI
shareddwritefactory_AddRef
(
IDWriteFactory
3
*
iface
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
2
;
}
static
ULONG
WINAPI
shareddwritefactory_Release
(
IDWriteFactory
2
*
iface
)
static
ULONG
WINAPI
shareddwritefactory_Release
(
IDWriteFactory
3
*
iface
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
2
(
iface
);
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
3
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
1
;
}
static
const
struct
IDWriteFactory
2
Vtbl
shareddwritefactoryvtbl
=
{
static
const
struct
IDWriteFactory
3
Vtbl
shareddwritefactoryvtbl
=
{
dwritefactory_QueryInterface
,
shareddwritefactory_AddRef
,
shareddwritefactory_Release
,
...
...
@@ -1292,12 +1394,21 @@ static const struct IDWriteFactory2Vtbl shareddwritefactoryvtbl = {
dwritefactory2_CreateFontFallbackBuilder
,
dwritefactory2_TranslateColorGlyphRun
,
dwritefactory2_CreateCustomRenderingParams
,
dwritefactory2_CreateGlyphRunAnalysis
dwritefactory2_CreateGlyphRunAnalysis
,
dwritefactory3_CreateGlyphRunAnalysis
,
dwritefactory3_CreateCustomRenderingParams
,
dwritefactory3_CreateFontFaceReference
,
dwritefactory3_CreateFontFaceReference_
,
dwritefactory3_GetSystemFontSet
,
dwritefactory3_CreateFontSetBuilder
,
dwritefactory3_CreateFontCollectionFromFontSet
,
dwritefactory3_GetSystemFontCollection
,
dwritefactory3_GetFontDownloadQueue
};
static
void
init_dwritefactory
(
struct
dwritefactory
*
factory
,
DWRITE_FACTORY_TYPE
type
)
{
factory
->
IDWriteFactory
2
_iface
.
lpVtbl
=
type
==
DWRITE_FACTORY_TYPE_SHARED
?
&
shareddwritefactoryvtbl
:
&
dwritefactoryvtbl
;
factory
->
IDWriteFactory
3
_iface
.
lpVtbl
=
type
==
DWRITE_FACTORY_TYPE_SHARED
?
&
shareddwritefactoryvtbl
:
&
dwritefactoryvtbl
;
factory
->
ref
=
1
;
factory
->
localfontfileloader
=
NULL
;
factory
->
system_collection
=
NULL
;
...
...
@@ -1320,7 +1431,7 @@ HRESULT WINAPI DWriteCreateFactory(DWRITE_FACTORY_TYPE type, REFIID riid, IUnkno
*
ret
=
NULL
;
if
(
type
==
DWRITE_FACTORY_TYPE_SHARED
&&
shared_factory
)
return
IDWriteFactory
2
_QueryInterface
(
shared_factory
,
riid
,
(
void
**
)
ret
);
return
IDWriteFactory
3
_QueryInterface
(
shared_factory
,
riid
,
(
void
**
)
ret
);
factory
=
heap_alloc
(
sizeof
(
struct
dwritefactory
));
if
(
!
factory
)
return
E_OUTOFMEMORY
;
...
...
@@ -1328,12 +1439,12 @@ HRESULT WINAPI DWriteCreateFactory(DWRITE_FACTORY_TYPE type, REFIID riid, IUnkno
init_dwritefactory
(
factory
,
type
);
if
(
type
==
DWRITE_FACTORY_TYPE_SHARED
)
if
(
InterlockedCompareExchangePointer
((
void
**
)
&
shared_factory
,
&
factory
->
IDWriteFactory
2
_iface
,
NULL
))
{
release_shared_factory
(
&
factory
->
IDWriteFactory
2
_iface
);
return
IDWriteFactory
2
_QueryInterface
(
shared_factory
,
riid
,
(
void
**
)
ret
);
if
(
InterlockedCompareExchangePointer
((
void
**
)
&
shared_factory
,
&
factory
->
IDWriteFactory
3
_iface
,
NULL
))
{
release_shared_factory
(
&
factory
->
IDWriteFactory
3
_iface
);
return
IDWriteFactory
3
_QueryInterface
(
shared_factory
,
riid
,
(
void
**
)
ret
);
}
hr
=
IDWriteFactory
2_QueryInterface
(
&
factory
->
IDWriteFactory2
_iface
,
riid
,
(
void
**
)
ret
);
IDWriteFactory
2_Release
(
&
factory
->
IDWriteFactory2
_iface
);
hr
=
IDWriteFactory
3_QueryInterface
(
&
factory
->
IDWriteFactory3
_iface
,
riid
,
(
void
**
)
ret
);
IDWriteFactory
3_Release
(
&
factory
->
IDWriteFactory3
_iface
);
return
hr
;
}
dlls/dwrite/tests/font.c
View file @
d04a5485
...
...
@@ -5425,13 +5425,14 @@ static void test_HasCharacter(void)
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ret
=
IDWriteFont3_HasCharacter
(
font3
,
'A'
);
todo_wine
ok
(
ret
,
"got %d
\n
"
,
ret
);
IDWriteFont3_Release
(
font3
);
IDWriteFactory3_Release
(
factory3
);
}
else
skip
(
"IDWriteFont3 is not supported.
\n
"
);
win_
skip
(
"IDWriteFont3 is not supported.
\n
"
);
IDWriteFont_Release
(
font
);
IDWriteFactory_Release
(
factory
);
...
...
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