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
c93cfb4a
Commit
c93cfb4a
authored
Sep 06, 2023
by
Jeff Smith
Committed by
Alexandre Julliard
Sep 08, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Treat null character as NO_VISUAL in script analyzer.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=55529
parent
223ba990
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
122 additions
and
103 deletions
+122
-103
analyzer.c
dlls/dwrite/analyzer.c
+1
-1
analyzer.c
dlls/dwrite/tests/analyzer.c
+121
-102
No files found.
dlls/dwrite/analyzer.c
View file @
c93cfb4a
...
...
@@ -658,7 +658,7 @@ static DWRITE_SCRIPT_ANALYSIS get_char_sa(UINT32 c)
sa
.
script
=
get_char_script
(
c
);
sa
.
shapes
=
DWRITE_SCRIPT_SHAPES_DEFAULT
;
if
((
c
>=
0x0001
&&
c
<=
0x001f
)
/* C0 controls */
if
((
c
<=
0x001f
)
/* C0 controls */
||
(
c
>=
0x007f
&&
c
<=
0x009f
)
/* DELETE, C1 controls */
||
(
c
==
0x00ad
)
/* SOFT HYPHEN */
||
(
c
>=
0x200b
&&
c
<=
0x200f
)
/* ZWSP, ZWNJ, ZWJ, LRM, RLM */
...
...
dlls/dwrite/tests/analyzer.c
View file @
c93cfb4a
...
...
@@ -420,10 +420,10 @@ struct testanalysissource
};
static
void
init_textsource
(
struct
testanalysissource
*
source
,
const
WCHAR
*
text
,
DWRITE_READING_DIRECTION
direction
)
INT
text_length
,
DWRITE_READING_DIRECTION
direction
)
{
source
->
text
=
text
;
source
->
text_length
=
lstrlenW
(
text
)
;
source
->
text_length
=
text_length
==
-
1
?
lstrlenW
(
text
)
:
text_length
;
source
->
direction
=
direction
;
};
...
...
@@ -574,6 +574,7 @@ static IDWriteFontFace *create_testfontface(const WCHAR *filename)
struct
sa_test
{
const
WCHAR
string
[
50
];
int
str_len
;
int
item_count
;
struct
script_analysis
sa
[
10
];
};
...
...
@@ -581,29 +582,29 @@ struct sa_test {
static
struct
sa_test
sa_tests
[]
=
{
{
/* just 1 char string */
{
't'
,
0
},
1
,
{
't'
,
0
},
-
1
,
1
,
{
{
0
,
1
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
{
't'
,
'e'
,
's'
,
't'
,
0
},
1
,
{
't'
,
'e'
,
's'
,
't'
,
0
},
-
1
,
1
,
{
{
0
,
4
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
{
' '
,
' '
,
' '
,
' '
,
'!'
,
'$'
,
'['
,
'^'
,
'{'
,
'~'
,
0
},
1
,
{
' '
,
' '
,
' '
,
' '
,
'!'
,
'$'
,
'['
,
'^'
,
'{'
,
'~'
,
0
},
-
1
,
1
,
{
{
0
,
10
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
{
' '
,
' '
,
' '
,
'1'
,
'2'
,
' '
,
0
},
1
,
{
' '
,
' '
,
' '
,
'1'
,
'2'
,
' '
,
0
},
-
1
,
1
,
{
{
0
,
6
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* digits only */
{
'1'
,
'2'
,
0
},
1
,
{
'1'
,
'2'
,
0
},
-
1
,
1
,
{
{
0
,
2
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Arabic */
{
0x064a
,
0x064f
,
0x0633
,
0x0627
,
0x0648
,
0x0650
,
0x064a
,
0x0661
,
0
},
1
,
{
0x064a
,
0x064f
,
0x0633
,
0x0627
,
0x0648
,
0x0650
,
0x064a
,
0x0661
,
0
},
-
1
,
1
,
{
{
0
,
8
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
...
...
@@ -611,70 +612,70 @@ static struct sa_test sa_tests[] = {
{
0x0627
,
0x0644
,
0x0635
,
0x0651
,
0x0650
,
0x062d
,
0x0629
,
0x064f
,
' '
,
0x062a
,
0x064e
,
0x0627
,
0x062c
,
0x064c
,
' '
,
0x0639
,
0x064e
,
0x0644
,
0x0649
,
' '
,
0x0631
,
0x064f
,
0x0624
,
0x0648
,
0x0633
,
0x0650
,
' '
,
0x0627
,
0x0644
,
0x0623
,
0x0635
,
0x0650
,
0x062d
,
0x0651
,
0x064e
,
0x0627
,
0x0621
,
0x0650
,
0x06f0
,
0x06f5
,
0
},
1
,
0x0623
,
0x0635
,
0x0650
,
0x062d
,
0x0651
,
0x064e
,
0x0627
,
0x0621
,
0x0650
,
0x06f0
,
0x06f5
,
0
},
-
1
,
1
,
{
{
0
,
40
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Arabic, Latin */
{
'1'
,
'2'
,
'3'
,
'-'
,
'5'
,
'2'
,
0x064a
,
0x064f
,
0x0633
,
0x0627
,
0x0648
,
0x0650
,
0x064a
,
'7'
,
'1'
,
'.'
,
0
},
1
,
{
'1'
,
'2'
,
'3'
,
'-'
,
'5'
,
'2'
,
0x064a
,
0x064f
,
0x0633
,
0x0627
,
0x0648
,
0x0650
,
0x064a
,
'7'
,
'1'
,
'.'
,
0
},
-
1
,
1
,
{
{
0
,
16
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Arabic, English */
{
'A'
,
'B'
,
'C'
,
'-'
,
'D'
,
'E'
,
'F'
,
' '
,
0x0621
,
0x0623
,
0x0624
,
0
},
2
,
{
'A'
,
'B'
,
'C'
,
'-'
,
'D'
,
'E'
,
'F'
,
' '
,
0x0621
,
0x0623
,
0x0624
,
0
},
-
1
,
2
,
{
{
0
,
8
,
DWRITE_SCRIPT_SHAPES_DEFAULT
},
{
8
,
3
,
DWRITE_SCRIPT_SHAPES_DEFAULT
},
}
},
{
/* leading space, Arabic, English */
{
' '
,
0x0621
,
0x0623
,
0x0624
,
'A'
,
'B'
,
'C'
,
'-'
,
'D'
,
'E'
,
'F'
,
0
},
2
,
{
' '
,
0x0621
,
0x0623
,
0x0624
,
'A'
,
'B'
,
'C'
,
'-'
,
'D'
,
'E'
,
'F'
,
0
},
-
1
,
2
,
{
{
0
,
4
,
DWRITE_SCRIPT_SHAPES_DEFAULT
},
{
4
,
7
,
DWRITE_SCRIPT_SHAPES_DEFAULT
},
}
},
{
/* English, Arabic, trailing space */
{
'A'
,
'B'
,
'C'
,
'-'
,
'D'
,
'E'
,
'F'
,
0x0621
,
0x0623
,
0x0624
,
' '
,
0
},
2
,
{
'A'
,
'B'
,
'C'
,
'-'
,
'D'
,
'E'
,
'F'
,
0x0621
,
0x0623
,
0x0624
,
' '
,
0
},
-
1
,
2
,
{
{
0
,
7
,
DWRITE_SCRIPT_SHAPES_DEFAULT
},
{
7
,
4
,
DWRITE_SCRIPT_SHAPES_DEFAULT
},
}
},
{
/* C1 Controls, Latin-1 Supplement */
{
0x80
,
0x90
,
0x9f
,
0xa0
,
0xc0
,
0xb8
,
0xbf
,
0xc0
,
0xff
,
0
},
2
,
{
0x80
,
0x90
,
0x9f
,
0xa0
,
0xc0
,
0xb8
,
0xbf
,
0xc0
,
0xff
,
0
},
-
1
,
2
,
{
{
0
,
3
,
DWRITE_SCRIPT_SHAPES_NO_VISUAL
},
{
3
,
6
,
DWRITE_SCRIPT_SHAPES_DEFAULT
},
}
},
{
/* Latin Extended-A */
{
0x100
,
0x120
,
0x130
,
0x140
,
0x150
,
0x160
,
0x170
,
0x17f
,
0
},
1
,
{
0x100
,
0x120
,
0x130
,
0x140
,
0x150
,
0x160
,
0x170
,
0x17f
,
0
},
-
1
,
1
,
{
{
0
,
8
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Latin Extended-B */
{
0x180
,
0x190
,
0x1bf
,
0x1c0
,
0x1c3
,
0x1c4
,
0x1cc
,
0x1dc
,
0x1ff
,
0x217
,
0x21b
,
0x24f
,
0
},
1
,
{
0x180
,
0x190
,
0x1bf
,
0x1c0
,
0x1c3
,
0x1c4
,
0x1cc
,
0x1dc
,
0x1ff
,
0x217
,
0x21b
,
0x24f
,
0
},
-
1
,
1
,
{
{
0
,
12
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* IPA Extensions */
{
0x250
,
0x260
,
0x270
,
0x290
,
0x2af
,
0
},
1
,
{
0x250
,
0x260
,
0x270
,
0x290
,
0x2af
,
0
},
-
1
,
1
,
{
{
0
,
5
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Spacing Modifier Letters */
{
0x2b0
,
0x2ba
,
0x2d7
,
0x2dd
,
0x2ef
,
0x2ff
,
0
},
1
,
{
0x2b0
,
0x2ba
,
0x2d7
,
0x2dd
,
0x2ef
,
0x2ff
,
0
},
-
1
,
1
,
{
{
0
,
6
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Combining Diacritical Marks */
{
0x300
,
0x320
,
0x340
,
0x345
,
0x350
,
0x36f
,
0
},
1
,
{
0x300
,
0x320
,
0x340
,
0x345
,
0x350
,
0x36f
,
0
},
-
1
,
1
,
{
{
0
,
6
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Greek and Coptic */
{
0x370
,
0x388
,
0x3d8
,
0x3e1
,
0x3e2
,
0x3fa
,
0x3ff
,
0
},
3
,
{
0x370
,
0x388
,
0x3d8
,
0x3e1
,
0x3e2
,
0x3fa
,
0x3ff
,
0
},
-
1
,
3
,
{
{
0
,
4
,
DWRITE_SCRIPT_SHAPES_DEFAULT
},
{
4
,
1
,
DWRITE_SCRIPT_SHAPES_DEFAULT
},
{
5
,
2
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}
...
...
@@ -682,99 +683,99 @@ static struct sa_test sa_tests[] = {
},
{
/* Cyrillic and Cyrillic Supplement */
{
0x400
,
0x40f
,
0x410
,
0x44f
,
0x450
,
0x45f
,
0x460
,
0x481
,
0x48a
,
0x4f0
,
0x4fa
,
0x4ff
,
0x500
,
0x510
,
0x520
,
0
},
1
,
{
0x400
,
0x40f
,
0x410
,
0x44f
,
0x450
,
0x45f
,
0x460
,
0x481
,
0x48a
,
0x4f0
,
0x4fa
,
0x4ff
,
0x500
,
0x510
,
0x520
,
0
},
-
1
,
1
,
{
{
0
,
15
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Armenian */
{
0x531
,
0x540
,
0x559
,
0x55f
,
0x570
,
0x589
,
0x58a
,
0
},
1
,
{
0x531
,
0x540
,
0x559
,
0x55f
,
0x570
,
0x589
,
0x58a
,
0
},
-
1
,
1
,
{
{
0
,
7
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Hebrew */
{
0x5e9
,
0x5dc
,
0x5d5
,
0x5dd
,
0
},
1
,
{
0x5e9
,
0x5dc
,
0x5d5
,
0x5dd
,
0
},
-
1
,
1
,
{
{
0
,
4
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Latin, Hebrew, Latin */
{
'p'
,
'a'
,
'r'
,
't'
,
' '
,
'o'
,
'n'
,
'e'
,
' '
,
0x5d7
,
0x5dc
,
0x5e7
,
' '
,
0x5e9
,
0x5ea
,
0x5d9
,
0x5d9
,
0x5dd
,
' '
,
'p'
,
'a'
,
'r'
,
't'
,
' '
,
't'
,
'h'
,
'r'
,
'e'
,
'e'
,
0
},
3
,
{
'p'
,
'a'
,
'r'
,
't'
,
' '
,
'o'
,
'n'
,
'e'
,
' '
,
0x5d7
,
0x5dc
,
0x5e7
,
' '
,
0x5e9
,
0x5ea
,
0x5d9
,
0x5d9
,
0x5dd
,
' '
,
'p'
,
'a'
,
'r'
,
't'
,
' '
,
't'
,
'h'
,
'r'
,
'e'
,
'e'
,
0
},
-
1
,
3
,
{
{
0
,
9
,
DWRITE_SCRIPT_SHAPES_DEFAULT
},
{
9
,
10
,
DWRITE_SCRIPT_SHAPES_DEFAULT
},
{
19
,
10
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Syriac */
{
0x710
,
0x712
,
0x712
,
0x714
,
'.'
,
0
},
1
,
{
0x710
,
0x712
,
0x712
,
0x714
,
'.'
,
0
},
-
1
,
1
,
{
{
0
,
5
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Arabic Supplement */
{
0x750
,
0x760
,
0x76d
,
'.'
,
0
},
1
,
{
0x750
,
0x760
,
0x76d
,
'.'
,
0
},
-
1
,
1
,
{
{
0
,
4
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Thaana */
{
0x780
,
0x78e
,
0x798
,
0x7a6
,
0x7b0
,
'.'
,
0
},
1
,
{
0x780
,
0x78e
,
0x798
,
0x7a6
,
0x7b0
,
'.'
,
0
},
-
1
,
1
,
{
{
0
,
6
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* N'Ko */
{
0x7c0
,
0x7ca
,
0x7e8
,
0x7eb
,
0x7f6
,
'.'
,
0
},
1
,
{
0x7c0
,
0x7ca
,
0x7e8
,
0x7eb
,
0x7f6
,
'.'
,
0
},
-
1
,
1
,
{
{
0
,
6
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Thaana */
{
0x780
,
0x798
,
0x7a5
,
0x7a6
,
0x7b0
,
'.'
,
0
},
1
,
{
0x780
,
0x798
,
0x7a5
,
0x7a6
,
0x7b0
,
'.'
,
0
},
-
1
,
1
,
{
{
0
,
6
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Devanagari */
{
0x926
,
0x947
,
0x935
,
0x928
,
0x93e
,
0x917
,
0x930
,
0x940
,
'.'
,
0
},
1
,
{
0x926
,
0x947
,
0x935
,
0x928
,
0x93e
,
0x917
,
0x930
,
0x940
,
'.'
,
0
},
-
1
,
1
,
{
{
0
,
9
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Bengali */
{
0x9ac
,
0x9be
,
0x982
,
0x9b2
,
0x9be
,
'.'
,
0
},
1
,
{
0x9ac
,
0x9be
,
0x982
,
0x9b2
,
0x9be
,
'.'
,
0
},
-
1
,
1
,
{
{
0
,
6
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Gurmukhi */
{
0xa17
,
0xa41
,
0xa30
,
0xa2e
,
0xa41
,
0xa16
,
0xa40
,
'.'
,
0
},
1
,
{
0xa17
,
0xa41
,
0xa30
,
0xa2e
,
0xa41
,
0xa16
,
0xa40
,
'.'
,
0
},
-
1
,
1
,
{
{
0
,
8
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Gujarati */
{
0xa97
,
0xac1
,
0xa9c
,
0xab0
,
0xabe
,
0xaa4
,
0xac0
,
'.'
,
0
},
1
,
{
0xa97
,
0xac1
,
0xa9c
,
0xab0
,
0xabe
,
0xaa4
,
0xac0
,
'.'
,
0
},
-
1
,
1
,
{
{
0
,
8
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Oriya */
{
0xb13
,
0xb21
,
0xb3c
,
0xb3f
,
0xb06
,
'.'
,
0
},
1
,
{
0xb13
,
0xb21
,
0xb3c
,
0xb3f
,
0xb06
,
'.'
,
0
},
-
1
,
1
,
{
{
0
,
6
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Tamil */
{
0xba4
,
0xbae
,
0xbbf
,
0xbb4
,
0xbcd
,
'.'
,
0
},
1
,
{
0xba4
,
0xbae
,
0xbbf
,
0xbb4
,
0xbcd
,
'.'
,
0
},
-
1
,
1
,
{
{
0
,
6
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Telugu */
{
0xc24
,
0xc46
,
0xc32
,
0xc41
,
0xc17
,
0xc41
,
'.'
,
0
},
1
,
{
0xc24
,
0xc46
,
0xc32
,
0xc41
,
0xc17
,
0xc41
,
'.'
,
0
},
-
1
,
1
,
{
{
0
,
7
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Kannada */
{
0xc95
,
0xca8
,
0xccd
,
0xca8
,
0xca1
,
'.'
,
0
},
1
,
{
0xc95
,
0xca8
,
0xccd
,
0xca8
,
0xca1
,
'.'
,
0
},
-
1
,
1
,
{
{
0
,
6
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Malayalam */
{
0xd2e
,
0xd32
,
0xd2f
,
0xd3e
,
0xd33
,
0xd02
,
'.'
,
0
},
1
,
{
0xd2e
,
0xd32
,
0xd2f
,
0xd3e
,
0xd33
,
0xd02
,
'.'
,
0
},
-
1
,
1
,
{
{
0
,
7
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Sinhala */
{
0xd82
,
0xd85
,
0xd9a
,
0xdcf
,
'.'
,
0
},
1
,
{
0xd82
,
0xd85
,
0xd9a
,
0xdcf
,
'.'
,
0
},
-
1
,
1
,
{
{
0
,
5
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
...
...
@@ -782,226 +783,226 @@ static struct sa_test sa_tests[] = {
{
0x0e04
,
0x0e27
,
0x0e32
,
0x0e21
,
0x0e1e
,
0x0e22
,
0x0e32
,
0x0e22
,
0x0e32
,
0x0e21
,
0x0e2d
,
0x0e22
,
0x0e39
,
0x0e48
,
0x0e17
,
0x0e35
,
0x0e48
,
0x0e44
,
0x0e2b
,
0x0e19
,
0x0e04
,
0x0e27
,
0x0e32
,
0x0e21
,
0x0e2a
,
0x0e33
,
0x0e40
,
0x0e23
,
0x0e47
,
0x0e08
,
0x0e2d
,
0x0e22
,
0x0e39
,
0x0e48
,
0x0e17
,
0x0e35
,
0x0e48
,
0x0e19
,
0x0e31
,
0x0e48
,
0x0e19
,
'.'
,
0
},
1
,
0x0e2d
,
0x0e22
,
0x0e39
,
0x0e48
,
0x0e17
,
0x0e35
,
0x0e48
,
0x0e19
,
0x0e31
,
0x0e48
,
0x0e19
,
'.'
,
0
},
-
1
,
1
,
{
{
0
,
42
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Lao */
{
0xead
,
0xeb1
,
0xe81
,
0xeaa
,
0xead
,
0xe99
,
0xea5
,
0xeb2
,
0xea7
,
'.'
,
0
},
1
,
{
0xead
,
0xeb1
,
0xe81
,
0xeaa
,
0xead
,
0xe99
,
0xea5
,
0xeb2
,
0xea7
,
'.'
,
0
},
-
1
,
1
,
{
{
0
,
10
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Tibetan */
{
0xf04
,
0xf05
,
0xf0e
,
0x020
,
0xf51
,
0xf7c
,
0xf53
,
0xf0b
,
0xf5a
,
0xf53
,
0xf0b
,
0xf51
,
0xf44
,
0xf0b
,
0xf54
,
0xf7c
,
0xf0d
,
'.'
,
0
},
1
,
0xf51
,
0xf44
,
0xf0b
,
0xf54
,
0xf7c
,
0xf0d
,
'.'
,
0
},
-
1
,
1
,
{
{
0
,
18
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Myanmar */
{
0x1019
,
0x103c
,
0x1014
,
0x103a
,
0x1019
,
0x102c
,
0x1021
,
0x1000
,
0x1039
,
0x1001
,
0x101b
,
0x102c
,
'.'
,
0
},
1
,
{
0x1019
,
0x103c
,
0x1014
,
0x103a
,
0x1019
,
0x102c
,
0x1021
,
0x1000
,
0x1039
,
0x1001
,
0x101b
,
0x102c
,
'.'
,
0
},
-
1
,
1
,
{
{
0
,
13
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Georgian */
{
0x10a0
,
0x10d0
,
0x10da
,
0x10f1
,
0x10fb
,
0x2d00
,
'.'
,
0
},
1
,
{
0x10a0
,
0x10d0
,
0x10da
,
0x10f1
,
0x10fb
,
0x2d00
,
'.'
,
0
},
-
1
,
1
,
{
{
0
,
7
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Hangul */
{
0x1100
,
0x1110
,
0x1160
,
0x1170
,
0x11a8
,
'.'
,
0
},
1
,
{
0x1100
,
0x1110
,
0x1160
,
0x1170
,
0x11a8
,
'.'
,
0
},
-
1
,
1
,
{
{
0
,
6
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Ethiopic */
{
0x130d
,
0x12d5
,
0x12dd
,
0
},
1
,
{
0x130d
,
0x12d5
,
0x12dd
,
0
},
-
1
,
1
,
{
{
0
,
3
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Cherokee */
{
0x13e3
,
0x13b3
,
0x13a9
,
0x0020
,
0x13a6
,
0x13ec
,
0x13c2
,
0x13af
,
0x13cd
,
0x13d7
,
0
},
1
,
{
0x13e3
,
0x13b3
,
0x13a9
,
0x0020
,
0x13a6
,
0x13ec
,
0x13c2
,
0x13af
,
0x13cd
,
0x13d7
,
0
},
-
1
,
1
,
{
{
0
,
10
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Canadian */
{
0x1403
,
0x14c4
,
0x1483
,
0x144e
,
0x1450
,
0x1466
,
0
},
1
,
{
0x1403
,
0x14c4
,
0x1483
,
0x144e
,
0x1450
,
0x1466
,
0
},
-
1
,
1
,
{
{
0
,
6
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Ogham */
{
0x169b
,
0x1691
,
0x168c
,
0x1690
,
0x168b
,
0x169c
,
0
},
1
,
{
0x169b
,
0x1691
,
0x168c
,
0x1690
,
0x168b
,
0x169c
,
0
},
-
1
,
1
,
{
{
0
,
6
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Runic */
{
0x16a0
,
0x16a1
,
0x16a2
,
0x16a3
,
0x16a4
,
0x16a5
,
0
},
1
,
{
0x16a0
,
0x16a1
,
0x16a2
,
0x16a3
,
0x16a4
,
0x16a5
,
0
},
-
1
,
1
,
{
{
0
,
6
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Khmer */
{
0x1781
,
0x17c1
,
0x1798
,
0x179a
,
0x1797
,
0x17b6
,
0x179f
,
0x17b6
,
0x19e0
,
0
},
1
,
{
0x1781
,
0x17c1
,
0x1798
,
0x179a
,
0x1797
,
0x17b6
,
0x179f
,
0x17b6
,
0x19e0
,
0
},
-
1
,
1
,
{
{
0
,
9
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Mongolian */
{
0x182e
,
0x1823
,
0x1829
,
0x182d
,
0x1823
,
0x182f
,
0x0020
,
0x182a
,
0x1822
,
0x1834
,
0x1822
,
0x182d
,
0x180c
,
0
},
1
,
{
0x182e
,
0x1823
,
0x1829
,
0x182d
,
0x1823
,
0x182f
,
0x0020
,
0x182a
,
0x1822
,
0x1834
,
0x1822
,
0x182d
,
0x180c
,
0
},
-
1
,
1
,
{
{
0
,
13
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Limbu */
{
0x1900
,
0x1910
,
0x1920
,
0x1930
,
0
},
1
,
{
0x1900
,
0x1910
,
0x1920
,
0x1930
,
0
},
-
1
,
1
,
{
{
0
,
4
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Tai Le */
{
0x1956
,
0x196d
,
0x1970
,
0x1956
,
0x196c
,
0x1973
,
0x1951
,
0x1968
,
0x1952
,
0x1970
,
0
},
1
,
{
0x1956
,
0x196d
,
0x1970
,
0x1956
,
0x196c
,
0x1973
,
0x1951
,
0x1968
,
0x1952
,
0x1970
,
0
},
-
1
,
1
,
{
{
0
,
10
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* New Tai Lue */
{
0x1992
,
0x19c4
,
0
},
1
,
{
0x1992
,
0x19c4
,
0
},
-
1
,
1
,
{
{
0
,
2
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Buginese */
{
0x1a00
,
0x1a10
,
0
},
1
,
{
0x1a00
,
0x1a10
,
0
},
-
1
,
1
,
{
{
0
,
2
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Tai Tham */
{
0x1a20
,
0x1a40
,
0x1a50
,
0
},
1
,
{
0x1a20
,
0x1a40
,
0x1a50
,
0
},
-
1
,
1
,
{
{
0
,
3
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Balinese */
{
0x1b00
,
0x1b05
,
0x1b20
,
0
},
1
,
{
0x1b00
,
0x1b05
,
0x1b20
,
0
},
-
1
,
1
,
{
{
0
,
3
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Sundanese */
{
0x1b80
,
0x1b85
,
0x1ba0
,
0
},
1
,
{
0x1b80
,
0x1b85
,
0x1ba0
,
0
},
-
1
,
1
,
{
{
0
,
3
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Batak */
{
0x1bc0
,
0x1be5
,
0x1bfc
,
0
},
1
,
{
0x1bc0
,
0x1be5
,
0x1bfc
,
0
},
-
1
,
1
,
{
{
0
,
3
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Lepcha */
{
0x1c00
,
0x1c20
,
0x1c40
,
0
},
1
,
{
0x1c00
,
0x1c20
,
0x1c40
,
0
},
-
1
,
1
,
{
{
0
,
3
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Ol Chiki */
{
0x1c50
,
0x1c5a
,
0x1c77
,
0
},
1
,
{
0x1c50
,
0x1c5a
,
0x1c77
,
0
},
-
1
,
1
,
{
{
0
,
3
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Sundanese Supplement */
{
0x1cc0
,
0x1cc5
,
0x1cc7
,
0
},
1
,
{
0x1cc0
,
0x1cc5
,
0x1cc7
,
0
},
-
1
,
1
,
{
{
0
,
3
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Phonetic Extensions */
{
0x1d00
,
0x1d40
,
0x1d70
,
0
},
1
,
{
0x1d00
,
0x1d40
,
0x1d70
,
0
},
-
1
,
1
,
{
{
0
,
3
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Combining diacritical marks */
{
0x1dc0
,
0x300
,
0x1ddf
,
0
},
1
,
{
0x1dc0
,
0x300
,
0x1ddf
,
0
},
-
1
,
1
,
{
{
0
,
3
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Latin Extended Additional, Extended-C */
{
0x1e00
,
0x1d00
,
0x2c60
,
0
},
1
,
{
0x1e00
,
0x1d00
,
0x2c60
,
0
},
-
1
,
1
,
{
{
0
,
3
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Greek Extended */
{
0x3f0
,
0x1f00
,
0
},
1
,
{
0x3f0
,
0x1f00
,
0
},
-
1
,
1
,
{
{
0
,
2
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* General Punctuation */
{
0x1dc0
,
0x2000
,
0
},
1
,
{
0x1dc0
,
0x2000
,
0
},
-
1
,
1
,
{
{
0
,
2
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Superscripts and Subscripts */
{
0x2070
,
0x2086
,
0x2000
,
0
},
1
,
{
0x2070
,
0x2086
,
0x2000
,
0
},
-
1
,
1
,
{
{
0
,
3
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Currency, Combining Diacritical Marks for Symbols. Letterlike Symbols.. */
{
0x20a0
,
0x20b8
,
0x2000
,
0x20d0
,
0x2100
,
0x2150
,
0x2190
,
0x2200
,
0x2300
,
0x2400
,
0x2440
,
0x2460
,
0x2500
,
0x2580
,
0x25a0
,
0x2600
,
0x2700
,
0x27c0
,
0x27f0
,
0x2900
,
0x2980
,
0x2a00
,
0x2b00
,
0
},
1
,
0x2700
,
0x27c0
,
0x27f0
,
0x2900
,
0x2980
,
0x2a00
,
0x2b00
,
0
},
-
1
,
1
,
{
{
0
,
23
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Braille */
{
0x2800
,
0x2070
,
0x2000
,
0
},
1
,
{
0x2800
,
0x2070
,
0x2000
,
0
},
-
1
,
1
,
{
{
0
,
3
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Glagolitic */
{
0x2c00
,
0x2c12
,
0
},
1
,
{
0x2c00
,
0x2c12
,
0
},
-
1
,
1
,
{
{
0
,
2
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Coptic */
{
0x2c80
,
0x3e2
,
0x1f00
,
0
},
2
,
{
0x2c80
,
0x3e2
,
0x1f00
,
0
},
-
1
,
2
,
{
{
0
,
2
,
DWRITE_SCRIPT_SHAPES_DEFAULT
},
{
2
,
1
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}
}
},
{
/* Tifinagh */
{
0x2d30
,
0x2d4a
,
0
},
1
,
{
0x2d30
,
0x2d4a
,
0
},
-
1
,
1
,
{
{
0
,
2
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* LRE/PDF */
{
LRE
,
PDF
,
'a'
,
'b'
,
'c'
,
'\r'
,
0
},
3
,
{
LRE
,
PDF
,
'a'
,
'b'
,
'c'
,
'\r'
,
0
},
-
1
,
3
,
{
{
0
,
2
,
DWRITE_SCRIPT_SHAPES_NO_VISUAL
},
{
2
,
3
,
DWRITE_SCRIPT_SHAPES_DEFAULT
},
{
5
,
1
,
DWRITE_SCRIPT_SHAPES_NO_VISUAL
}
}
},
{
/* LRE/PDF and other visual and non-visual codes from Common script range */
{
LRE
,
PDF
,
'r'
,
'!'
,
0x200b
,
'\r'
,
0
},
3
,
{
LRE
,
PDF
,
'r'
,
'!'
,
0x200b
,
'\r'
,
0
},
-
1
,
3
,
{
{
0
,
2
,
DWRITE_SCRIPT_SHAPES_NO_VISUAL
},
{
2
,
2
,
DWRITE_SCRIPT_SHAPES_DEFAULT
},
{
4
,
2
,
DWRITE_SCRIPT_SHAPES_NO_VISUAL
}
}
},
{
/* Inherited on its own */
{
0x300
,
0x300
,
0
},
1
,
{
0x300
,
0x300
,
0
},
-
1
,
1
,
{
{
0
,
2
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}
}
},
{
/* Inherited followed by Latin */
{
0x300
,
0x300
,
'a'
,
0
},
1
,
{
0x300
,
0x300
,
'a'
,
0
},
-
1
,
1
,
{
{
0
,
3
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}
}
},
{
/* Inherited mixed with Arabic and Latin */
{
0x300
,
'+'
,
0x627
,
0x300
,
'a'
,
0
},
2
,
{
0x300
,
'+'
,
0x627
,
0x300
,
'a'
,
0
},
-
1
,
2
,
{
{
0
,
4
,
DWRITE_SCRIPT_SHAPES_DEFAULT
},
{
4
,
1
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}
}
},
{
{
'a'
,
0x300
,
'+'
,
0x627
,
0x300
,
')'
,
'a'
,
0
},
3
,
{
'a'
,
0x300
,
'+'
,
0x627
,
0x300
,
')'
,
'a'
,
0
},
-
1
,
3
,
{
{
0
,
3
,
DWRITE_SCRIPT_SHAPES_DEFAULT
},
{
3
,
3
,
DWRITE_SCRIPT_SHAPES_DEFAULT
},
{
6
,
1
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}
}
},
/* Paired punctuation */
{
{
0x627
,
'('
,
'a'
,
')'
,
'a'
,
0
},
2
,
{
0x627
,
'('
,
'a'
,
')'
,
'a'
,
0
},
-
1
,
2
,
{
{
0
,
2
,
DWRITE_SCRIPT_SHAPES_DEFAULT
},
{
2
,
3
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}
}
},
{
{
0x627
,
'['
,
'a'
,
']'
,
0x627
,
0
},
3
,
{
0x627
,
'['
,
'a'
,
']'
,
0x627
,
0
},
-
1
,
3
,
{
{
0
,
2
,
DWRITE_SCRIPT_SHAPES_DEFAULT
},
{
2
,
2
,
DWRITE_SCRIPT_SHAPES_DEFAULT
},
{
4
,
1
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}
}
...
...
@@ -1009,36 +1010,53 @@ static struct sa_test sa_tests[] = {
/* Combining marks */
{
/* dotted circle - Common, followed by accent - Inherited */
{
0x25cc
,
0x300
,
0
},
1
,
{
0x25cc
,
0x300
,
0
},
-
1
,
1
,
{
{
0
,
2
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}
}
},
{
/* combining mark with explicit script value */
{
0x25cc
,
0x300
,
0x5c4
,
0
},
1
,
{
0x25cc
,
0x300
,
0x5c4
,
0
},
-
1
,
1
,
{
{
0
,
3
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}
}
},
{
/* inherited merges with following explicit script */
{
0x25cc
,
0x300
,
'a'
,
0
},
1
,
{
0x25cc
,
0x300
,
'a'
,
0
},
-
1
,
1
,
{
{
0
,
3
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}
}
},
{
/* TAKRI LETTER A U+11680 */
{
0xd805
,
0xde80
,
0
},
1
,
{
0xd805
,
0xde80
,
0
},
-
1
,
1
,
{
{
0
,
2
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}
}
},
{
/* Musical symbols, U+1D173 */
{
0xd834
,
0xdd73
,
0
},
1
,
{
0xd834
,
0xdd73
,
0
},
-
1
,
1
,
{
{
0
,
2
,
DWRITE_SCRIPT_SHAPES_NO_VISUAL
}
}
},
{
/* Tags, U+E0020 */
{
0xdb40
,
0xdc20
,
0
},
1
,
{
0xdb40
,
0xdc20
,
0
},
-
1
,
1
,
{
{
0
,
2
,
DWRITE_SCRIPT_SHAPES_NO_VISUAL
}
}
},
/* keep this as end test data marker */
{
{
0
}
}
{
/* Null at start of string */
L"
\0
test"
,
5
,
2
,
{
{
0
,
1
,
DWRITE_SCRIPT_SHAPES_NO_VISUAL
},
{
1
,
4
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}
}
},
{
/* Null embedded in string */
L"te
\0
st"
,
5
,
3
,
{
{
0
,
2
,
DWRITE_SCRIPT_SHAPES_DEFAULT
},
{
2
,
1
,
DWRITE_SCRIPT_SHAPES_NO_VISUAL
},
{
3
,
2
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}
}
},
{
/* Null at end of string */
L"test
\0
"
,
5
,
2
,
{
{
0
,
4
,
DWRITE_SCRIPT_SHAPES_DEFAULT
},
{
4
,
1
,
DWRITE_SCRIPT_SHAPES_NO_VISUAL
}
}
},
};
static
void
init_expected_sa
(
struct
call_sequence
**
seq
,
const
struct
sa_test
*
test
)
...
...
@@ -1069,7 +1087,7 @@ static void get_script_analysis(const WCHAR *str, DWRITE_SCRIPT_ANALYSIS *sa)
IDWriteTextAnalyzer
*
analyzer
;
HRESULT
hr
;
init_textsource
(
&
analysissource
,
str
,
DWRITE_READING_DIRECTION_LEFT_TO_RIGHT
);
init_textsource
(
&
analysissource
,
str
,
-
1
,
DWRITE_READING_DIRECTION_LEFT_TO_RIGHT
);
analyzer
=
create_text_analyzer
(
&
IID_IDWriteTextAnalyzer
);
ok
(
!!
analyzer
,
"Failed to create analyzer instance.
\n
"
);
...
...
@@ -1085,25 +1103,26 @@ static void get_script_analysis(const WCHAR *str, DWRITE_SCRIPT_ANALYSIS *sa)
static
void
test_AnalyzeScript
(
void
)
{
const
struct
sa_test
*
ptr
=
sa_tests
;
IDWriteTextAnalyzer
*
analyzer
;
HRESULT
hr
;
UINT
i
;
analyzer
=
create_text_analyzer
(
&
IID_IDWriteTextAnalyzer
);
ok
(
!!
analyzer
,
"Failed to create analyzer instance.
\n
"
);
while
(
*
ptr
->
string
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
sa_tests
);
i
++
)
{
init_textsource
(
&
analysissource
,
ptr
->
string
,
DWRITE_READING_DIRECTION_LEFT_TO_RIGHT
);
init_textsource
(
&
analysissource
,
sa_tests
[
i
].
string
,
sa_tests
[
i
].
str_len
,
DWRITE_READING_DIRECTION_LEFT_TO_RIGHT
);
winetest_push_context
(
"Test %s"
,
debugstr_w
(
ptr
->
string
));
winetest_push_context
(
"Test %s"
,
wine_dbgstr_wn
(
sa_tests
[
i
].
string
,
sa_tests
[
i
].
str_len
));
init_expected_sa
(
expected_seq
,
ptr
);
init_expected_sa
(
expected_seq
,
&
sa_tests
[
i
]
);
hr
=
IDWriteTextAnalyzer_AnalyzeScript
(
analyzer
,
&
analysissource
.
IDWriteTextAnalysisSource_iface
,
0
,
lstrlenW
(
ptr
->
string
)
,
&
analysissink
);
sa_tests
[
i
].
str_len
==
-
1
?
lstrlenW
(
sa_tests
[
i
].
string
)
:
sa_tests
[
i
].
str_len
,
&
analysissink
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok_sequence
(
sequences
,
ANALYZER_ID
,
expected_seq
[
0
]
->
sequence
,
wine_dbgstr_w
(
ptr
->
string
),
FALSE
);
ptr
++
;
ok_sequence
(
sequences
,
ANALYZER_ID
,
expected_seq
[
0
]
->
sequence
,
wine_dbgstr_wn
(
sa_tests
[
i
].
string
,
sa_tests
[
i
].
str_len
),
FALSE
)
;
winetest_pop_context
();
}
...
...
@@ -1208,7 +1227,7 @@ static void test_AnalyzeLineBreakpoints(void)
analyzer
=
create_text_analyzer
(
&
IID_IDWriteTextAnalyzer
);
ok
(
!!
analyzer
,
"Failed to create analyzer instance.
\n
"
);
init_textsource
(
&
analysissource
,
L""
,
DWRITE_READING_DIRECTION_LEFT_TO_RIGHT
);
init_textsource
(
&
analysissource
,
L""
,
0
,
DWRITE_READING_DIRECTION_LEFT_TO_RIGHT
);
hr
=
IDWriteTextAnalyzer_AnalyzeLineBreakpoints
(
analyzer
,
&
analysissource
.
IDWriteTextAnalysisSource_iface
,
0
,
0
,
&
analysissink
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
...
...
@@ -1217,7 +1236,7 @@ static void test_AnalyzeLineBreakpoints(void)
{
UINT32
len
;
init_textsource
(
&
analysissource
,
ptr
->
text
,
DWRITE_READING_DIRECTION_LEFT_TO_RIGHT
);
init_textsource
(
&
analysissource
,
ptr
->
text
,
-
1
,
DWRITE_READING_DIRECTION_LEFT_TO_RIGHT
);
len
=
lstrlenW
(
ptr
->
text
);
if
(
len
>
BREAKPOINT_COUNT
)
{
...
...
@@ -2806,7 +2825,7 @@ static void test_AnalyzeBidi(void)
{
UINT32
len
;
init_textsource
(
&
analysissource
,
ptr
->
text
,
ptr
->
direction
);
init_textsource
(
&
analysissource
,
ptr
->
text
,
-
1
,
ptr
->
direction
);
len
=
lstrlenW
(
ptr
->
text
);
if
(
len
>
BIDI_LEVELS_COUNT
)
{
...
...
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