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
1fc01563
Commit
1fc01563
authored
Dec 29, 2011
by
Aric Stewart
Committed by
Alexandre Julliard
Dec 30, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
usp10: Updates to ScriptGetFontScriptTags.
parent
da07748c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
9 deletions
+26
-9
shape.c
dlls/usp10/shape.c
+12
-9
usp10.c
dlls/usp10/tests/usp10.c
+14
-0
No files found.
dlls/usp10/shape.c
View file @
1fc01563
...
...
@@ -3788,12 +3788,19 @@ static HRESULT GSUB_GetFontScriptTags(LPCVOID table, OPENTYPE_TAG searchingFor,
script
=
(
const
GSUB_ScriptList
*
)((
const
BYTE
*
)
header
+
GET_BE_WORD
(
header
->
ScriptList
));
*
pcTags
=
0
;
TRACE
(
"%i scripts in this font
\n
"
,
GET_BE_WORD
(
script
->
ScriptCount
));
if
(
!
searchingFor
&&
cMaxTags
<
GET_BE_WORD
(
script
->
ScriptCount
))
*
pcTags
=
GET_BE_WORD
(
script
->
ScriptCount
);
TRACE
(
"%i scripts in this font
\n
"
,
*
pcTags
);
if
(
!
searchingFor
&&
cMaxTags
<
*
pcTags
)
rc
=
E_OUTOFMEMORY
;
for
(
i
=
0
;
i
<
GET_BE_WORD
(
script
->
ScriptCount
);
i
++
)
else
if
(
searchingFor
)
rc
=
USP_E_SCRIPT_NOT_IN_FONT
;
for
(
i
=
0
;
i
<
*
pcTags
;
i
++
)
{
if
(
i
<
cMaxTags
)
pScriptTags
[
i
]
=
MS_MAKE_TAG
(
script
->
ScriptRecord
[
i
].
ScriptTag
[
0
],
script
->
ScriptRecord
[
i
].
ScriptTag
[
1
],
script
->
ScriptRecord
[
i
].
ScriptTag
[
2
],
script
->
ScriptRecord
[
i
].
ScriptTag
[
3
]);
if
(
searchingFor
)
{
if
(
strncmp
(
script
->
ScriptRecord
[
i
].
ScriptTag
,
(
char
*
)
&
searchingFor
,
4
)
==
0
)
...
...
@@ -3805,14 +3812,10 @@ static HRESULT GSUB_GetFontScriptTags(LPCVOID table, OPENTYPE_TAG searchingFor,
int
offset
=
GET_BE_WORD
(
script
->
ScriptRecord
[
i
].
Script
);
*
script_table
=
((
const
BYTE
*
)
script
+
offset
);
}
rc
=
S_OK
;
break
;
}
}
else
if
(
i
<
cMaxTags
)
{
pScriptTags
[
i
]
=
MS_MAKE_TAG
(
script
->
ScriptRecord
[
i
].
ScriptTag
[
0
],
script
->
ScriptRecord
[
i
].
ScriptTag
[
1
],
script
->
ScriptRecord
[
i
].
ScriptTag
[
2
],
script
->
ScriptRecord
[
i
].
ScriptTag
[
3
]);
*
pcTags
=
*
pcTags
+
1
;
}
}
return
rc
;
}
...
...
dlls/usp10/tests/usp10.c
View file @
1fc01563
...
...
@@ -2880,6 +2880,11 @@ static void test_ScriptGetFontFunctions(HDC hdc)
SCRIPT_CACHE
sc
=
NULL
;
OPENTYPE_TAG
tags
[
5
];
int
count
=
0
;
int
outnItems
=
0
;
SCRIPT_ITEM
outpItems
[
15
];
SCRIPT_CONTROL
Control
;
SCRIPT_STATE
State
;
static
const
WCHAR
test_phagspa
[]
=
{
0xa84f
,
0xa861
,
0xa843
,
0x0020
,
0xa863
,
0xa861
,
0xa859
,
0x0020
,
0xa850
,
0xa85c
,
0xa85e
};
hr
=
pScriptGetFontScriptTags
(
hdc
,
&
sc
,
NULL
,
0
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Incorrect return code
\n
"
);
...
...
@@ -2903,6 +2908,15 @@ static void test_ScriptGetFontFunctions(HDC hdc)
else
if
(
hr
==
E_OUTOFMEMORY
)
ok
(
count
==
0
,
"Count should be 0 with E_OUTOFMEMORY return
\n
"
);
ok
(
sc
!=
NULL
,
"ScriptCache should be initialized
\n
"
);
memset
(
&
Control
,
0
,
sizeof
(
Control
));
memset
(
&
State
,
0
,
sizeof
(
State
));
hr
=
ScriptItemize
(
test_phagspa
,
10
,
15
,
&
Control
,
&
State
,
outpItems
,
&
outnItems
);
ok
(
hr
==
S_OK
,
"ScriptItemize failed: 0x%08x
\n
"
,
hr
);
memset
(
tags
,
0
,
sizeof
(
tags
));
hr
=
pScriptGetFontScriptTags
(
hdc
,
&
sc
,
&
outpItems
[
0
].
a
,
5
,
tags
,
&
count
);
ok
(
hr
==
USP_E_SCRIPT_NOT_IN_FONT
||
broken
(
hr
==
S_OK
),
"wrong return code
\n
"
);
ScriptFreeCache
(
&
sc
);
}
}
...
...
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