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
a05e712c
Commit
a05e712c
authored
Feb 21, 2006
by
Jeff Latimer
Committed by
Alexandre Julliard
Feb 21, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
usp10: Add ScriptPlace funtionality.
The key function is to calculate the total of the ABC widths of the characters converted to gylphs by ScriptShape.
parent
0c12e266
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
4 deletions
+57
-4
usp10.c
dlls/usp10/tests/usp10.c
+2
-2
usp10.c
dlls/usp10/usp10.c
+55
-2
No files found.
dlls/usp10/tests/usp10.c
View file @
a05e712c
...
@@ -148,7 +148,7 @@ START_TEST(usp10)
...
@@ -148,7 +148,7 @@ START_TEST(usp10)
if
(
hr
==
0
)
{
if
(
hr
==
0
)
{
hr
=
ScriptPlace
(
NULL
,
&
psc
,
pwOutGlyphs
,
pcGlyphs
,
psva
,
&
pItem
[
0
].
a
,
piAdvance
,
hr
=
ScriptPlace
(
NULL
,
&
psc
,
pwOutGlyphs
,
pcGlyphs
,
psva
,
&
pItem
[
0
].
a
,
piAdvance
,
pGoffset
,
pABC
);
pGoffset
,
pABC
);
todo_wine
ok
(
hr
==
0
,
"Should return 0 not (%08x)
\n
"
,
(
unsigned
int
)
hr
);
ok
(
hr
==
0
,
"Should return 0 not (%08x)
\n
"
,
(
unsigned
int
)
hr
);
}
}
/* This test will check to make sure that SCRIPT_CACHE is reused and that not translation *
/* This test will check to make sure that SCRIPT_CACHE is reused and that not translation *
...
@@ -182,7 +182,7 @@ START_TEST(usp10)
...
@@ -182,7 +182,7 @@ START_TEST(usp10)
if
(
hr
==
0
)
{
if
(
hr
==
0
)
{
hr
=
ScriptPlace
(
NULL
,
&
psc
,
pwOutGlyphs
,
pcGlyphs
,
psva
,
&
pItem
[
0
].
a
,
piAdvance
,
hr
=
ScriptPlace
(
NULL
,
&
psc
,
pwOutGlyphs
,
pcGlyphs
,
psva
,
&
pItem
[
0
].
a
,
piAdvance
,
pGoffset
,
pABC
);
pGoffset
,
pABC
);
todo_wine
ok
(
hr
==
0
,
"ScriptPlace should return 0 not (%08x)
\n
"
,
(
unsigned
int
)
hr
);
ok
(
hr
==
0
,
"ScriptPlace should return 0 not (%08x)
\n
"
,
(
unsigned
int
)
hr
);
}
}
}
}
hr
=
ScriptFreeCache
(
&
psc
);
hr
=
ScriptFreeCache
(
&
psc
);
...
...
dlls/usp10/usp10.c
View file @
a05e712c
...
@@ -368,12 +368,65 @@ HRESULT WINAPI ScriptPlace(HDC hdc, SCRIPT_CACHE *psc, const WORD *pwGlyphs,
...
@@ -368,12 +368,65 @@ HRESULT WINAPI ScriptPlace(HDC hdc, SCRIPT_CACHE *psc, const WORD *pwGlyphs,
int
cGlyphs
,
const
SCRIPT_VISATTR
*
psva
,
int
cGlyphs
,
const
SCRIPT_VISATTR
*
psva
,
SCRIPT_ANALYSIS
*
psa
,
int
*
piAdvance
,
GOFFSET
*
pGoffset
,
ABC
*
pABC
)
SCRIPT_ANALYSIS
*
psa
,
int
*
piAdvance
,
GOFFSET
*
pGoffset
,
ABC
*
pABC
)
{
{
FIXME
(
"(%p,%p,%p,%s,%d, %p, %p, %p): stub
\n
"
,
hdc
,
psc
,
pwGlyphs
,
HDC
phdc
;
int
wcnt
;
LPABC
lpABC
;
Scriptcache
*
pScriptcache
;
FIXME
(
"(%p, %p, %p, %s, %d, %p, %p, %p): semi-stub
\n
"
,
hdc
,
psc
,
pwGlyphs
,
debugstr_w
(
pwGlyphs
),
debugstr_w
(
pwGlyphs
),
cGlyphs
,
psva
,
psa
,
cGlyphs
,
psva
,
psa
,
piAdvance
);
piAdvance
);
return
E_NOTIMPL
;
/* We need a valid hdc to do any of the font calls. The spec says that hdc is optional and
* psc will be used first. If psc and hdc are not specified E_PENDING is returned to get
* the caller to return the hdc. For convience, the hdc is cached in SCRIPT_CACHE. */
if
(
!
hdc
&&
!*
psc
)
{
TRACE
(
"No Script_Cache (psc) and no hdc. Ask for one. Hdc=%p, psc=%p
\n
"
,
hdc
,
*
psc
);
return
E_PENDING
;
}
else
if
(
hdc
&&
!*
psc
)
{
pScriptcache
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
Scriptcache
)
);
pScriptcache
->
hdc
=
hdc
;
phdc
=
hdc
;
*
psc
=
pScriptcache
;
}
else
if
(
*
psc
)
{
pScriptcache
=
*
psc
;
phdc
=
pScriptcache
->
hdc
;
}
/* Here we need to calculate the width of the run unit. At this point the input string
* has been converted to glyphs and we till need to translate back to the original chars
* to get the correct ABC widths. To make life easier the ABC widths are saved in the
* SCRIPT_CACHE. This is ok as the cache must be invalidated if the font or font size
* changes. */
lpABC
=
pScriptcache
->
CharWidths
;
pABC
->
abcA
=
0
;
pABC
->
abcB
=
0
;
pABC
->
abcC
=
0
;
if
(
!
pScriptcache
->
HaveWidths
)
{
if
(
GetCharABCWidthsW
(
phdc
,
0
,
255
,
lpABC
))
pScriptcache
->
HaveWidths
=
1
;
else
{
WARN
(
"Could not get ABC values
\n
"
);
}
}
for
(
wcnt
=
0
;
wcnt
<
cGlyphs
;
wcnt
++
)
{
/* add up the char lengths */
TRACE
(
" Glyph=%04x, abcA=%d, abcB=%d, abcC=%d wcnt=%d
\n
"
,
pwGlyphs
[
wcnt
],
lpABC
[
pScriptcache
->
GlyphToChar
[
pwGlyphs
[
wcnt
]]].
abcA
,
lpABC
[
pScriptcache
->
GlyphToChar
[
pwGlyphs
[
wcnt
]]].
abcB
,
lpABC
[
pScriptcache
->
GlyphToChar
[
pwGlyphs
[
wcnt
]]].
abcC
,
wcnt
);
pABC
->
abcA
+=
lpABC
[
pScriptcache
->
GlyphToChar
[
pwGlyphs
[
wcnt
]]].
abcA
;
pABC
->
abcB
+=
lpABC
[
pScriptcache
->
GlyphToChar
[
pwGlyphs
[
wcnt
]]].
abcB
;
pABC
->
abcC
+=
lpABC
[
pScriptcache
->
GlyphToChar
[
pwGlyphs
[
wcnt
]]].
abcC
;
}
TRACE
(
"Total for run: abcA=%d, abcB=%d, abcC=%d
\n
"
,
pABC
->
abcA
,
pABC
->
abcB
,
pABC
->
abcC
);
return
0
;
}
}
/***********************************************************************
/***********************************************************************
...
...
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