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
f026616c
Commit
f026616c
authored
Mar 18, 2011
by
Aric Stewart
Committed by
Alexandre Julliard
Mar 28, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
usp10: Rewrite ScriptStringXtoCP to make use of ScriptXtoCP.
parent
d7ea24d5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
20 deletions
+26
-20
usp10.c
dlls/usp10/usp10.c
+26
-20
No files found.
dlls/usp10/usp10.c
View file @
f026616c
...
...
@@ -991,14 +991,11 @@ HRESULT WINAPI ScriptStringCPtoX(SCRIPT_STRING_ANALYSIS ssa, int icp, BOOL fTrai
* ScriptStringXtoCP (USP10.@)
*
*/
HRESULT
WINAPI
ScriptStringXtoCP
(
SCRIPT_STRING_ANALYSIS
ssa
,
int
iX
,
int
*
piCh
,
int
*
piTrailing
)
HRESULT
WINAPI
ScriptStringXtoCP
(
SCRIPT_STRING_ANALYSIS
ssa
,
int
iX
,
int
*
piCh
,
int
*
piTrailing
)
{
StringAnalysis
*
analysis
=
ssa
;
int
i
;
int
j
;
int
runningX
=
0
;
int
runningCp
=
0
;
int
width
;
TRACE
(
"(%p), %d, (%p), (%p)
\n
"
,
ssa
,
iX
,
piCh
,
piTrailing
);
...
...
@@ -1022,24 +1019,33 @@ HRESULT WINAPI ScriptStringXtoCP(SCRIPT_STRING_ANALYSIS ssa, int iX, int* piCh,
for
(
i
=
0
;
i
<
analysis
->
numItems
;
i
++
)
{
for
(
j
=
0
;
j
<
analysis
->
glyphs
[
i
].
numGlyphs
;
j
++
)
int
CP
=
analysis
->
pItem
[
i
+
1
].
iCharPos
-
analysis
->
pItem
[
i
].
iCharPos
;
/* initialize max extents for uninitialized runs */
if
(
analysis
->
glyphs
[
i
].
iMaxPosX
==
-
1
)
{
width
=
analysis
->
glyphs
[
i
].
piAdvance
[
j
];
if
(
iX
<
(
runningX
+
width
))
{
*
piCh
=
runningCp
;
if
((
iX
-
runningX
)
>
width
/
2
)
*
piTrailing
=
TRUE
;
else
*
piTrailing
=
FALSE
;
if
(
analysis
->
pItem
[
i
].
a
.
fRTL
)
*
piTrailing
=
!*
piTrailing
;
return
S_OK
;
}
runningX
+=
width
;
runningCp
++
;
if
(
analysis
->
pItem
[
i
].
a
.
fRTL
)
ScriptCPtoX
(
0
,
FALSE
,
CP
,
analysis
->
glyphs
[
i
].
numGlyphs
,
analysis
->
glyphs
[
i
].
pwLogClust
,
analysis
->
glyphs
[
i
].
psva
,
analysis
->
glyphs
[
i
].
piAdvance
,
&
analysis
->
pItem
[
i
].
a
,
&
analysis
->
glyphs
[
i
].
iMaxPosX
);
else
ScriptCPtoX
(
CP
,
TRUE
,
CP
,
analysis
->
glyphs
[
i
].
numGlyphs
,
analysis
->
glyphs
[
i
].
pwLogClust
,
analysis
->
glyphs
[
i
].
psva
,
analysis
->
glyphs
[
i
].
piAdvance
,
&
analysis
->
pItem
[
i
].
a
,
&
analysis
->
glyphs
[
i
].
iMaxPosX
);
}
if
(
iX
>
analysis
->
glyphs
[
i
].
iMaxPosX
)
{
iX
-=
analysis
->
glyphs
[
i
].
iMaxPosX
;
runningCp
+=
CP
;
continue
;
}
ScriptXtoCP
(
iX
,
CP
,
analysis
->
glyphs
[
i
].
numGlyphs
,
analysis
->
glyphs
[
i
].
pwLogClust
,
analysis
->
glyphs
[
i
].
psva
,
analysis
->
glyphs
[
i
].
piAdvance
,
&
analysis
->
pItem
[
i
].
a
,
piCh
,
piTrailing
);
*
piCh
+=
runningCp
;
return
S_OK
;
}
/* out of range */
...
...
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