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
fa1fe44c
Commit
fa1fe44c
authored
Mar 15, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 17, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Implement SetFontFallback().
parent
c2c30013
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
9 deletions
+58
-9
layout.c
dlls/dwrite/layout.c
+18
-8
layout.c
dlls/dwrite/tests/layout.c
+40
-1
No files found.
dlls/dwrite/layout.c
View file @
fa1fe44c
...
...
@@ -235,6 +235,16 @@ static HRESULT get_fontfallback_from_format(const struct dwrite_textformat_data
return
S_OK
;
}
static
HRESULT
set_fontfallback_for_format
(
struct
dwrite_textformat_data
*
format
,
IDWriteFontFallback
*
fallback
)
{
if
(
format
->
fallback
)
IDWriteFontFallback_Release
(
format
->
fallback
);
format
->
fallback
=
fallback
;
if
(
fallback
)
IDWriteFontFallback_AddRef
(
fallback
);
return
S_OK
;
}
static
struct
layout_run
*
alloc_layout_run
(
void
)
{
struct
layout_run
*
ret
;
...
...
@@ -1867,8 +1877,8 @@ static DWRITE_OPTICAL_ALIGNMENT WINAPI dwritetextlayout2_GetOpticalAlignment(IDW
static
HRESULT
WINAPI
dwritetextlayout2_SetFontFallback
(
IDWriteTextLayout2
*
iface
,
IDWriteFontFallback
*
fallback
)
{
struct
dwrite_textlayout
*
This
=
impl_from_IDWriteTextLayout2
(
iface
);
FIXME
(
"(%p)->(%p): stub
\n
"
,
This
,
fallback
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
fallback
);
return
set_fontfallback_for_format
(
&
This
->
format
,
fallback
)
;
}
static
HRESULT
WINAPI
dwritetextlayout2_GetFontFallback
(
IDWriteTextLayout2
*
iface
,
IDWriteFontFallback
**
fallback
)
...
...
@@ -2228,15 +2238,15 @@ static DWRITE_OPTICAL_ALIGNMENT WINAPI dwritetextformat1_layout_GetOpticalAlignm
static
HRESULT
WINAPI
dwritetextformat1_layout_SetFontFallback
(
IDWriteTextFormat1
*
iface
,
IDWriteFontFallback
*
fallback
)
{
struct
dwrite_textlayout
*
This
=
impl_layout_form_IDWriteTextFormat1
(
iface
);
FIXME
(
"(%p)->(%p): stub
\n
"
,
This
,
fallback
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
fallback
);
return
IDWriteTextLayout2_SetFontFallback
(
&
This
->
IDWriteTextLayout2_iface
,
fallback
)
;
}
static
HRESULT
WINAPI
dwritetextformat1_layout_GetFontFallback
(
IDWriteTextFormat1
*
iface
,
IDWriteFontFallback
**
fallback
)
{
struct
dwrite_textlayout
*
This
=
impl_layout_form_IDWriteTextFormat1
(
iface
);
TRACE
(
"(%p)->(%p)
: stub
\n
"
,
This
,
fallback
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
fallback
);
return
IDWriteTextLayout2_GetFontFallback
(
&
This
->
IDWriteTextLayout2_iface
,
fallback
)
;
}
static
const
IDWriteTextFormat1Vtbl
dwritetextformat1_layout_vtbl
=
{
...
...
@@ -3055,8 +3065,8 @@ static DWRITE_OPTICAL_ALIGNMENT WINAPI dwritetextformat1_GetOpticalAlignment(IDW
static
HRESULT
WINAPI
dwritetextformat1_SetFontFallback
(
IDWriteTextFormat1
*
iface
,
IDWriteFontFallback
*
fallback
)
{
struct
dwrite_textformat
*
This
=
impl_from_IDWriteTextFormat1
(
iface
);
FIXME
(
"(%p)->(%p): stub
\n
"
,
This
,
fallback
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
fallback
);
return
set_fontfallback_for_format
(
&
This
->
format
,
fallback
)
;
}
static
HRESULT
WINAPI
dwritetextformat1_GetFontFallback
(
IDWriteTextFormat1
*
iface
,
IDWriteFontFallback
**
fallback
)
...
...
dlls/dwrite/tests/layout.c
View file @
fa1fe44c
...
...
@@ -1204,10 +1204,12 @@ static void test_SetVerticalGlyphOrientation(void)
static
void
test_fallback
(
void
)
{
static
const
WCHAR
strW
[]
=
{
'a'
,
'b'
,
'c'
,
'd'
,
0
};
IDWriteFontFallback
*
fallback
;
IDWriteFontFallback
*
fallback
,
*
fallback2
;
IDWriteTextLayout2
*
layout2
;
IDWriteTextFormat1
*
format1
;
IDWriteTextFormat
*
format
;
IDWriteTextLayout
*
layout
;
IDWriteFactory2
*
factory2
;
IDWriteFactory
*
factory
;
HRESULT
hr
;
...
...
@@ -1238,6 +1240,43 @@ if (0) /* crashes on native */
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
fallback
==
NULL
,
"got %p
\n
"
,
fallback
);
hr
=
IDWriteTextLayout2_QueryInterface
(
layout2
,
&
IID_IDWriteTextFormat1
,
(
void
**
)
&
format1
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
fallback
=
(
void
*
)
0xdeadbeef
;
hr
=
IDWriteTextFormat1_GetFontFallback
(
format1
,
&
fallback
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
fallback
==
NULL
,
"got %p
\n
"
,
fallback
);
hr
=
IDWriteFactory_QueryInterface
(
factory
,
&
IID_IDWriteFactory2
,
(
void
**
)
&
factory2
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
fallback
=
NULL
;
hr
=
IDWriteFactory2_GetSystemFontFallback
(
factory2
,
&
fallback
);
todo_wine
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
ok
(
fallback
!=
NULL
,
"got %p
\n
"
,
fallback
);
hr
=
IDWriteTextFormat1_SetFontFallback
(
format1
,
fallback
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
fallback2
=
(
void
*
)
0xdeadbeef
;
hr
=
IDWriteTextLayout2_GetFontFallback
(
layout2
,
&
fallback2
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
fallback2
==
fallback
,
"got %p
\n
"
,
fallback2
);
hr
=
IDWriteTextLayout2_SetFontFallback
(
layout2
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
fallback2
=
(
void
*
)
0xdeadbeef
;
hr
=
IDWriteTextFormat1_GetFontFallback
(
format1
,
&
fallback2
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
fallback2
==
NULL
,
"got %p
\n
"
,
fallback2
);
IDWriteFontFallback_Release
(
fallback
);
}
IDWriteTextFormat1_Release
(
format1
);
IDWriteTextLayout2_Release
(
layout2
);
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