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
0c0ab500
Commit
0c0ab500
authored
Aug 04, 2006
by
Hans Leidekker
Committed by
Alexandre Julliard
Aug 04, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
usp10: Implement ScriptGetGlyphABCWidth.
Add a test for ScriptGetGlyphABCWidth and ScriptCacheGetHeight.
parent
08484ba4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
99 additions
and
1 deletion
+99
-1
usp10.c
dlls/usp10/tests/usp10.c
+54
-0
usp10.c
dlls/usp10/usp10.c
+44
-0
usp10.spec
dlls/usp10/usp10.spec
+1
-1
No files found.
dlls/usp10/tests/usp10.c
View file @
0c0ab500
...
...
@@ -626,6 +626,58 @@ static void test_ScriptString(void)
}
}
void
test_ScriptCacheGetHeight
(
HDC
hdc
)
{
HRESULT
hr
;
SCRIPT_CACHE
sc
=
NULL
;
LONG
height
;
hr
=
ScriptCacheGetHeight
(
NULL
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"expected E_INVALIDARG, got 0x%08lx
\n
"
,
hr
);
hr
=
ScriptCacheGetHeight
(
NULL
,
&
sc
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"expected E_INVALIDARG, got 0x%08lx
\n
"
,
hr
);
hr
=
ScriptCacheGetHeight
(
NULL
,
&
sc
,
&
height
);
ok
(
hr
==
E_PENDING
,
"expected E_PENDING, got 0x%08lx
\n
"
,
hr
);
height
=
0
;
hr
=
ScriptCacheGetHeight
(
hdc
,
&
sc
,
&
height
);
ok
(
hr
==
S_OK
,
"expected S_OK, got 0x%08lx
\n
"
,
hr
);
ok
(
height
>
0
,
"expected height > 0
\n
"
);
}
void
test_ScriptGetGlyphABCWidth
(
HDC
hdc
)
{
HRESULT
hr
;
LOGFONTA
lf
;
HFONT
hfont
;
SCRIPT_CACHE
sc
=
NULL
;
ABC
abc
;
memset
(
&
lf
,
0
,
sizeof
(
lf
));
lstrcpyA
(
lf
.
lfFaceName
,
"Symbol"
);
hfont
=
CreateFontIndirectA
(
&
lf
);
hfont
=
SelectObject
(
hdc
,
hfont
);
hr
=
ScriptGetGlyphABCWidth
(
NULL
,
NULL
,
'a'
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"expected E_INVALIDARG, got 0x%08lx
\n
"
,
hr
);
hr
=
ScriptGetGlyphABCWidth
(
NULL
,
&
sc
,
'a'
,
NULL
);
ok
(
hr
==
E_PENDING
,
"expected E_PENDING, got 0x%08lx
\n
"
,
hr
);
if
(
0
)
{
/* crashes on WinXP */
hr
=
ScriptGetGlyphABCWidth
(
hdc
,
&
sc
,
'a'
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"expected E_INVALIDARG, got 0x%08lx
\n
"
,
hr
);
}
hr
=
ScriptGetGlyphABCWidth
(
hdc
,
&
sc
,
'a'
,
&
abc
);
ok
(
hr
==
S_OK
,
"expected S_OK, got 0x%08lx
\n
"
,
hr
);
}
START_TEST
(
usp10
)
{
HWND
hwnd
;
...
...
@@ -646,6 +698,8 @@ START_TEST(usp10)
test_ScriptItemIzeShapePlace
(
hdc
,
pwOutGlyphs
);
test_ScriptGetCMap
(
hdc
,
pwOutGlyphs
);
test_ScriptCacheGetHeight
(
hdc
);
test_ScriptGetGlyphABCWidth
(
hdc
);
ReleaseDC
(
hwnd
,
hdc
);
DestroyWindow
(
hwnd
);
...
...
dlls/usp10/usp10.c
View file @
0c0ab500
...
...
@@ -914,3 +914,47 @@ HRESULT WINAPI ScriptCacheGetHeight(HDC hdc, SCRIPT_CACHE *psc, long *height)
*
height
=
metric
.
tmHeight
;
return
S_OK
;
}
/***********************************************************************
* ScriptGetGlyphABCWidth (USP10.@)
*
* Retrieve the width of a glyph.
*
* PARAMS
* hdc [I] Device context.
* psc [I/O] Opaque pointer to a script cache.
* glyph [I] Glyph to retrieve the width for.
* abc [O] ABC widths of the glyph.
*
* RETURNS
* Success: S_OK
* Failure: Non-zero HRESULT value.
*/
HRESULT
WINAPI
ScriptGetGlyphABCWidth
(
HDC
hdc
,
SCRIPT_CACHE
*
psc
,
WORD
glyph
,
ABC
*
abc
)
{
HDC
phdc
;
Scriptcache
*
pScriptcache
;
TRACE
(
"(%p, %p, 0x%04x, %p)
\n
"
,
hdc
,
psc
,
glyph
,
abc
);
if
(
!
psc
)
return
E_INVALIDARG
;
if
(
!
hdc
)
return
E_PENDING
;
if
(
!*
psc
)
{
pScriptcache
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
Scriptcache
));
pScriptcache
->
hdc
=
hdc
;
phdc
=
hdc
;
*
psc
=
pScriptcache
;
}
else
{
pScriptcache
=
*
psc
;
phdc
=
pScriptcache
->
hdc
;
}
/* FIXME: get this from the cache */
if
(
!
GetCharABCWidthsW
(
phdc
,
glyph
,
glyph
,
abc
))
return
E_HANDLE
;
return
S_OK
;
}
dlls/usp10/usp10.spec
View file @
0c0ab500
...
...
@@ -7,7 +7,7 @@
@ stdcall ScriptFreeCache(ptr)
@ stdcall ScriptGetCMap(ptr ptr ptr long long ptr)
@ stdcall ScriptGetFontProperties(long ptr ptr)
@ st
ub ScriptGetGlyphABCWidth
@ st
dcall ScriptGetGlyphABCWidth(ptr ptr long ptr)
@ stub ScriptGetLogicalWidths
@ stdcall ScriptGetProperties(ptr long)
@ stdcall ScriptIsComplex(wstr long long)
...
...
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