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
35948c6f
Commit
35948c6f
authored
Jun 15, 2011
by
Aric Stewart
Committed by
Alexandre Julliard
Jun 15, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
usp10: Return the set of Indic syllables after reorder.
parent
b1ec7c9d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
11 deletions
+27
-11
indic.c
dlls/usp10/indic.c
+18
-8
shape.c
dlls/usp10/shape.c
+0
-0
usp10_internal.h
dlls/usp10/usp10_internal.h
+9
-3
No files found.
dlls/usp10/indic.c
View file @
35948c6f
...
...
@@ -212,12 +212,14 @@ static INT Indic_process_next_syllable( LPCWSTR input, INT cChar, INT start, INT
return
parse_consonant_syllable
(
input
,
cChar
,
start
,
main
,
next
,
lex
);
}
void
Indic_ReorderCharacters
(
LPWSTR
input
,
int
cChar
,
lexical_function
lex
,
reorder_function
reorder_f
)
void
Indic_ReorderCharacters
(
LPWSTR
input
,
int
cChar
,
IndicSyllable
**
syllables
,
int
*
syllable_count
,
lexical_function
lex
,
reorder_function
reorder_f
)
{
int
index
=
0
;
int
next
=
0
;
int
center
=
0
;
*
syllable_count
=
0
;
if
(
!
lex
||
!
reorder_f
)
{
ERR
(
"Failure to have required functions
\n
"
);
...
...
@@ -233,8 +235,16 @@ void Indic_ReorderCharacters( LPWSTR input, int cChar, lexical_function lex, reo
next
=
Indic_process_next_syllable
(
input
,
cChar
,
0
,
&
center
,
index
,
lex
);
if
(
next
!=
-
1
)
{
reorder_f
(
input
,
index
,
center
,
next
-
1
,
lex
);
if
(
*
syllable_count
)
*
syllables
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
*
syllables
,
sizeof
(
IndicSyllable
)
*
(
*
syllable_count
+
1
));
else
*
syllables
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
IndicSyllable
));
(
*
syllables
)[
*
syllable_count
].
start
=
index
;
(
*
syllables
)[
*
syllable_count
].
base
=
center
;
(
*
syllables
)[
*
syllable_count
].
end
=
next
-
1
;
reorder_f
(
input
,
&
(
*
syllables
)[
*
syllable_count
],
lex
);
index
=
next
;
*
syllable_count
=
(
*
syllable_count
)
+
1
;
}
else
if
(
index
<
cChar
)
{
...
...
@@ -250,21 +260,21 @@ void Indic_ReorderCharacters( LPWSTR input, int cChar, lexical_function lex, reo
}
}
}
TRACE
(
"Processed %i of %i characters
\n
"
,
index
,
cChar
);
TRACE
(
"Processed %i of %i characters
into %i syllables
\n
"
,
index
,
cChar
,
*
syllable_count
);
}
int
Indic_FindBaseConsonant
(
LPWSTR
input
,
I
NT
start
,
INT
main
,
INT
end
,
lexical_function
lex
)
int
Indic_FindBaseConsonant
(
LPWSTR
input
,
I
ndicSyllable
*
s
,
lexical_function
lex
)
{
int
i
;
/* try to find a base consonant */
if
(
!
is_consonant
(
lex
(
input
[
main
])
))
if
(
!
is_consonant
(
lex
(
input
[
s
->
base
])
))
{
for
(
i
=
end
;
i
>=
start
;
i
--
)
for
(
i
=
s
->
end
;
i
>=
s
->
start
;
i
--
)
if
(
is_consonant
(
lex
(
input
[
i
])
))
{
main
=
i
;
s
->
base
=
i
;
break
;
}
}
return
main
;
return
s
->
base
;
}
dlls/usp10/shape.c
View file @
35948c6f
This diff is collapsed.
Click to expand it.
dlls/usp10/usp10_internal.h
View file @
35948c6f
...
...
@@ -96,10 +96,16 @@ typedef struct {
OPENTYPE_TAG
userLang
;
}
ScriptCache
;
typedef
struct
{
INT
start
;
INT
base
;
INT
end
;
}
IndicSyllable
;
enum
{
lex_Halant
,
lex_Composed_Vowel
,
lex_Matra_post
,
lex_Matra_pre
,
lex_Matra_above
,
lex_Matra_below
,
lex_ZWJ
,
lex_ZWNJ
,
lex_NBSP
,
lex_Modifier
,
lex_Vowel
,
lex_Consonant
,
lex_Generic
,
lex_Ra
,
lex_Vedic
,
lex_Anudatta
,
lex_Nukta
};
typedef
int
(
*
lexical_function
)(
WCHAR
c
);
typedef
void
(
*
reorder_function
)(
LPWSTR
pwChar
,
I
NT
start
,
INT
main
,
INT
end
,
lexical_function
lex
);
typedef
void
(
*
reorder_function
)(
LPWSTR
pwChar
,
I
ndicSyllable
*
syllable
,
lexical_function
lex
);
#define odd(x) ((x) & 1)
...
...
@@ -114,5 +120,5 @@ void SHAPE_ApplyDefaultOpentypeFeatures(HDC hdc, ScriptCache *psc, SCRIPT_ANALYS
HRESULT
SHAPE_CheckFontForRequiredFeatures
(
HDC
hdc
,
ScriptCache
*
psc
,
SCRIPT_ANALYSIS
*
psa
)
DECLSPEC_HIDDEN
;
void
SHAPE_CharGlyphProp
(
HDC
hdc
,
ScriptCache
*
psc
,
SCRIPT_ANALYSIS
*
psa
,
const
WCHAR
*
pwcChars
,
const
INT
cChars
,
const
WORD
*
pwGlyphs
,
const
INT
cGlyphs
,
WORD
*
pwLogClust
,
SCRIPT_CHARPROP
*
pCharProp
,
SCRIPT_GLYPHPROP
*
pGlyphProp
)
DECLSPEC_HIDDEN
;
void
Indic_ReorderCharacters
(
LPWSTR
input
,
int
cChars
,
lexical_function
lexical_f
,
reorder_function
reorder_f
)
DECLSPEC_HIDDEN
;
int
Indic_FindBaseConsonant
(
LPWSTR
pwChar
,
I
NT
start
,
INT
main
,
INT
end
,
lexical_function
lex
)
DECLSPEC_HIDDEN
;
void
Indic_ReorderCharacters
(
LPWSTR
input
,
int
cChars
,
IndicSyllable
**
syllables
,
int
*
syllable_count
,
lexical_function
lexical_f
,
reorder_function
reorder_f
)
DECLSPEC_HIDDEN
;
int
Indic_FindBaseConsonant
(
LPWSTR
pwChar
,
I
ndicSyllable
*
syllable
,
lexical_function
lex
)
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