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
bbc0137f
Commit
bbc0137f
authored
Oct 30, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 30, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Support for Greek and Cyrillic ranges.
parent
05d64118
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
11 deletions
+48
-11
analyzer.c
dlls/dwrite/analyzer.c
+23
-7
analyzer.c
dlls/dwrite/tests/analyzer.c
+25
-4
No files found.
dlls/dwrite/analyzer.c
View file @
bbc0137f
...
...
@@ -30,8 +30,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(dwrite);
enum
scriptcode
{
Script_Arabic
=
0
,
Script_C1Controls
=
12
,
Script_Coptic
=
13
,
Script_Cyrillic
=
16
,
Script_Greek
=
23
,
Script_Latin
=
38
,
Script_
Latin_Symb
=
77
,
Script_
Symbol
=
77
,
Script_Unknown
=
(
UINT16
)
-
1
};
...
...
@@ -46,15 +49,15 @@ static const struct script_range script_ranges[] = {
/* ASCII punctuation and symbols: U+0020–U+002F */
/* ASCII digits: U+0030–U+0039 */
/* ASCII punctuation and symbols: U+003A–U+0040 */
{
Script_
Latin_Symb
,
0x00
,
0x040
},
{
Script_
Symbol
,
0x00
,
0x040
},
/* Latin uppercase: U+0041–U+005A */
{
Script_Latin
,
0x41
,
0x5a
},
/* ASCII punctuation and symbols: U+005B–U+0060 */
{
Script_
Latin_Symb
,
0x5b
,
0x060
},
{
Script_
Symbol
,
0x5b
,
0x060
},
/* Latin lowercase: U+0061–U+007A */
{
Script_Latin
,
0x61
,
0x7a
},
/* ASCII punctuation and symbols, control char DEL: U+007B–U+007F */
{
Script_
Latin_Symb
,
0x7b
,
0x7f
},
{
Script_
Symbol
,
0x7b
,
0x7f
},
/* C1 Controls: U+0080–U+009F */
{
Script_C1Controls
,
0x80
,
0x9f
},
/* Latin-1 Supplement: U+00A0–U+00FF */
...
...
@@ -63,9 +66,22 @@ static const struct script_range script_ranges[] = {
/* IPA Extensions: U+0250–U+02AF */
/* Spacing Modifier Letters: U+02B0–U+02FF */
{
Script_Latin
,
0xa0
,
0x2ff
},
/* Combining Diacritical Marks: U+0300–U+036F */
{
Script_Symbol
,
0x300
,
0x36f
},
/* Greek: U+0370–U+03E1 */
{
Script_Greek
,
0x370
,
0x3e1
},
/* Coptic: U+03E2–U+03Ef */
{
Script_Coptic
,
0x3e2
,
0x3ef
},
/* Greek: U+03F0–U+03FF */
{
Script_Greek
,
0x3f0
,
0x3ff
},
/* Cyrillic: U+0400–U+04FF */
/* Cyrillic Supplement: U+0500–U+052F */
/* Cyrillic Supplement range is incomplete cause it's based on Unicode 5.2
that doesn't define some Abkhaz and Azerbaijani letters, we support Unicode 6.0 range here */
{
Script_Cyrillic
,
0x400
,
0x52f
},
/* Arabic: U+0600–U+06FF */
{
Script_Arabic
,
0x600
,
0x6ef
},
/* unsuppoted range */
/* unsuppo
r
ted range */
{
Script_Unknown
}
};
...
...
@@ -102,8 +118,8 @@ static HRESULT analyze_script(const WCHAR *text, UINT32 len, IDWriteTextAnalysis
UINT16
script
=
get_char_script
(
text
[
i
]);
/* Script_Latin_Symb script type is ignored when preceded or followed by another script */
if
(
sa
.
script
==
Script_
Latin_Symb
)
sa
.
script
=
script
;
if
(
script
==
Script_
Latin_Symb
)
script
=
sa
.
script
;
if
(
sa
.
script
==
Script_
Symbol
)
sa
.
script
=
script
;
if
(
script
==
Script_
Symbol
)
script
=
sa
.
script
;
/* this is a length of a sequence to be reported next */
if
(
sa
.
script
==
script
)
length
++
;
...
...
dlls/dwrite/tests/analyzer.c
View file @
bbc0137f
...
...
@@ -399,8 +399,11 @@ struct sa_test {
enum
scriptcode
{
Script_Arabic
=
0
,
Script_C1Controls
=
12
,
Script_Coptic
=
13
,
Script_Cyrillic
=
16
,
Script_Greek
=
23
,
Script_Latin
=
38
,
Script_
Latin_Symb
=
77
Script_
Symbol
=
77
};
static
struct
sa_test
sa_tests
[]
=
{
...
...
@@ -415,16 +418,16 @@ static struct sa_test sa_tests[] = {
},
{
{
' '
,
' '
,
' '
,
' '
,
'!'
,
'$'
,
'['
,
'^'
,
'{'
,
'~'
,
0
},
1
,
{
{
0
,
10
,
{
Script_
Latin_Symb
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}
}}
{
{
0
,
10
,
{
Script_
Symbol
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}
}}
},
{
{
' '
,
' '
,
' '
,
'1'
,
'2'
,
' '
,
0
},
1
,
{
{
0
,
6
,
{
Script_
Latin_Symb
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}
}}
{
{
0
,
6
,
{
Script_
Symbol
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}
}}
},
{
/* digits only */
{
'1'
,
'2'
,
0
},
1
,
{
{
0
,
2
,
{
Script_
Latin_Symb
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}
}}
{
{
0
,
2
,
{
Script_
Symbol
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}
}}
},
{
/* Arabic */
...
...
@@ -484,6 +487,24 @@ static struct sa_test sa_tests[] = {
{
0x2b0
,
0x2ba
,
0x2d7
,
0x2dd
,
0x2ef
,
0x2ff
,
0
},
1
,
{
{
0
,
6
,
{
Script_Latin
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}
}}
},
{
/* Combining Diacritical Marks */
{
0x300
,
0x320
,
0x340
,
0x345
,
0x350
,
0x36f
,
0
},
1
,
{
{
0
,
6
,
{
Script_Symbol
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}
}}
},
{
/* Greek and Coptic */
{
0x370
,
0x388
,
0x3d8
,
0x3e1
,
0x3e2
,
0x3fa
,
0x3ff
,
0
},
3
,
{
{
0
,
4
,
{
Script_Greek
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}
},
{
4
,
1
,
{
Script_Coptic
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}
},
{
5
,
2
,
{
Script_Greek
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}
}
}
},
{
/* Cyrillic and Cyrillic Supplement */
{
0x400
,
0x40f
,
0x410
,
0x44f
,
0x450
,
0x45f
,
0x460
,
0x481
,
0x48a
,
0x4f0
,
0x4fa
,
0x4ff
,
0x500
,
0x510
,
0x520
,
0
},
1
,
{
{
0
,
15
,
{
Script_Cyrillic
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}
}}
},
/* keep this as end marker */
{
{
0
}
}
};
...
...
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