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
abae85b9
Commit
abae85b9
authored
May 05, 2010
by
Aric Stewart
Committed by
Alexandre Julliard
May 06, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
usp10: Fix ScriptGetCMap handling of unsupported glyphs.
parent
6478e41b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
3 deletions
+21
-3
usp10.c
dlls/usp10/tests/usp10.c
+13
-2
usp10.c
dlls/usp10/usp10.c
+8
-1
No files found.
dlls/usp10/tests/usp10.c
View file @
abae85b9
...
...
@@ -583,10 +583,12 @@ static void test_ScriptGetCMap(HDC hdc, unsigned short pwOutGlyphs[256])
int
cInChars
;
int
cChars
;
unsigned
short
pwOutGlyphs3
[
256
];
WCHAR
TestItem1
[]
=
{
'T'
,
'e'
,
's'
,
't'
,
'a'
,
0
};
DWORD
dwFlags
;
int
cnt
;
static
const
WCHAR
TestItem1
[]
=
{
'T'
,
'e'
,
's'
,
't'
,
'a'
,
0
};
static
const
WCHAR
TestItem2
[]
=
{
0x202B
,
'i'
,
'n'
,
0x202C
,
0
};
/* Check to make sure that SCRIPT_CACHE gets allocated ok */
dwFlags
=
0
;
cInChars
=
cChars
=
5
;
...
...
@@ -627,10 +629,19 @@ static void test_ScriptGetCMap(HDC hdc, unsigned short pwOutGlyphs[256])
for
(
cnt
=
0
;
cnt
<
cChars
&&
pwOutGlyphs
[
cnt
]
==
pwOutGlyphs3
[
cnt
];
cnt
++
)
{}
ok
(
cnt
==
cInChars
,
"Translation not correct. WCHAR %d - %04x != %04x
\n
"
,
cnt
,
pwOutGlyphs
[
cnt
],
pwOutGlyphs3
[
cnt
]);
hr
=
ScriptFreeCache
(
&
psc
);
ok
(
!
psc
,
"psc is not null after ScriptFreeCache
\n
"
);
cInChars
=
cChars
=
4
;
hr
=
ScriptGetCMap
(
hdc
,
&
psc
,
TestItem2
,
cInChars
,
dwFlags
,
pwOutGlyphs3
);
ok
(
hr
==
S_FALSE
,
"ScriptGetCMap should return S_FALSE not (%08x)
\n
"
,
hr
);
ok
(
psc
!=
NULL
,
"psc should not be null and have SCRIPT_CACHE buffer address
\n
"
);
ok
(
pwOutGlyphs3
[
0
]
==
0
,
"Glyph 0 should be default glyph
\n
"
);
ok
(
pwOutGlyphs3
[
3
]
==
0
,
"Glyph 0 should be default glyph
\n
"
);
hr
=
ScriptFreeCache
(
&
psc
);
ok
(
!
psc
,
"psc is not null after ScriptFreeCache
\n
"
);
}
static
void
test_ScriptGetFontProperties
(
HDC
hdc
)
...
...
dlls/usp10/usp10.c
View file @
abae85b9
...
...
@@ -1528,6 +1528,8 @@ HRESULT WINAPI ScriptGetCMap(HDC hdc, SCRIPT_CACHE *psc, const WCHAR *pwcInChars
if
((
hr
=
init_script_cache
(
hdc
,
psc
))
!=
S_OK
)
return
hr
;
hr
=
S_OK
;
if
((
get_cache_pitch_family
(
psc
)
&
TMPF_TRUETYPE
))
{
for
(
i
=
0
;
i
<
cChars
;
i
++
)
...
...
@@ -1537,6 +1539,11 @@ HRESULT WINAPI ScriptGetCMap(HDC hdc, SCRIPT_CACHE *psc, const WCHAR *pwcInChars
WORD
glyph
;
if
(
!
hdc
)
return
E_PENDING
;
if
(
GetGlyphIndicesW
(
hdc
,
&
pwcInChars
[
i
],
1
,
&
glyph
,
GGI_MARK_NONEXISTING_GLYPHS
)
==
GDI_ERROR
)
return
S_FALSE
;
if
(
glyph
==
0xffff
)
{
hr
=
S_FALSE
;
glyph
=
0x0
;
}
pwOutGlyphs
[
i
]
=
set_cache_glyph
(
psc
,
pwcInChars
[
i
],
glyph
);
}
}
...
...
@@ -1546,7 +1553,7 @@ HRESULT WINAPI ScriptGetCMap(HDC hdc, SCRIPT_CACHE *psc, const WCHAR *pwcInChars
TRACE
(
"no glyph translation
\n
"
);
for
(
i
=
0
;
i
<
cChars
;
i
++
)
pwOutGlyphs
[
i
]
=
pwcInChars
[
i
];
}
return
S_OK
;
return
hr
;
}
/***********************************************************************
...
...
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