Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
6fb71f53
Commit
6fb71f53
authored
Oct 17, 2011
by
Aric Stewart
Committed by
Alexandre Julliard
Oct 18, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
usp10: Break out get_cluster_size and use it to correct ScriptStringGetLogicalWidths for clusters.
parent
013f5a9b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
27 deletions
+42
-27
usp10.c
dlls/usp10/usp10.c
+42
-27
No files found.
dlls/usp10/usp10.c
View file @
6fb71f53
...
@@ -1617,6 +1617,30 @@ HRESULT WINAPI ScriptStringFree(SCRIPT_STRING_ANALYSIS *pssa)
...
@@ -1617,6 +1617,30 @@ HRESULT WINAPI ScriptStringFree(SCRIPT_STRING_ANALYSIS *pssa)
return
S_OK
;
return
S_OK
;
}
}
static
inline
int
get_cluster_size
(
const
WORD
*
pwLogClust
,
int
cChars
,
int
item
,
int
direction
,
int
*
iCluster
,
int
*
check_out
)
{
int
clust_size
=
1
;
int
check
;
WORD
clust
=
pwLogClust
[
item
];
for
(
check
=
item
+
direction
;
check
<
cChars
&&
check
>=
0
;
check
+=
direction
)
{
if
(
pwLogClust
[
check
]
==
clust
)
{
clust_size
++
;
if
(
iCluster
&&
*
iCluster
==
-
1
)
*
iCluster
=
item
;
}
else
break
;
}
if
(
check_out
)
*
check_out
=
check
;
return
clust_size
;
}
/***********************************************************************
/***********************************************************************
* ScriptCPtoX (USP10.@)
* ScriptCPtoX (USP10.@)
*
*
...
@@ -1674,19 +1698,9 @@ HRESULT WINAPI ScriptCPtoX(int iCP,
...
@@ -1674,19 +1698,9 @@ HRESULT WINAPI ScriptCPtoX(int iCP,
int
check
;
int
check
;
int
clust
=
pwLogClust
[
item
];
int
clust
=
pwLogClust
[
item
];
clust_size
=
1
;
iCluster
=
-
1
;
iCluster
=
-
1
;
clust_size
=
get_cluster_size
(
pwLogClust
,
cChars
,
item
,
1
,
&
iCluster
,
for
(
check
=
item
+
1
;
check
<
cChars
;
check
++
)
&
check
);
{
if
(
pwLogClust
[
check
]
==
clust
)
{
clust_size
++
;
if
(
iCluster
==
-
1
)
iCluster
=
item
;
}
else
break
;
}
if
(
check
>=
cChars
&&
!
iMaxPos
)
if
(
check
>=
cChars
&&
!
iMaxPos
)
{
{
...
@@ -1812,20 +1826,10 @@ HRESULT WINAPI ScriptXtoCP(int iX,
...
@@ -1812,20 +1826,10 @@ HRESULT WINAPI ScriptXtoCP(int iX,
int
check
;
int
check
;
int
clust
=
pwLogClust
[
item
];
int
clust
=
pwLogClust
[
item
];
clust_size
=
1
;
iCluster
=
-
1
;
iCluster
=
-
1
;
cjump
=
0
;
cjump
=
0
;
clust_size
=
get_cluster_size
(
pwLogClust
,
cChars
,
item
,
direction
,
for
(
check
=
item
+
direction
;
check
<
cChars
&&
check
>=
0
;
check
+=
direction
)
&
iCluster
,
&
check
);
{
if
(
pwLogClust
[
check
]
==
clust
)
{
clust_size
++
;
if
(
iCluster
==
-
1
)
iCluster
=
item
;
}
else
break
;
}
if
(
check
>=
cChars
&&
direction
>
0
)
if
(
check
>=
cChars
&&
direction
>
0
)
{
{
...
@@ -2569,12 +2573,23 @@ HRESULT WINAPI ScriptStringGetLogicalWidths(SCRIPT_STRING_ANALYSIS ssa, int *piD
...
@@ -2569,12 +2573,23 @@ HRESULT WINAPI ScriptStringGetLogicalWidths(SCRIPT_STRING_ANALYSIS ssa, int *piD
for
(
i
=
0
;
i
<
analysis
->
numItems
;
i
++
)
for
(
i
=
0
;
i
<
analysis
->
numItems
;
i
++
)
{
{
int
cChar
=
analysis
->
pItem
[
i
+
1
].
iCharPos
-
analysis
->
pItem
[
i
].
iCharPos
;
int
cChar
=
analysis
->
pItem
[
i
+
1
].
iCharPos
-
analysis
->
pItem
[
i
].
iCharPos
;
int
direction
=
1
;
if
(
analysis
->
pItem
[
i
].
a
.
fRTL
&&
!
analysis
->
pItem
[
i
].
a
.
fLogicalOrder
)
direction
=
-
1
;
for
(
j
=
0
;
j
<
cChar
;
j
++
)
for
(
j
=
0
;
j
<
cChar
;
j
++
)
{
{
int
k
;
int
glyph
=
analysis
->
glyphs
[
i
].
pwLogClust
[
j
];
int
glyph
=
analysis
->
glyphs
[
i
].
pwLogClust
[
j
];
piDx
[
next
]
=
analysis
->
glyphs
[
i
].
piAdvance
[
glyph
];
int
clust_size
=
get_cluster_size
(
analysis
->
glyphs
[
i
].
pwLogClust
,
next
++
;
cChar
,
j
,
direction
,
NULL
,
NULL
);
for
(
k
=
0
;
k
<
clust_size
;
k
++
)
{
piDx
[
next
]
=
analysis
->
glyphs
[
i
].
piAdvance
[
glyph
]
/
clust_size
;
next
++
;
if
(
k
)
j
++
;
}
}
}
}
}
return
S_OK
;
return
S_OK
;
...
...
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