Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
0c0ab500
Commit
0c0ab500
authored
18 years ago
by
Hans Leidekker
Committed by
Alexandre Julliard
18 years ago
Browse files
Options
Downloads
Patches
Plain Diff
usp10: Implement ScriptGetGlyphABCWidth.
Add a test for ScriptGetGlyphABCWidth and ScriptCacheGetHeight.
parent
08484ba4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dlls/usp10/tests/usp10.c
+54
-0
54 additions, 0 deletions
dlls/usp10/tests/usp10.c
dlls/usp10/usp10.c
+44
-0
44 additions, 0 deletions
dlls/usp10/usp10.c
dlls/usp10/usp10.spec
+1
-1
1 addition, 1 deletion
dlls/usp10/usp10.spec
with
99 additions
and
1 deletion
dlls/usp10/tests/usp10.c
+
54
−
0
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
);
...
...
This diff is collapsed.
Click to expand it.
dlls/usp10/usp10.c
+
44
−
0
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
;
}
This diff is collapsed.
Click to expand it.
dlls/usp10/usp10.spec
+
1
−
1
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)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment