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
9c9513f9
Commit
9c9513f9
authored
Nov 14, 2011
by
Aric Stewart
Committed by
Alexandre Julliard
Nov 15, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
usp10: Break with a better understanding on the handling of bidi strengths.
parent
e43a185c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
11 deletions
+46
-11
bidi.c
dlls/usp10/bidi.c
+7
-3
usp10.c
dlls/usp10/usp10.c
+36
-8
usp10_internal.h
dlls/usp10/usp10_internal.h
+3
-0
No files found.
dlls/usp10/bidi.c
View file @
9c9513f9
...
...
@@ -901,7 +901,7 @@ BOOL BIDI_GetStrengths(LPCWSTR lpString, INT uCount, const SCRIPT_CONTROL *c,
case
AL
:
case
RLE
:
case
RLO
:
lpStrength
[
i
]
=
1
;
lpStrength
[
i
]
=
BIDI_STRONG
;
break
;
case
PDF
:
case
EN
:
...
...
@@ -910,10 +910,14 @@ BOOL BIDI_GetStrengths(LPCWSTR lpString, INT uCount, const SCRIPT_CONTROL *c,
case
AN
:
case
CS
:
case
BN
:
lpStrength
[
i
]
=
2
;
lpStrength
[
i
]
=
BIDI_WEAK
;
break
;
case
B
:
case
S
:
case
WS
:
case
ON
:
default:
/* Neutrals and NSM */
lpStrength
[
i
]
=
0
;
lpStrength
[
i
]
=
BIDI_NEUTRAL
;
}
}
return
TRUE
;
...
...
dlls/usp10/usp10.c
View file @
9c9513f9
...
...
@@ -805,6 +805,7 @@ HRESULT WINAPI ScriptItemizeOpenType(const WCHAR *pwcInChars, int cInChars, int
WORD
*
levels
=
NULL
;
WORD
*
strength
=
NULL
;
WORD
baselevel
=
0
;
BOOL
new_run
;
TRACE
(
"%s,%d,%d,%p,%p,%p,%p
\n
"
,
debugstr_wn
(
pwcInChars
,
cInChars
),
cInChars
,
cMaxItems
,
psControl
,
psState
,
pItems
,
pcItems
);
...
...
@@ -876,10 +877,13 @@ HRESULT WINAPI ScriptItemizeOpenType(const WCHAR *pwcInChars, int cInChars, int
pItems
[
index
].
a
=
scriptInformation
[
get_char_script
(
pwcInChars
[
cnt
])].
a
;
pScriptTags
[
index
]
=
scriptInformation
[
get_char_script
(
pwcInChars
[
cnt
])].
scriptTag
;
if
(
strength
)
if
(
strength
&&
strength
[
cnt
]
==
BIDI_STRONG
)
str
=
strength
[
cnt
];
else
if
(
strength
)
str
=
strength
[
0
];
cnt
=
0
;
if
(
levels
)
{
pItems
[
index
].
a
.
fRTL
=
odd
(
levels
[
cnt
]);
...
...
@@ -899,9 +903,6 @@ HRESULT WINAPI ScriptItemizeOpenType(const WCHAR *pwcInChars, int cInChars, int
for
(
cnt
=
1
;
cnt
<
cInChars
;
cnt
++
)
{
if
(
levels
&&
(
levels
[
cnt
]
==
pItems
[
index
].
a
.
s
.
uBidiLevel
&&
(
!
strength
||
(
strength
[
cnt
]
==
0
||
strength
[
cnt
]
==
str
))))
continue
;
if
(
pwcInChars
[
cnt
]
!=
Numeric_space
&&
pwcInChars
[
cnt
]
!=
ZWJ
&&
pwcInChars
[
cnt
]
!=
ZWNJ
)
New_Script
=
get_char_script
(
pwcInChars
[
cnt
]);
else
if
(
levels
)
...
...
@@ -915,17 +916,44 @@ HRESULT WINAPI ScriptItemizeOpenType(const WCHAR *pwcInChars, int cInChars, int
New_Script
=
get_char_script
(
pwcInChars
[
cnt
]);
}
if
((
levels
&&
(
levels
[
cnt
]
!=
pItems
[
index
].
a
.
s
.
uBidiLevel
||
(
strength
&&
(
strength
[
cnt
]
!=
str
))))
||
(
New_Script
!=
-
1
&&
New_Script
!=
pItems
[
index
].
a
.
eScript
)
||
New_Script
==
Script_Control
)
new_run
=
FALSE
;
/* merge space strengths*/
if
(
strength
&&
strength
[
cnt
]
==
BIDI_STRONG
&&
str
!=
BIDI_STRONG
&&
New_Script
==
pItems
[
index
].
a
.
eScript
)
str
=
BIDI_STRONG
;
if
(
strength
&&
strength
[
cnt
]
==
BIDI_NEUTRAL
&&
str
==
BIDI_STRONG
&&
pwcInChars
[
cnt
]
!=
Numeric_space
&&
New_Script
==
pItems
[
index
].
a
.
eScript
)
str
=
BIDI_NEUTRAL
;
/* changes in level */
if
(
levels
&&
(
levels
[
cnt
]
!=
pItems
[
index
].
a
.
s
.
uBidiLevel
))
{
TRACE
(
"New_Level = %i, New_Strength = %i, New_Script=%d, eScript=%d
\n
"
,
levels
?
levels
[
cnt
]
:-
1
,
strength
?
strength
[
cnt
]
:
str
,
New_Script
,
pItems
[
index
].
a
.
eScript
);
TRACE
(
"Level break(%i/%i)
\n
"
,
pItems
[
index
].
a
.
s
.
uBidiLevel
,
levels
[
cnt
]);
new_run
=
TRUE
;
}
/* changes in strength */
else
if
(
strength
&&
pwcInChars
[
cnt
]
!=
Numeric_space
&&
str
!=
strength
[
cnt
])
{
TRACE
(
"Strength break (%i/%i)
\n
"
,
str
,
strength
[
cnt
]);
new_run
=
TRUE
;
}
/* changes in script */
else
if
((
!
levels
)
&&
(((
pwcInChars
[
cnt
]
!=
Numeric_space
)
&&
(
New_Script
!=
-
1
)
&&
(
New_Script
!=
pItems
[
index
].
a
.
eScript
))
||
(
New_Script
==
Script_Control
)))
{
TRACE
(
"Script break(%i/%i)
\n
"
,
pItems
[
index
].
a
.
eScript
,
New_Script
);
new_run
=
TRUE
;
}
if
(
strength
&&
strength
[
cnt
]
!=
0
)
str
=
strength
[
cnt
];
if
(
new_run
)
{
TRACE
(
"New_Level = %i, New_Strength = %i, New_Script=%d, eScript=%d
\n
"
,
levels
?
levels
[
cnt
]
:-
1
,
strength
?
strength
[
cnt
]
:
str
,
New_Script
,
pItems
[
index
].
a
.
eScript
);
index
++
;
if
(
index
+
1
>
cMaxItems
)
return
E_OUTOFMEMORY
;
if
(
strength
)
str
=
strength
[
cnt
];
pItems
[
index
].
iCharPos
=
cnt
;
memset
(
&
pItems
[
index
].
a
,
0
,
sizeof
(
SCRIPT_ANALYSIS
));
...
...
dlls/usp10/usp10_internal.h
View file @
9c9513f9
...
...
@@ -122,6 +122,9 @@ typedef int (*lexical_function)(WCHAR c);
typedef
void
(
*
reorder_function
)(
LPWSTR
pwChar
,
IndicSyllable
*
syllable
,
lexical_function
lex
);
#define odd(x) ((x) & 1)
#define BIDI_STRONG 1
#define BIDI_WEAK 2
#define BIDI_NEUTRAL 0
BOOL
BIDI_DetermineLevels
(
LPCWSTR
lpString
,
INT
uCount
,
const
SCRIPT_STATE
*
s
,
const
SCRIPT_CONTROL
*
c
,
WORD
*
lpOutLevels
)
DECLSPEC_HIDDEN
;
...
...
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