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
7868be6e
Commit
7868be6e
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: Properly set LayoutRTL.
parent
e5d33f08
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
8 deletions
+21
-8
usp10.c
dlls/usp10/tests/usp10.c
+5
-5
usp10.c
dlls/usp10/usp10.c
+16
-3
No files found.
dlls/usp10/tests/usp10.c
View file @
7868be6e
...
...
@@ -148,13 +148,13 @@ static void test_ScriptItemize( void )
static
const
WCHAR
test1c
[]
=
{
' '
,
' '
,
' '
,
'1'
,
'2'
,
' '
,
0
};
static
const
itemTest
t1c1
[
2
]
=
{{{
0
,
0
,
0
,
0
,
0
},
0
,
0
,
0
,
0
,
0
},{{
0
,
0
,
0
,
0
,
0
},
6
,
0
,
0
,
0
,
-
1
}};
static
const
itemTest
t1c2
[
4
]
=
{{{
0
,
0
,
0
,
0
,
0
},
0
,
1
,
1
,
1
,
0
},{{
0
,
0
,
1
,
0
,
0
},
3
,
0
,
1
,
2
,
0
},{{
0
,
0
,
0
,
0
,
0
},
5
,
1
,
1
,
1
,
0
},{{
0
,
0
,
0
,
0
,
0
},
6
,
0
,
0
,
0
,
-
1
}};
static
const
itemTest
t1c2
[
4
]
=
{{{
0
,
0
,
0
,
0
,
0
},
0
,
1
,
1
,
1
,
0
},{{
0
,
0
,
0
,
0
,
0
},
3
,
0
,
1
,
2
,
0
},{{
0
,
0
,
0
,
0
,
0
},
5
,
1
,
1
,
1
,
0
},{{
0
,
0
,
0
,
0
,
0
},
6
,
0
,
0
,
0
,
-
1
}};
/* Arabic, English*/
static
const
WCHAR
test2
[]
=
{
'1'
,
'2'
,
'3'
,
'-'
,
'5'
,
'2'
,
0x064a
,
0x064f
,
0x0633
,
0x0627
,
0x0648
,
0x0650
,
0x064a
,
'7'
,
'1'
,
'.'
,
0
};
static
const
itemTest
t21
[
7
]
=
{{{
0
,
0
,
0
,
0
,
0
},
0
,
0
,
0
,
0
,
0
},{{
0
,
0
,
0
,
0
,
0
},
3
,
0
,
0
,
0
,
0
},{{
0
,
0
,
0
,
0
,
0
},
4
,
0
,
0
,
0
,
0
},{{
0
,
0
,
0
,
0
,
0
},
6
,
1
,
1
,
1
,
arab_tag
},{{
0
,
0
,
0
,
0
,
0
},
13
,
0
,
0
,
0
,
0
},{{
0
,
0
,
0
,
0
,
0
},
15
,
0
,
0
,
0
,
0
},{{
0
,
0
,
0
,
0
,
0
},
16
,
0
,
0
,
0
,
-
1
}};
static
const
itemTest
t22
[
5
]
=
{{{
0
,
0
,
0
,
0
,
0
},
0
,
0
,
0
,
2
,
0
},{{
0
,
0
,
0
,
0
,
0
},
6
,
1
,
1
,
1
,
arab_tag
},{{
0
,
0
,
1
,
0
,
0
},
13
,
0
,
1
,
2
,
0
},{{
0
,
0
,
0
,
0
,
0
},
15
,
0
,
0
,
0
,
0
},{{
0
,
0
,
0
,
0
,
0
},
16
,
0
,
0
,
0
,
-
1
}};
static
const
itemTest
t23
[
5
]
=
{{{
0
,
0
,
1
,
0
,
0
},
0
,
0
,
1
,
2
,
0
},{{
0
,
0
,
0
,
0
,
0
},
6
,
1
,
1
,
1
,
arab_tag
},{{
0
,
0
,
1
,
0
,
0
},
13
,
0
,
1
,
2
,
0
},{{
0
,
0
,
0
,
0
,
0
},
15
,
1
,
1
,
1
,
0
},{{
0
,
0
,
0
,
0
,
0
},
16
,
0
,
0
,
0
,
-
1
}};
static
const
itemTest
t22
[
5
]
=
{{{
0
,
0
,
0
,
0
,
0
},
0
,
0
,
0
,
2
,
0
},{{
0
,
0
,
0
,
0
,
0
},
6
,
1
,
1
,
1
,
arab_tag
},{{
0
,
0
,
0
,
0
,
0
},
13
,
0
,
1
,
2
,
0
},{{
0
,
0
,
0
,
0
,
0
},
15
,
0
,
0
,
0
,
0
},{{
0
,
0
,
0
,
0
,
0
},
16
,
0
,
0
,
0
,
-
1
}};
static
const
itemTest
t23
[
5
]
=
{{{
0
,
0
,
0
,
0
,
0
},
0
,
0
,
1
,
2
,
0
},{{
0
,
0
,
0
,
0
,
0
},
6
,
1
,
1
,
1
,
arab_tag
},{{
0
,
0
,
0
,
0
,
0
},
13
,
0
,
1
,
2
,
0
},{{
0
,
0
,
0
,
0
,
0
},
15
,
1
,
1
,
1
,
0
},{{
0
,
0
,
0
,
0
,
0
},
16
,
0
,
0
,
0
,
-
1
}};
static
const
WCHAR
test2b
[]
=
{
'A'
,
'B'
,
'C'
,
'-'
,
'D'
,
'E'
,
'F'
,
' '
,
0x0621
,
0x0623
,
0x0624
,
0
};
static
const
itemTest
t2b1
[
5
]
=
{{{
0
,
0
,
0
,
0
,
0
},
0
,
0
,
0
,
0
,
latn_tag
},{{
0
,
0
,
0
,
0
,
0
},
3
,
0
,
0
,
0
,
0
},{{
0
,
0
,
0
,
0
,
0
},
4
,
0
,
0
,
0
,
latn_tag
},{{
0
,
0
,
0
,
0
,
0
},
8
,
1
,
1
,
1
,
arab_tag
},{{
0
,
0
,
0
,
0
,
0
},
11
,
0
,
0
,
0
,
-
1
}};
...
...
@@ -188,8 +188,8 @@ static void test_ScriptItemize( void )
static
const
WCHAR
test4
[]
=
{
'1'
,
'2'
,
'3'
,
'-'
,
'5'
,
'2'
,
' '
,
'i'
,
's'
,
' '
,
'7'
,
'1'
,
'.'
,
0
};
static
const
itemTest
t41
[
6
]
=
{{{
0
,
0
,
0
,
0
,
0
},
0
,
0
,
0
,
0
,
0
},{{
0
,
0
,
0
,
0
,
0
},
3
,
0
,
0
,
0
,
0
},{{
0
,
0
,
0
,
0
,
0
},
4
,
0
,
0
,
0
,
0
},{{
0
,
0
,
0
,
0
,
0
},
7
,
0
,
0
,
0
,
latn_tag
},{{
0
,
0
,
0
,
0
,
0
},
10
,
0
,
0
,
0
,
0
},{{
0
,
0
,
0
,
0
,
0
},
12
,
0
,
0
,
0
,
-
1
}};
static
const
itemTest
t42
[
5
]
=
{{{
0
,
0
,
1
,
0
,
0
},
0
,
0
,
1
,
2
,
0
},{{
0
,
0
,
0
,
0
,
0
},
6
,
1
,
1
,
1
,
0
},{{
0
,
0
,
0
,
0
,
0
},
7
,
0
,
0
,
2
,
latn_tag
},{{
0
,
0
,
0
,
0
,
0
},
10
,
0
,
0
,
2
,
0
},{{
0
,
0
,
0
,
0
,
0
},
12
,
0
,
0
,
0
,
-
1
}};
static
const
itemTest
t43
[
4
]
=
{{{
0
,
0
,
1
,
0
,
0
},
0
,
0
,
1
,
2
,
0
},{{
0
,
0
,
0
,
0
,
0
},
6
,
1
,
1
,
1
,
0
},{{
0
,
0
,
0
,
0
,
0
},
7
,
0
,
0
,
2
,
latn_tag
},{{
0
,
0
,
0
,
0
,
0
},
12
,
0
,
0
,
0
,
-
1
}};
static
const
itemTest
t42
[
5
]
=
{{{
0
,
0
,
0
,
0
,
0
},
0
,
0
,
1
,
2
,
0
},{{
0
,
0
,
0
,
0
,
0
},
6
,
1
,
1
,
1
,
0
},{{
0
,
0
,
0
,
0
,
0
},
7
,
0
,
0
,
2
,
latn_tag
},{{
0
,
0
,
0
,
0
,
0
},
10
,
0
,
0
,
2
,
0
},{{
0
,
0
,
0
,
0
,
0
},
12
,
0
,
0
,
0
,
-
1
}};
static
const
itemTest
t43
[
4
]
=
{{{
0
,
0
,
0
,
0
,
0
},
0
,
0
,
1
,
2
,
0
},{{
0
,
0
,
0
,
0
,
0
},
6
,
1
,
1
,
1
,
0
},{{
0
,
0
,
0
,
0
,
0
},
7
,
0
,
0
,
2
,
latn_tag
},{{
0
,
0
,
0
,
0
,
0
},
12
,
0
,
0
,
0
,
-
1
}};
/* Arabic */
static
const
WCHAR
test5
[]
=
...
...
dlls/usp10/usp10.c
View file @
7868be6e
...
...
@@ -814,6 +814,7 @@ HRESULT WINAPI ScriptItemizeOpenType(const WCHAR *pwcInChars, int cInChars, int
WORD
baselevel
=
0
;
BOOL
new_run
;
WORD
last_indic
=
-
1
;
WORD
layoutRTL
=
0
;
TRACE
(
"%s,%d,%d,%p,%p,%p,%p
\n
"
,
debugstr_wn
(
pwcInChars
,
cInChars
),
cInChars
,
cMaxItems
,
psControl
,
psState
,
pItems
,
pcItems
);
...
...
@@ -948,12 +949,14 @@ HRESULT WINAPI ScriptItemizeOpenType(const WCHAR *pwcInChars, int cInChars, int
if
(
levels
)
{
layoutRTL
=
(
psState
->
uBidiLevel
||
odd
(
levels
[
cnt
]))
?
1
:
0
;
pItems
[
index
].
a
.
fRTL
=
odd
(
levels
[
cnt
]);
pItems
[
index
].
a
.
fLayoutRTL
=
odd
(
levels
[
cnt
])
;
pItems
[
index
].
a
.
fLayoutRTL
=
layoutRTL
;
pItems
[
index
].
a
.
s
.
uBidiLevel
=
levels
[
cnt
];
}
else
if
(
!
pItems
[
index
].
a
.
s
.
uBidiLevel
)
{
layoutRTL
=
(
odd
(
baselevel
))
?
1
:
0
;
pItems
[
index
].
a
.
s
.
uBidiLevel
=
baselevel
;
pItems
[
index
].
a
.
fLayoutRTL
=
odd
(
baselevel
);
pItems
[
index
].
a
.
fRTL
=
odd
(
baselevel
);
...
...
@@ -1005,6 +1008,12 @@ HRESULT WINAPI ScriptItemizeOpenType(const WCHAR *pwcInChars, int cInChars, int
new_run
=
TRUE
;
}
if
(
!
new_run
&&
strength
&&
str
==
BIDI_STRONG
)
{
layoutRTL
=
odd
(
levels
[
cnt
])
?
1
:
0
;
pItems
[
index
].
a
.
fLayoutRTL
=
layoutRTL
;
}
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
);
...
...
@@ -1023,14 +1032,18 @@ HRESULT WINAPI ScriptItemizeOpenType(const WCHAR *pwcInChars, int cInChars, int
pScriptTags
[
index
]
=
scriptInformation
[
New_Script
].
scriptTag
;
if
(
levels
)
{
if
(
levels
[
cnt
]
==
0
)
layoutRTL
=
0
;
else
layoutRTL
=
(
layoutRTL
||
odd
(
levels
[
cnt
]))
?
1
:
0
;
pItems
[
index
].
a
.
fRTL
=
odd
(
levels
[
cnt
]);
pItems
[
index
].
a
.
fLayoutRTL
=
odd
(
levels
[
cnt
])
;
pItems
[
index
].
a
.
fLayoutRTL
=
layoutRTL
;
pItems
[
index
].
a
.
s
.
uBidiLevel
=
levels
[
cnt
];
}
else
if
(
!
pItems
[
index
].
a
.
s
.
uBidiLevel
)
{
pItems
[
index
].
a
.
s
.
uBidiLevel
=
baselevel
;
pItems
[
index
].
a
.
fLayoutRTL
=
odd
(
baselevel
)
;
pItems
[
index
].
a
.
fLayoutRTL
=
layoutRTL
;
pItems
[
index
].
a
.
fRTL
=
odd
(
baselevel
);
}
...
...
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