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
69bc0174
Commit
69bc0174
authored
Jun 26, 2009
by
Hans Leidekker
Committed by
Alexandre Julliard
Jun 26, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mlang: Implement IMLangFontLink2_GetFontUnicodeRanges.
parent
fb0d79ae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
2 deletions
+68
-2
mlang.c
dlls/mlang/mlang.c
+24
-2
mlang.c
dlls/mlang/tests/mlang.c
+44
-0
No files found.
dlls/mlang/mlang.c
View file @
69bc0174
...
...
@@ -3357,8 +3357,30 @@ static HRESULT WINAPI fnIMLangFontLink2_MapFont(IMLangFontLink2* This,
static
HRESULT
WINAPI
fnIMLangFontLink2_GetFontUnicodeRanges
(
IMLangFontLink2
*
This
,
HDC
hDC
,
UINT
*
puiRanges
,
UNICODERANGE
*
pUranges
)
{
FIXME
(
"(%p)->%p %p %p
\n
"
,
This
,
hDC
,
puiRanges
,
pUranges
);
return
E_NOTIMPL
;
DWORD
size
;
GLYPHSET
*
gs
;
TRACE
(
"(%p)->%p %p %p
\n
"
,
This
,
hDC
,
puiRanges
,
pUranges
);
if
(
!
puiRanges
)
return
E_INVALIDARG
;
if
(
!
(
size
=
GetFontUnicodeRanges
(
hDC
,
NULL
)))
return
E_FAIL
;
if
(
!
(
gs
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
)))
return
E_OUTOFMEMORY
;
GetFontUnicodeRanges
(
hDC
,
gs
);
*
puiRanges
=
gs
->
cRanges
;
if
(
pUranges
)
{
UINT
i
;
for
(
i
=
0
;
i
<
gs
->
cRanges
;
i
++
)
{
if
(
i
>=
*
puiRanges
)
break
;
pUranges
[
i
].
wcFrom
=
gs
->
ranges
[
i
].
wcLow
;
pUranges
[
i
].
wcTo
=
gs
->
ranges
[
i
].
wcLow
+
gs
->
ranges
[
i
].
cGlyphs
;
}
*
puiRanges
=
i
;
}
HeapFree
(
GetProcessHeap
(),
0
,
gs
);
return
S_OK
;
}
static
HRESULT
WINAPI
fnIMLangFontLink2_GetScriptFontInfo
(
IMLangFontLink2
*
This
,
...
...
dlls/mlang/tests/mlang.c
View file @
69bc0174
...
...
@@ -1914,6 +1914,49 @@ static void test_CodePageToScriptID(IMLangFontLink2 *font_link)
}
}
static
void
test_GetFontUnicodeRanges
(
IMLangFontLink2
*
font_link
)
{
HRESULT
hr
;
UINT
count
;
HFONT
hfont
,
old_hfont
;
LOGFONTA
lf
;
HDC
hdc
;
UNICODERANGE
*
ur
;
hdc
=
CreateCompatibleDC
(
0
);
memset
(
&
lf
,
0
,
sizeof
(
lf
));
lstrcpyA
(
lf
.
lfFaceName
,
"Arial"
);
hfont
=
CreateFontIndirectA
(
&
lf
);
old_hfont
=
SelectObject
(
hdc
,
hfont
);
count
=
0
;
hr
=
IMLangFontLink2_GetFontUnicodeRanges
(
font_link
,
NULL
,
&
count
,
NULL
);
ok
(
hr
==
E_FAIL
,
"expected E_FAIL, got 0x%08x
\n
"
,
hr
);
hr
=
IMLangFontLink2_GetFontUnicodeRanges
(
font_link
,
hdc
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"expected E_FAIL, got 0x%08x
\n
"
,
hr
);
count
=
0
;
hr
=
IMLangFontLink2_GetFontUnicodeRanges
(
font_link
,
hdc
,
&
count
,
NULL
);
ok
(
hr
==
S_OK
,
"expected S_OK, got 0x%08x
\n
"
,
hr
);
ok
(
count
,
"expected count > 0
\n
"
);
ur
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
ur
)
*
count
);
hr
=
IMLangFontLink2_GetFontUnicodeRanges
(
font_link
,
hdc
,
&
count
,
ur
);
ok
(
hr
==
S_OK
,
"expected S_OK, got 0x%08x
\n
"
,
hr
);
count
--
;
hr
=
IMLangFontLink2_GetFontUnicodeRanges
(
font_link
,
hdc
,
&
count
,
ur
);
ok
(
hr
==
S_OK
,
"expected S_OK, got 0x%08x
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
ur
);
SelectObject
(
hdc
,
old_hfont
);
DeleteObject
(
hfont
);
DeleteDC
(
hdc
);
}
START_TEST
(
mlang
)
{
IMultiLanguage
*
iML
=
NULL
;
...
...
@@ -1991,6 +2034,7 @@ START_TEST(mlang)
if
(
ret
!=
S_OK
||
!
iMLFL2
)
return
;
test_GetScriptFontInfo
(
iMLFL2
);
test_GetFontUnicodeRanges
(
iMLFL2
);
test_CodePageToScriptID
(
iMLFL2
);
IMLangFontLink2_Release
(
iMLFL2
);
...
...
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