mirror of
https://github.com/reactos/reactos.git
synced 2024-07-02 02:34:53 +00:00
[USP10] Sync with Wine Staging 2.9. CORE-13362
30e8768 usp10: Validate substition record sequence indices in GSUB_apply_ContextSubst(). ebe75cb usp10: Simplify the "sr_2" assignments in GSUB_apply_ContextSubst(). 6c13170 usp10: Range check glyph counts in GSUB_apply_ContextSubst(). c5619be usp10: Validate positioning record sequence indices in GPOS_apply_ContextPos(). 82d36ba usp10: Simplify the "pr_2" assignment in GPOS_apply_ContextPos(). 1b02c1a usp10: Range check glyph counts in GPOS_apply_ContextPos(). d1ca880 usp10: Validate substition record sequence indices in GSUB_apply_ChainContextSubst(). 34a9400 usp10: Validate positioning record sequence indices in GPOS_apply_ChainContextPos(). 9694aeb usp10: Avoid special handling if the substitution count is 0 in GSUB_apply_ChainContextSubst(). f7b943e usp10: Range check glyph counts in GSUB_apply_ChainContextSubst(). 24943fe usp10: Simplify the chaining context table assignments in GSUB_apply_ChainContextSubst(). 02316e6 usp10: Rename the chaining context tables in GSUB_apply_ChainContextSubst() to something more descriptive. 0389768 usp10: Return early if the number of positioning operations is 0 in GPOS_apply_ChainContextPos(). 7dfe9b9 usp10: Range check glyph counts in GPOS_apply_ChainContextPos(). f6c0146 usp10: Simplify the chaining context table assignments in GPOS_apply_ChainContextPos(). fb3ea0a usp10: Rename the chaining context tables in GPOS_apply_ChainContextPos() to something more descriptive. 04e5466 usp10: Handle invalid arguments in ScriptIsComplex(). 4553871 usp10: Check if corresponding headers are present before accessing their feature lists in _initialize_feature_cache. 63bcfa3 usp10: Get rid of the code duplication between GSUB_initialize_feature_cache() and GPOS_expand_feature_cache(). 9b0f3f1 usp10: Get rid of some code duplication in GPOS_expand_feature_cache(). 0ffd5b4 usp10: Double the languages array size when growing it in GPOS_expand_language_cache(). 218be44 usp10: Double the scripts array size when growing it in GPOS_expand_script_cache(). 9a15753 usp10: Introduce a helper function to lookup a language in a LoadedScript structure. 2a0ffc9 usp10: Introduce a helper function to lookup a script in the script cache. 213d358 usp10: Avoid LPVOID. 1403087 usp10: Avoid LPCVOID. a204e58 usp10: Avoid LPWSTR. cdd47c3 usp10: Avoid LPCWSTR. af617aa usp10: Avoid LPBYTE. 34c2f74 usp10: Avoid LPWORD. ab8ec60 usp10: Avoid LPPOINT. ba66b62 usp10: Avoid LPOUTLINETEXTMETRICW. df21247 usp10: Make the script cache parameter to get_opentype_script() const. c8f87ad usp10: Make the script cache parameter to GPOS_apply_MarkToBase() const. cd9db34 usp10: Pass const metrics to GPOS_convert_design_units_to_device(). c3dc9ed usp10: Use heap_free() instead of HeapFree(). 6a0e5bb usp10: Use heap_alloc() instead of HeapAlloc(). 77e5a2f usp10: Use heap_alloc_zero() instead of HeapAlloc() with HEAP_ZERO_MEMORY. 3c704c2 usp10: Use bsearch() to lookup the script range in get_char_script(). a523b46 usp10: Introduce an enumeration for script types. 502d239 usp10: Do not fall back to presentation form B if the contextual feature exists in ContextualShape_Arabic(). f13dea5 usp10: Properly determine the glyph run direction when shaping Script_Arabic. c94a5fd usp10: Take the script direction into account when applying OpenType features. 1727dd4 usp10: Use USP10_FindGlyphInLogClust() in UpdateClusters(). bab506e usp10: Use memmove() in GSUB_apply_LigatureSubst(). 66df220 usp10: Make feature tables const. b32fb23 usp10: Fix ScriptGetProperties spec file entry. 1a42ee3 usp10: Add __WINE_ALLOC_SIZE attributes to heap_xxx() functions. 892393b usp10: Filter out DeltaFormat == 0 too, valid range is [1, 3]. 66dce1e usp10: Introduce an enumeration for GSUB lookup types. fefd151 usp10: Ignore device tables with invalid delta format. b6d541c usp10: Iterate in visual order in GPOS_apply_feature(). 6fec9b1 usp10: Return the logical offset in GPOS_apply_lookup(). 8d15667 usp10: Return the logical offset in GPOS_apply_ChainContextPos(). 2210196 usp10: Return the logical offset in GPOS_apply_ContextPos(). 6e84358 usp10: Return the logical offset in GPOS_apply_PairAdjustment(). 61e8a38 usp10: Introduce an enumeration for GPOS lookup types. 4b22953 usp10: Properly get glyph widths for OpenType fonts in ScriptPlaceOpenType(). svn path=/trunk/; revision=74851
This commit is contained in:
parent
83eaf4cbac
commit
100b1d6e92
|
@ -150,7 +150,7 @@ static inline void dump_types(const char* header, WORD *types, int start, int en
|
|||
}
|
||||
|
||||
/* Convert the libwine information to the direction enum */
|
||||
static void classify(LPCWSTR lpString, WORD *chartype, DWORD uCount, const SCRIPT_CONTROL *c)
|
||||
static void classify(const WCHAR *string, WORD *chartype, DWORD count, const SCRIPT_CONTROL *c)
|
||||
{
|
||||
static const enum directions dir_map[16] =
|
||||
{
|
||||
|
@ -174,14 +174,14 @@ static void classify(LPCWSTR lpString, WORD *chartype, DWORD uCount, const SCRIP
|
|||
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < uCount; ++i)
|
||||
for (i = 0; i < count; ++i)
|
||||
{
|
||||
chartype[i] = dir_map[get_char_typeW(lpString[i]) >> 12];
|
||||
chartype[i] = dir_map[get_char_typeW(string[i]) >> 12];
|
||||
switch (chartype[i])
|
||||
{
|
||||
case ES:
|
||||
if (!c->fLegacyBidiClass) break;
|
||||
switch (lpString[i])
|
||||
switch (string[i])
|
||||
{
|
||||
case '-':
|
||||
case '+': chartype[i] = NI; break;
|
||||
|
@ -189,7 +189,7 @@ static void classify(LPCWSTR lpString, WORD *chartype, DWORD uCount, const SCRIP
|
|||
}
|
||||
break;
|
||||
case PDF:
|
||||
switch (lpString[i])
|
||||
switch (string[i])
|
||||
{
|
||||
case 0x202A: chartype[i] = LRE; break;
|
||||
case 0x202B: chartype[i] = RLE; break;
|
||||
|
@ -686,8 +686,8 @@ static BracketPair *computeBracketPairs(IsolatedRun *iso_run)
|
|||
int pair_count = 0;
|
||||
int i;
|
||||
|
||||
open_stack = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * iso_run->length);
|
||||
stack_index = HeapAlloc(GetProcessHeap(), 0, sizeof(int) * iso_run->length);
|
||||
open_stack = heap_alloc(iso_run->length * sizeof(*open_stack));
|
||||
stack_index = heap_alloc(iso_run->length * sizeof(*stack_index));
|
||||
|
||||
for (i = 0; i < iso_run->length; i++)
|
||||
{
|
||||
|
@ -696,7 +696,7 @@ static BracketPair *computeBracketPairs(IsolatedRun *iso_run)
|
|||
{
|
||||
if (!out)
|
||||
{
|
||||
out = HeapAlloc(GetProcessHeap(),0,sizeof(BracketPair));
|
||||
out = heap_alloc(sizeof(*out));
|
||||
out[0].start = -1;
|
||||
}
|
||||
|
||||
|
@ -733,14 +733,14 @@ static BracketPair *computeBracketPairs(IsolatedRun *iso_run)
|
|||
}
|
||||
if (pair_count == 0)
|
||||
{
|
||||
HeapFree(GetProcessHeap(),0,out);
|
||||
heap_free(out);
|
||||
out = NULL;
|
||||
}
|
||||
else if (pair_count > 1)
|
||||
qsort(out, pair_count, sizeof(BracketPair), compr);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, open_stack);
|
||||
HeapFree(GetProcessHeap(), 0, stack_index);
|
||||
heap_free(open_stack);
|
||||
heap_free(stack_index);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
@ -839,7 +839,7 @@ static void resolveNeutrals(IsolatedRun *iso_run)
|
|||
i++;
|
||||
p = &pairs[i];
|
||||
}
|
||||
HeapFree(GetProcessHeap(),0,pairs);
|
||||
heap_free(pairs);
|
||||
}
|
||||
|
||||
/* N1 */
|
||||
|
@ -979,15 +979,16 @@ static void resolveResolved(unsigned baselevel, const WORD * pcls, WORD *plevel,
|
|||
}
|
||||
}
|
||||
|
||||
static void computeIsolatingRunsSet(unsigned baselevel, WORD *pcls, WORD *pLevel, LPCWSTR lpString, int uCount, struct list *set)
|
||||
static void computeIsolatingRunsSet(unsigned baselevel, WORD *pcls, const WORD *pLevel,
|
||||
const WCHAR *string, unsigned int uCount, struct list *set)
|
||||
{
|
||||
int run_start, run_end, i;
|
||||
int run_count = 0;
|
||||
Run *runs;
|
||||
IsolatedRun *current_isolated;
|
||||
|
||||
runs = HeapAlloc(GetProcessHeap(), 0, uCount * sizeof(Run));
|
||||
if (!runs) return;
|
||||
if (!(runs = heap_alloc(uCount * sizeof(*runs))))
|
||||
return;
|
||||
|
||||
list_init(set);
|
||||
|
||||
|
@ -1014,8 +1015,9 @@ static void computeIsolatingRunsSet(unsigned baselevel, WORD *pcls, WORD *pLevel
|
|||
{
|
||||
int type_fence, real_end;
|
||||
int j;
|
||||
current_isolated = HeapAlloc(GetProcessHeap(), 0, sizeof(IsolatedRun) + sizeof(RunChar)*uCount);
|
||||
if (!current_isolated) break;
|
||||
|
||||
if (!(current_isolated = heap_alloc(FIELD_OFFSET(IsolatedRun, item[uCount]))))
|
||||
break;
|
||||
|
||||
run_start = runs[k].start;
|
||||
current_isolated->e = runs[k].e;
|
||||
|
@ -1024,7 +1026,7 @@ static void computeIsolatingRunsSet(unsigned baselevel, WORD *pcls, WORD *pLevel
|
|||
for (j = 0; j < current_isolated->length; j++)
|
||||
{
|
||||
current_isolated->item[j].pcls = &pcls[runs[k].start+j];
|
||||
current_isolated->item[j].ch = lpString[runs[k].start+j];
|
||||
current_isolated->item[j].ch = string[runs[k].start + j];
|
||||
}
|
||||
|
||||
run_end = runs[k].end;
|
||||
|
@ -1054,7 +1056,7 @@ search:
|
|||
for (m = 0; l < current_isolated->length; l++, m++)
|
||||
{
|
||||
current_isolated->item[l].pcls = &pcls[runs[j].start+m];
|
||||
current_isolated->item[l].ch = lpString[runs[j].start+m];
|
||||
current_isolated->item[l].ch = string[runs[j].start + m];
|
||||
}
|
||||
|
||||
TRACE("[%i -- %i]",runs[j].start, runs[j].end);
|
||||
|
@ -1110,15 +1112,15 @@ search:
|
|||
i++;
|
||||
}
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, runs);
|
||||
heap_free(runs);
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* BIDI_DeterminLevels
|
||||
*/
|
||||
BOOL BIDI_DetermineLevels(
|
||||
LPCWSTR lpString, /* [in] The string for which information is to be returned */
|
||||
INT uCount, /* [in] Number of WCHARs in string. */
|
||||
const WCHAR *lpString, /* [in] The string for which information is to be returned */
|
||||
unsigned int uCount, /* [in] Number of WCHARs in string. */
|
||||
const SCRIPT_STATE *s,
|
||||
const SCRIPT_CONTROL *c,
|
||||
WORD *lpOutLevels, /* [out] final string levels */
|
||||
|
@ -1132,8 +1134,7 @@ BOOL BIDI_DetermineLevels(
|
|||
|
||||
TRACE("%s, %d\n", debugstr_wn(lpString, uCount), uCount);
|
||||
|
||||
chartype = HeapAlloc(GetProcessHeap(), 0, uCount * sizeof(WORD));
|
||||
if (!chartype)
|
||||
if (!(chartype = heap_alloc(uCount * sizeof(*chartype))))
|
||||
{
|
||||
WARN("Out of memory\n");
|
||||
return FALSE;
|
||||
|
@ -1166,7 +1167,7 @@ BOOL BIDI_DetermineLevels(
|
|||
if (TRACE_ON(bidi)) iso_dump_types("After Neutrals", iso_run);
|
||||
|
||||
list_remove(&iso_run->entry);
|
||||
HeapFree(GetProcessHeap(),0,iso_run);
|
||||
heap_free(iso_run);
|
||||
}
|
||||
|
||||
if (TRACE_ON(bidi)) dump_types("Before Implicit", chartype, 0, uCount);
|
||||
|
@ -1177,7 +1178,7 @@ BOOL BIDI_DetermineLevels(
|
|||
classify(lpString, chartype, uCount, c);
|
||||
resolveResolved(baselevel, chartype, lpOutLevels, 0, uCount-1);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, chartype);
|
||||
heap_free(chartype);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -1278,15 +1279,14 @@ int BIDI_ReorderL2vLevel(int level, int *pIndexs, const BYTE* plevel, int cch, B
|
|||
return ich;
|
||||
}
|
||||
|
||||
BOOL BIDI_GetStrengths(LPCWSTR lpString, INT uCount, const SCRIPT_CONTROL *c,
|
||||
WORD* lpStrength)
|
||||
BOOL BIDI_GetStrengths(const WCHAR *string, unsigned int count, const SCRIPT_CONTROL *c, WORD *strength)
|
||||
{
|
||||
int i;
|
||||
classify(lpString, lpStrength, uCount, c);
|
||||
unsigned int i;
|
||||
|
||||
for ( i = 0; i < uCount; i++)
|
||||
classify(string, strength, count, c);
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
switch(lpStrength[i])
|
||||
switch (strength[i])
|
||||
{
|
||||
case L:
|
||||
case LRE:
|
||||
|
@ -1295,7 +1295,7 @@ BOOL BIDI_GetStrengths(LPCWSTR lpString, INT uCount, const SCRIPT_CONTROL *c,
|
|||
case AL:
|
||||
case RLE:
|
||||
case RLO:
|
||||
lpStrength[i] = BIDI_STRONG;
|
||||
strength[i] = BIDI_STRONG;
|
||||
break;
|
||||
case PDF:
|
||||
case EN:
|
||||
|
@ -1304,14 +1304,14 @@ BOOL BIDI_GetStrengths(LPCWSTR lpString, INT uCount, const SCRIPT_CONTROL *c,
|
|||
case AN:
|
||||
case CS:
|
||||
case BN:
|
||||
lpStrength[i] = BIDI_WEAK;
|
||||
strength[i] = BIDI_WEAK;
|
||||
break;
|
||||
case B:
|
||||
case S:
|
||||
case WS:
|
||||
case ON:
|
||||
default: /* Neutrals and NSM */
|
||||
lpStrength[i] = BIDI_NEUTRAL;
|
||||
strength[i] = BIDI_NEUTRAL;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
|
|
|
@ -68,8 +68,8 @@ void BREAK_line(const WCHAR *chars, int count, const SCRIPT_ANALYSIS *sa, SCRIPT
|
|||
|
||||
TRACE("In %s\n",debugstr_wn(chars,count));
|
||||
|
||||
break_class = HeapAlloc(GetProcessHeap(),0, count * sizeof(short));
|
||||
break_before = HeapAlloc(GetProcessHeap(),0, count * sizeof(short));
|
||||
break_class = heap_alloc(count * sizeof(*break_class));
|
||||
break_before = heap_alloc(count * sizeof(*break_before));
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
|
@ -425,6 +425,6 @@ void BREAK_line(const WCHAR *chars, int count, const SCRIPT_ANALYSIS *sa, SCRIPT
|
|||
}
|
||||
}
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, break_before);
|
||||
HeapFree(GetProcessHeap(), 0, break_class);
|
||||
heap_free(break_before);
|
||||
heap_free(break_class);
|
||||
}
|
||||
|
|
|
@ -23,12 +23,12 @@
|
|||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(uniscribe);
|
||||
|
||||
static void debug_output_string(LPCWSTR str, int cChar, lexical_function f)
|
||||
static void debug_output_string(const WCHAR *str, unsigned int char_count, lexical_function f)
|
||||
{
|
||||
int i;
|
||||
if (TRACE_ON(uniscribe))
|
||||
{
|
||||
for (i = 0; i < cChar; i++)
|
||||
for (i = 0; i < char_count; ++i)
|
||||
{
|
||||
switch (f(str[i]))
|
||||
{
|
||||
|
@ -67,8 +67,8 @@ static inline BOOL is_joiner( int type )
|
|||
return (type == lex_ZWJ || type == lex_ZWNJ);
|
||||
}
|
||||
|
||||
static INT consonant_header(LPCWSTR input, INT cChar, INT start, INT next,
|
||||
lexical_function lex)
|
||||
static int consonant_header(const WCHAR *input, unsigned int cChar,
|
||||
unsigned int start, unsigned int next, lexical_function lex)
|
||||
{
|
||||
if (!is_consonant( lex(input[next]) )) return -1;
|
||||
next++;
|
||||
|
@ -91,8 +91,8 @@ static INT consonant_header(LPCWSTR input, INT cChar, INT start, INT next,
|
|||
return -1;
|
||||
}
|
||||
|
||||
static INT parse_consonant_syllable(LPCWSTR input, INT cChar, INT start,
|
||||
INT *main, INT next, lexical_function lex)
|
||||
static int parse_consonant_syllable(const WCHAR *input, unsigned int cChar,
|
||||
unsigned int start, unsigned int *main, unsigned int next, lexical_function lex)
|
||||
{
|
||||
int check;
|
||||
int headers = 0;
|
||||
|
@ -139,8 +139,8 @@ static INT parse_consonant_syllable(LPCWSTR input, INT cChar, INT start,
|
|||
return next;
|
||||
}
|
||||
|
||||
static INT parse_vowel_syllable(LPCWSTR input, INT cChar, INT start,
|
||||
INT next, lexical_function lex)
|
||||
static int parse_vowel_syllable(const WCHAR *input, unsigned int cChar,
|
||||
unsigned int start, unsigned int next, lexical_function lex)
|
||||
{
|
||||
if ((next < cChar) && lex(input[next]) == lex_Nukta)
|
||||
next++;
|
||||
|
@ -168,7 +168,8 @@ static INT parse_vowel_syllable(LPCWSTR input, INT cChar, INT start,
|
|||
return next;
|
||||
}
|
||||
|
||||
static INT Indic_process_next_syllable( LPCWSTR input, INT cChar, INT start, INT* main, INT next, lexical_function lex )
|
||||
static int Indic_process_next_syllable(const WCHAR *input, unsigned int cChar,
|
||||
unsigned int start, unsigned int *main, unsigned int next, lexical_function lex)
|
||||
{
|
||||
if (lex(input[next])==lex_Vowel)
|
||||
{
|
||||
|
@ -195,7 +196,8 @@ static INT Indic_process_next_syllable( LPCWSTR input, INT cChar, INT start, INT
|
|||
return parse_consonant_syllable(input, cChar, start, main, next, lex);
|
||||
}
|
||||
|
||||
static BOOL Consonant_is_post_base_form(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPCWSTR pwChar, IndicSyllable *s, lexical_function lexical, BOOL modern)
|
||||
static BOOL Consonant_is_post_base_form(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc,
|
||||
const WCHAR *pwChar, const IndicSyllable *s, lexical_function lexical, BOOL modern)
|
||||
{
|
||||
if (is_consonant(lexical(pwChar[s->base])) && s->base > s->start && lexical(pwChar[s->base-1]) == lex_Halant)
|
||||
{
|
||||
|
@ -212,7 +214,8 @@ static BOOL Consonant_is_post_base_form(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCac
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL Consonant_is_below_base_form(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPCWSTR pwChar, IndicSyllable *s, lexical_function lexical, BOOL modern)
|
||||
static BOOL Consonant_is_below_base_form(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc,
|
||||
const WCHAR *pwChar, const IndicSyllable *s, lexical_function lexical, BOOL modern)
|
||||
{
|
||||
if (is_consonant(lexical(pwChar[s->base])) && s->base > s->start && lexical(pwChar[s->base-1]) == lex_Halant)
|
||||
{
|
||||
|
@ -229,7 +232,8 @@ static BOOL Consonant_is_below_base_form(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCa
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL Consonant_is_pre_base_form(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPCWSTR pwChar, IndicSyllable *s, lexical_function lexical, BOOL modern)
|
||||
static BOOL Consonant_is_pre_base_form(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc,
|
||||
const WCHAR *pwChar, const IndicSyllable *s, lexical_function lexical, BOOL modern)
|
||||
{
|
||||
if (is_consonant(lexical(pwChar[s->base])) && s->base > s->start && lexical(pwChar[s->base-1]) == lex_Halant)
|
||||
{
|
||||
|
@ -246,14 +250,16 @@ static BOOL Consonant_is_pre_base_form(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCach
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL Consonant_is_ralf(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPCWSTR pwChar, IndicSyllable *s, lexical_function lexical)
|
||||
static BOOL Consonant_is_ralf(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc,
|
||||
const WCHAR *pwChar, const IndicSyllable *s, lexical_function lexical)
|
||||
{
|
||||
if ((lexical(pwChar[s->start])==lex_Ra) && s->end > s->start && lexical(pwChar[s->start+1]) == lex_Halant)
|
||||
return (SHAPE_does_GSUB_feature_apply_to_chars(hdc, psa, psc, &pwChar[s->start], 1, 2, "rphf") > 0);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static int FindBaseConsonant(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPCWSTR input, IndicSyllable *s, lexical_function lex, BOOL modern)
|
||||
static int FindBaseConsonant(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc,
|
||||
const WCHAR *input, IndicSyllable *s, lexical_function lex, BOOL modern)
|
||||
{
|
||||
int i;
|
||||
BOOL blwf = FALSE;
|
||||
|
@ -301,11 +307,12 @@ static int FindBaseConsonant(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LP
|
|||
return s->base;
|
||||
}
|
||||
|
||||
void Indic_ParseSyllables( HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPCWSTR input, const int cChar, IndicSyllable **syllables, int *syllable_count, lexical_function lex, BOOL modern)
|
||||
void Indic_ParseSyllables(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, const WCHAR *input, unsigned int cChar,
|
||||
IndicSyllable **syllables, int *syllable_count, lexical_function lex, BOOL modern)
|
||||
{
|
||||
unsigned int center = 0;
|
||||
int index = 0;
|
||||
int next = 0;
|
||||
int center = 0;
|
||||
|
||||
*syllable_count = 0;
|
||||
|
||||
|
@ -329,7 +336,7 @@ void Indic_ParseSyllables( HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPCW
|
|||
if (*syllable_count)
|
||||
*syllables = HeapReAlloc(GetProcessHeap(),0,*syllables, sizeof(IndicSyllable)*(*syllable_count+1));
|
||||
else
|
||||
*syllables = HeapAlloc(GetProcessHeap(),0,sizeof(IndicSyllable));
|
||||
*syllables = heap_alloc(sizeof(**syllables));
|
||||
(*syllables)[*syllable_count].start = index;
|
||||
(*syllables)[*syllable_count].base = center;
|
||||
(*syllables)[*syllable_count].ralf = -1;
|
||||
|
@ -349,7 +356,8 @@ void Indic_ParseSyllables( HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPCW
|
|||
TRACE("Processed %i of %i characters into %i syllables\n",index,cChar,*syllable_count);
|
||||
}
|
||||
|
||||
void Indic_ReorderCharacters( HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPWSTR input, int cChar, IndicSyllable **syllables, int *syllable_count, lexical_function lex, reorder_function reorder_f, BOOL modern)
|
||||
void Indic_ReorderCharacters(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, WCHAR *input, unsigned int cChar,
|
||||
IndicSyllable **syllables, int *syllable_count, lexical_function lex, reorder_function reorder_f, BOOL modern)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -108,12 +108,13 @@ typedef struct tagConsonantComponents
|
|||
WCHAR output;
|
||||
} ConsonantComponents;
|
||||
|
||||
typedef void (*second_reorder_function)(LPWSTR pwChar, IndicSyllable *syllable,WORD* pwGlyphs, IndicSyllable* glyph_index, lexical_function lex);
|
||||
typedef void (*second_reorder_function)(const WCHAR *chars, const IndicSyllable *syllable,
|
||||
WORD *glyphs, const IndicSyllable *glyph_index, lexical_function lex);
|
||||
|
||||
typedef int (*combining_lexical_function)(WCHAR c);
|
||||
|
||||
/* the orders of joined_forms and contextual_features need to line up */
|
||||
static const char* contextual_features[] =
|
||||
static const char *const contextual_features[] =
|
||||
{
|
||||
"isol",
|
||||
"fina",
|
||||
|
@ -156,7 +157,7 @@ static OPENTYPE_FEATURE_RECORD arabic_features[] =
|
|||
{ MS_MAKE_TAG('m','s','e','t'), 1},
|
||||
};
|
||||
|
||||
static const char* required_arabic_features[] =
|
||||
static const char *const required_arabic_features[] =
|
||||
{
|
||||
"fina",
|
||||
"init",
|
||||
|
@ -193,7 +194,7 @@ static OPENTYPE_FEATURE_RECORD syriac_features[] =
|
|||
{ MS_MAKE_TAG('d','l','i','g'), 1},
|
||||
};
|
||||
|
||||
static const char* required_syriac_features[] =
|
||||
static const char *const required_syriac_features[] =
|
||||
{
|
||||
"fina",
|
||||
"fin2",
|
||||
|
@ -251,13 +252,13 @@ static OPENTYPE_FEATURE_RECORD thai_gpos_features[] =
|
|||
{ MS_MAKE_TAG('m','k','m','k'), 1},
|
||||
};
|
||||
|
||||
static const char* required_lao_features[] =
|
||||
static const char *const required_lao_features[] =
|
||||
{
|
||||
"ccmp",
|
||||
NULL
|
||||
};
|
||||
|
||||
static const char* required_devanagari_features[] =
|
||||
static const char *const required_devanagari_features[] =
|
||||
{
|
||||
"nukt",
|
||||
"akhn",
|
||||
|
@ -297,7 +298,7 @@ static OPENTYPE_FEATURE_RECORD myanmar_features[] =
|
|||
{ MS_MAKE_TAG('c','l','i','g'), 1},
|
||||
};
|
||||
|
||||
static const char* required_bengali_features[] =
|
||||
static const char *const required_bengali_features[] =
|
||||
{
|
||||
"nukt",
|
||||
"akhn",
|
||||
|
@ -314,7 +315,7 @@ static const char* required_bengali_features[] =
|
|||
NULL
|
||||
};
|
||||
|
||||
static const char* required_gurmukhi_features[] =
|
||||
static const char *const required_gurmukhi_features[] =
|
||||
{
|
||||
"nukt",
|
||||
"akhn",
|
||||
|
@ -333,7 +334,7 @@ static const char* required_gurmukhi_features[] =
|
|||
NULL
|
||||
};
|
||||
|
||||
static const char* required_oriya_features[] =
|
||||
static const char *const required_oriya_features[] =
|
||||
{
|
||||
"nukt",
|
||||
"akhn",
|
||||
|
@ -350,7 +351,7 @@ static const char* required_oriya_features[] =
|
|||
NULL
|
||||
};
|
||||
|
||||
static const char* required_tamil_features[] =
|
||||
static const char *const required_tamil_features[] =
|
||||
{
|
||||
"nukt",
|
||||
"akhn",
|
||||
|
@ -366,7 +367,7 @@ static const char* required_tamil_features[] =
|
|||
NULL
|
||||
};
|
||||
|
||||
static const char* required_telugu_features[] =
|
||||
static const char *const required_telugu_features[] =
|
||||
{
|
||||
"nukt",
|
||||
"akhn",
|
||||
|
@ -393,7 +394,7 @@ static OPENTYPE_FEATURE_RECORD khmer_features[] =
|
|||
{ MS_MAKE_TAG('c','l','i','g'), 1},
|
||||
};
|
||||
|
||||
static const char* required_khmer_features[] =
|
||||
static const char *const required_khmer_features[] =
|
||||
{
|
||||
"pref",
|
||||
"blwf",
|
||||
|
@ -434,7 +435,7 @@ static OPENTYPE_FEATURE_RECORD mongolian_features[] =
|
|||
typedef struct ScriptShapeDataTag {
|
||||
TEXTRANGE_PROPERTIES defaultTextRange;
|
||||
TEXTRANGE_PROPERTIES defaultGPOSTextRange;
|
||||
const char** requiredFeatures;
|
||||
const char *const *requiredFeatures;
|
||||
OPENTYPE_TAG newOtTag;
|
||||
ContextualShapingProc contextProc;
|
||||
ShapeCharGlyphPropProc charGlyphPropProc;
|
||||
|
@ -529,7 +530,8 @@ static const ScriptShapeData ShapingData[] =
|
|||
|
||||
extern scriptData scriptInformation[];
|
||||
|
||||
static INT GSUB_apply_feature_all_lookups(LPCVOID header, LoadedFeature *feature, WORD *glyphs, INT glyph_index, INT write_dir, INT *glyph_count)
|
||||
static int GSUB_apply_feature_all_lookups(const void *header, LoadedFeature *feature,
|
||||
WORD *glyphs, unsigned int glyph_index, int write_dir, int *glyph_count)
|
||||
{
|
||||
int i;
|
||||
int out_index = GSUB_E_NOGLYPH;
|
||||
|
@ -553,19 +555,21 @@ static INT GSUB_apply_feature_all_lookups(LPCVOID header, LoadedFeature *feature
|
|||
return out_index;
|
||||
}
|
||||
|
||||
static OPENTYPE_TAG get_opentype_script(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, BOOL tryNew)
|
||||
static OPENTYPE_TAG get_opentype_script(HDC hdc, const SCRIPT_ANALYSIS *psa,
|
||||
const ScriptCache *script_cache, BOOL try_new)
|
||||
{
|
||||
UINT charset;
|
||||
|
||||
if (psc->userScript != 0)
|
||||
if (script_cache->userScript)
|
||||
{
|
||||
if (tryNew && ShapingData[psa->eScript].newOtTag != 0 && psc->userScript == scriptInformation[psa->eScript].scriptTag)
|
||||
if (try_new && ShapingData[psa->eScript].newOtTag
|
||||
&& script_cache->userScript == scriptInformation[psa->eScript].scriptTag)
|
||||
return ShapingData[psa->eScript].newOtTag;
|
||||
else
|
||||
return psc->userScript;
|
||||
|
||||
return script_cache->userScript;
|
||||
}
|
||||
|
||||
if (tryNew && ShapingData[psa->eScript].newOtTag != 0)
|
||||
if (try_new && ShapingData[psa->eScript].newOtTag)
|
||||
return ShapingData[psa->eScript].newOtTag;
|
||||
|
||||
if (scriptInformation[psa->eScript].scriptTag)
|
||||
|
@ -648,7 +652,7 @@ static VOID *load_gsub_table(HDC hdc)
|
|||
int length = GetFontData(hdc, MS_MAKE_TAG('G', 'S', 'U', 'B'), 0, NULL, 0);
|
||||
if (length != GDI_ERROR)
|
||||
{
|
||||
GSUB_Table = HeapAlloc(GetProcessHeap(),0,length);
|
||||
GSUB_Table = heap_alloc(length);
|
||||
GetFontData(hdc, MS_MAKE_TAG('G', 'S', 'U', 'B'), 0, GSUB_Table, length);
|
||||
TRACE("Loaded GSUB table of %i bytes\n",length);
|
||||
}
|
||||
|
@ -661,7 +665,7 @@ static VOID *load_gpos_table(HDC hdc)
|
|||
int length = GetFontData(hdc, MS_MAKE_TAG('G', 'P', 'O', 'S'), 0, NULL, 0);
|
||||
if (length != GDI_ERROR)
|
||||
{
|
||||
GPOS_Table = HeapAlloc(GetProcessHeap(),0,length);
|
||||
GPOS_Table = heap_alloc(length);
|
||||
GetFontData(hdc, MS_MAKE_TAG('G', 'P', 'O', 'S'), 0, GPOS_Table, length);
|
||||
TRACE("Loaded GPOS table of %i bytes\n",length);
|
||||
}
|
||||
|
@ -674,7 +678,7 @@ static VOID *load_gdef_table(HDC hdc)
|
|||
int length = GetFontData(hdc, MS_MAKE_TAG('G', 'D', 'E', 'F'), 0, NULL, 0);
|
||||
if (length != GDI_ERROR)
|
||||
{
|
||||
GDEF_Table = HeapAlloc(GetProcessHeap(),0,length);
|
||||
GDEF_Table = heap_alloc(length);
|
||||
GetFontData(hdc, MS_MAKE_TAG('G', 'D', 'E', 'F'), 0, GDEF_Table, length);
|
||||
TRACE("Loaded GDEF table of %i bytes\n",length);
|
||||
}
|
||||
|
@ -697,7 +701,7 @@ INT SHAPE_does_GSUB_feature_apply_to_chars(HDC hdc, SCRIPT_ANALYSIS *psa, Script
|
|||
INT glyph_count = count;
|
||||
INT rc;
|
||||
|
||||
glyphs = HeapAlloc(GetProcessHeap(),0,sizeof(WORD)*(count*2));
|
||||
glyphs = heap_alloc(2 * count * sizeof(*glyphs));
|
||||
GetGlyphIndicesW(hdc, chars, count, glyphs, 0);
|
||||
rc = apply_GSUB_feature_to_glyph(hdc, psa, psc, glyphs, 0, write_dir, &glyph_count, feature);
|
||||
if (rc > GSUB_E_NOGLYPH)
|
||||
|
@ -705,7 +709,7 @@ INT SHAPE_does_GSUB_feature_apply_to_chars(HDC hdc, SCRIPT_ANALYSIS *psa, Script
|
|||
else
|
||||
rc = 0;
|
||||
|
||||
HeapFree(GetProcessHeap(),0,glyphs);
|
||||
heap_free(glyphs);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -739,13 +743,12 @@ static void UpdateClusters(int nextIndex, int changeCount, int write_dir, int ch
|
|||
return;
|
||||
else
|
||||
{
|
||||
int cluster_dir = pwLogClust[0] < pwLogClust[chars-1] ? 1 : -1;
|
||||
int i;
|
||||
int target_glyph = nextIndex - write_dir;
|
||||
int seeking_glyph;
|
||||
int target_index = -1;
|
||||
int replacing_glyph = -1;
|
||||
int changed = 0;
|
||||
int top_logclust = 0;
|
||||
|
||||
if (changeCount > 0)
|
||||
{
|
||||
|
@ -755,35 +758,7 @@ static void UpdateClusters(int nextIndex, int changeCount, int write_dir, int ch
|
|||
target_glyph = nextIndex + (changeCount + 1);
|
||||
}
|
||||
|
||||
seeking_glyph = target_glyph;
|
||||
for (i = 0; i < chars; i++)
|
||||
if (pwLogClust[i] > top_logclust)
|
||||
top_logclust = pwLogClust[i];
|
||||
|
||||
do {
|
||||
if (write_dir > 0)
|
||||
for (i = 0; i < chars; i++)
|
||||
{
|
||||
if (pwLogClust[i] == seeking_glyph)
|
||||
{
|
||||
target_index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
for (i = chars - 1; i >= 0; i--)
|
||||
{
|
||||
if (pwLogClust[i] == seeking_glyph)
|
||||
{
|
||||
target_index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (target_index == -1)
|
||||
seeking_glyph ++;
|
||||
}
|
||||
while (target_index == -1 && seeking_glyph <= top_logclust);
|
||||
|
||||
target_index = USP10_FindGlyphInLogClust(pwLogClust, chars, target_glyph);
|
||||
if (target_index == -1)
|
||||
{
|
||||
ERR("Unable to find target glyph\n");
|
||||
|
@ -793,7 +768,7 @@ static void UpdateClusters(int nextIndex, int changeCount, int write_dir, int ch
|
|||
if (changeCount < 0)
|
||||
{
|
||||
/* merge glyphs */
|
||||
for(i = target_index; i < chars && i >= 0; i+=write_dir)
|
||||
for (i = target_index; i < chars && i >= 0; i += cluster_dir)
|
||||
{
|
||||
if (pwLogClust[i] == target_glyph)
|
||||
continue;
|
||||
|
@ -812,8 +787,8 @@ static void UpdateClusters(int nextIndex, int changeCount, int write_dir, int ch
|
|||
}
|
||||
}
|
||||
|
||||
/* renumber trailing indexes*/
|
||||
for(i = target_index; i < chars && i >= 0; i+=write_dir)
|
||||
/* renumber trailing indexes */
|
||||
for (i = target_index; i < chars && i >= 0; i += cluster_dir)
|
||||
{
|
||||
if (pwLogClust[i] != target_glyph)
|
||||
pwLogClust[i] += changeCount;
|
||||
|
@ -821,8 +796,8 @@ static void UpdateClusters(int nextIndex, int changeCount, int write_dir, int ch
|
|||
}
|
||||
else
|
||||
{
|
||||
for(i = target_index; i < chars && i >= 0; i+=write_dir)
|
||||
pwLogClust[i] += changeCount;
|
||||
for (i = target_index; i < chars && i >= 0; i += cluster_dir)
|
||||
pwLogClust[i] += changeCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -868,16 +843,21 @@ static int apply_GSUB_feature(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, W
|
|||
return GSUB_E_NOFEATURE;
|
||||
}
|
||||
|
||||
static VOID GPOS_apply_feature(ScriptCache *psc, LPOUTLINETEXTMETRICW lpotm, LPLOGFONTW lplogfont, const SCRIPT_ANALYSIS *analysis, INT* piAdvance, LoadedFeature *feature, const WORD *glyphs, INT glyph_count, GOFFSET *pGoffset)
|
||||
static void GPOS_apply_feature(const ScriptCache *psc, const OUTLINETEXTMETRICW *otm,
|
||||
const LOGFONTW *logfont, const SCRIPT_ANALYSIS *analysis, int *advance,
|
||||
const LoadedFeature *feature, const WORD *glyphs, int glyph_count, GOFFSET *goffset)
|
||||
{
|
||||
int i;
|
||||
int dir = analysis->fLogicalOrder && analysis->fRTL ? -1 : 1;
|
||||
unsigned int start_idx, i, j;
|
||||
|
||||
TRACE("%i lookups\n", feature->lookup_count);
|
||||
|
||||
start_idx = dir < 0 ? glyph_count - 1 : 0;
|
||||
for (i = 0; i < feature->lookup_count; i++)
|
||||
{
|
||||
int j;
|
||||
for (j = 0; j < glyph_count; )
|
||||
j = OpenType_apply_GPOS_lookup(psc, lpotm, lplogfont, analysis, piAdvance, feature->lookups[i], glyphs, j, glyph_count, pGoffset);
|
||||
j += OpenType_apply_GPOS_lookup(psc, otm, logfont, analysis, advance,
|
||||
feature->lookups[i], glyphs, start_idx + dir * j, glyph_count, goffset);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -912,7 +892,7 @@ static void mark_invalid_combinations(HDC hdc, const WCHAR* pwcChars, INT cChars
|
|||
WCHAR invalid = 0x25cc;
|
||||
WORD invalid_glyph;
|
||||
|
||||
context_type = HeapAlloc(GetProcessHeap(),0,cChars);
|
||||
context_type = heap_alloc(cChars);
|
||||
|
||||
/* Mark invalid combinations */
|
||||
for (i = 0; i < cChars; i++)
|
||||
|
@ -928,7 +908,7 @@ static void mark_invalid_combinations(HDC hdc, const WCHAR* pwcChars, INT cChars
|
|||
}
|
||||
}
|
||||
|
||||
HeapFree(GetProcessHeap(),0,context_type);
|
||||
heap_free(context_type);
|
||||
}
|
||||
|
||||
static void ContextualShape_Control(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR* pwcChars, INT cChars, WORD* pwOutGlyphs, INT* pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
|
||||
|
@ -1069,21 +1049,21 @@ static void ContextualShape_Arabic(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *p
|
|||
return;
|
||||
}
|
||||
|
||||
if (!psa->fLogicalOrder && psa->fRTL)
|
||||
{
|
||||
dirR = 1;
|
||||
dirL = -1;
|
||||
}
|
||||
else
|
||||
if (psa->fLogicalOrder && psa->fRTL)
|
||||
{
|
||||
dirR = -1;
|
||||
dirL = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
dirR = 1;
|
||||
dirL = -1;
|
||||
}
|
||||
|
||||
load_ot_tables(hdc, psc);
|
||||
|
||||
context_type = HeapAlloc(GetProcessHeap(),0,cChars);
|
||||
context_shape = HeapAlloc(GetProcessHeap(),0,sizeof(INT) * cChars);
|
||||
context_type = heap_alloc(cChars);
|
||||
context_shape = heap_alloc(cChars * sizeof(*context_shape));
|
||||
|
||||
for (i = 0; i < cChars; i++)
|
||||
context_type[i] = get_table_entry( wine_shaping_table, pwcChars[i] );
|
||||
|
@ -1143,8 +1123,14 @@ static void ContextualShape_Arabic(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *p
|
|||
offset = *pcGlyphs - prevCount;
|
||||
glyph_index += dirL * (offset + 1);
|
||||
}
|
||||
shaped = TRUE;
|
||||
}
|
||||
else if (nextIndex == GSUB_E_NOGLYPH)
|
||||
{
|
||||
char_index += dirL;
|
||||
glyph_index += dirL;
|
||||
shaped = TRUE;
|
||||
}
|
||||
shaped = (nextIndex > GSUB_E_NOGLYPH);
|
||||
}
|
||||
|
||||
if (!shaped)
|
||||
|
@ -1165,8 +1151,8 @@ static void ContextualShape_Arabic(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *p
|
|||
}
|
||||
}
|
||||
|
||||
HeapFree(GetProcessHeap(),0,context_shape);
|
||||
HeapFree(GetProcessHeap(),0,context_type);
|
||||
heap_free(context_shape);
|
||||
heap_free(context_type);
|
||||
|
||||
mark_invalid_combinations(hdc, pwcChars, cChars, pwOutGlyphs, pcGlyphs, dirL, pwLogClust, combining_lexical_Arabic);
|
||||
}
|
||||
|
@ -1333,8 +1319,8 @@ static void ContextualShape_Syriac(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *p
|
|||
if (!psc->GSUB_Table)
|
||||
return;
|
||||
|
||||
context_type = HeapAlloc(GetProcessHeap(),0,cChars);
|
||||
context_shape = HeapAlloc(GetProcessHeap(),0,sizeof(INT) * cChars);
|
||||
context_type = heap_alloc(cChars);
|
||||
context_shape = heap_alloc(cChars * sizeof(*context_shape));
|
||||
|
||||
for (i = 0; i < cChars; i++)
|
||||
context_type[i] = get_table_entry( wine_shaping_table, pwcChars[i] );
|
||||
|
@ -1413,8 +1399,8 @@ right_join_causing(neighbour_joining_type(i,dirR,context_type,cChars,psa)))
|
|||
}
|
||||
}
|
||||
|
||||
HeapFree(GetProcessHeap(),0,context_shape);
|
||||
HeapFree(GetProcessHeap(),0,context_type);
|
||||
heap_free(context_shape);
|
||||
heap_free(context_type);
|
||||
|
||||
mark_invalid_combinations(hdc, pwcChars, cChars, pwOutGlyphs, pcGlyphs, dirL, pwLogClust, combining_lexical_Syriac);
|
||||
}
|
||||
|
@ -1495,7 +1481,7 @@ static void ContextualShape_Phags_pa(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS
|
|||
if (!psc->GSUB_Table)
|
||||
return;
|
||||
|
||||
context_shape = HeapAlloc(GetProcessHeap(),0,sizeof(INT) * cChars);
|
||||
context_shape = heap_alloc(cChars * sizeof(*context_shape));
|
||||
|
||||
for (i = 0; i < cChars; i++)
|
||||
{
|
||||
|
@ -1552,7 +1538,7 @@ static void ContextualShape_Phags_pa(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS
|
|||
}
|
||||
}
|
||||
|
||||
HeapFree(GetProcessHeap(),0,context_shape);
|
||||
heap_free(context_shape);
|
||||
}
|
||||
|
||||
static int combining_lexical_Thai(WCHAR c)
|
||||
|
@ -1721,7 +1707,7 @@ static void ComposeConsonants(HDC hdc, WCHAR *pwOutChars, INT *pcChars, const Co
|
|||
}
|
||||
}
|
||||
|
||||
static void Reorder_Ra_follows_base(LPWSTR pwChar, IndicSyllable *s, lexical_function lexical)
|
||||
static void Reorder_Ra_follows_base(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
|
||||
{
|
||||
if (s->ralf >= 0)
|
||||
{
|
||||
|
@ -1740,7 +1726,7 @@ static void Reorder_Ra_follows_base(LPWSTR pwChar, IndicSyllable *s, lexical_fun
|
|||
}
|
||||
}
|
||||
|
||||
static void Reorder_Ra_follows_matra(LPWSTR pwChar, IndicSyllable *s, lexical_function lexical)
|
||||
static void Reorder_Ra_follows_matra(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
|
||||
{
|
||||
if (s->ralf >= 0)
|
||||
{
|
||||
|
@ -1765,7 +1751,7 @@ static void Reorder_Ra_follows_matra(LPWSTR pwChar, IndicSyllable *s, lexical_fu
|
|||
}
|
||||
}
|
||||
|
||||
static void Reorder_Ra_follows_syllable(LPWSTR pwChar, IndicSyllable *s, lexical_function lexical)
|
||||
static void Reorder_Ra_follows_syllable(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
|
||||
{
|
||||
if (s->ralf >= 0)
|
||||
{
|
||||
|
@ -1786,7 +1772,7 @@ static void Reorder_Ra_follows_syllable(LPWSTR pwChar, IndicSyllable *s, lexical
|
|||
}
|
||||
}
|
||||
|
||||
static void Reorder_Matra_precede_base(LPWSTR pwChar, IndicSyllable *s, lexical_function lexical)
|
||||
static void Reorder_Matra_precede_base(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -1813,7 +1799,7 @@ static void Reorder_Matra_precede_base(LPWSTR pwChar, IndicSyllable *s, lexical_
|
|||
}
|
||||
}
|
||||
|
||||
static void Reorder_Matra_precede_syllable(LPWSTR pwChar, IndicSyllable *s, lexical_function lexical)
|
||||
static void Reorder_Matra_precede_syllable(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -1840,14 +1826,16 @@ static void Reorder_Matra_precede_syllable(LPWSTR pwChar, IndicSyllable *s, lexi
|
|||
}
|
||||
}
|
||||
|
||||
static void SecondReorder_Blwf_follows_matra(LPWSTR pwChar, IndicSyllable *s, WORD *glyphs, IndicSyllable *g, lexical_function lexical)
|
||||
static void SecondReorder_Blwf_follows_matra(const WCHAR *chars, const IndicSyllable *s,
|
||||
WORD *glyphs, const IndicSyllable *g, lexical_function lexical)
|
||||
{
|
||||
if (s->blwf >= 0 && g->blwf > g->base)
|
||||
{
|
||||
int j,loc;
|
||||
int g_offset;
|
||||
for (loc = s->end; loc > s->blwf; loc--)
|
||||
if (lexical(pwChar[loc]) == lex_Matra_below || lexical(pwChar[loc]) == lex_Matra_above || lexical(pwChar[loc]) == lex_Matra_post)
|
||||
if (lexical(chars[loc]) == lex_Matra_below || lexical(chars[loc]) == lex_Matra_above
|
||||
|| lexical(chars[loc]) == lex_Matra_post)
|
||||
break;
|
||||
|
||||
g_offset = (loc - s->blwf) - 1;
|
||||
|
@ -1864,14 +1852,15 @@ static void SecondReorder_Blwf_follows_matra(LPWSTR pwChar, IndicSyllable *s, WO
|
|||
}
|
||||
}
|
||||
|
||||
static void SecondReorder_Matra_precede_base(LPWSTR pwChar, IndicSyllable *s, WORD *glyphs, IndicSyllable *g, lexical_function lexical)
|
||||
static void SecondReorder_Matra_precede_base(const WCHAR *chars, const IndicSyllable *s,
|
||||
WORD *glyphs, const IndicSyllable *g, lexical_function lexical)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* reorder previously moved Matras to correct position*/
|
||||
for (i = s->start; i < s->base; i++)
|
||||
{
|
||||
if (lexical(pwChar[i]) == lex_Matra_pre)
|
||||
if (lexical(chars[i]) == lex_Matra_pre)
|
||||
{
|
||||
int j;
|
||||
int g_start = g->start + i - s->start;
|
||||
|
@ -1887,7 +1876,8 @@ static void SecondReorder_Matra_precede_base(LPWSTR pwChar, IndicSyllable *s, WO
|
|||
}
|
||||
}
|
||||
|
||||
static void SecondReorder_Pref_precede_base(LPWSTR pwChar, IndicSyllable *s, WORD *glyphs, IndicSyllable *g, lexical_function lexical)
|
||||
static void SecondReorder_Pref_precede_base(const IndicSyllable *s,
|
||||
WORD *glyphs, const IndicSyllable *g, lexical_function lexical)
|
||||
{
|
||||
if (s->pref >= 0 && g->pref > g->base)
|
||||
{
|
||||
|
@ -1900,7 +1890,7 @@ static void SecondReorder_Pref_precede_base(LPWSTR pwChar, IndicSyllable *s, WOR
|
|||
}
|
||||
}
|
||||
|
||||
static void Reorder_Like_Sinhala(LPWSTR pwChar, IndicSyllable *s, lexical_function lexical)
|
||||
static void Reorder_Like_Sinhala(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
|
||||
{
|
||||
TRACE("Syllable (%i..%i..%i)\n",s->start,s->base,s->end);
|
||||
if (s->start == s->base && s->base == s->end) return;
|
||||
|
@ -1910,7 +1900,7 @@ static void Reorder_Like_Sinhala(LPWSTR pwChar, IndicSyllable *s, lexical_functi
|
|||
Reorder_Matra_precede_base(pwChar, s, lexical);
|
||||
}
|
||||
|
||||
static void Reorder_Like_Devanagari(LPWSTR pwChar, IndicSyllable *s, lexical_function lexical)
|
||||
static void Reorder_Like_Devanagari(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
|
||||
{
|
||||
TRACE("Syllable (%i..%i..%i)\n",s->start,s->base,s->end);
|
||||
if (s->start == s->base && s->base == s->end) return;
|
||||
|
@ -1920,7 +1910,7 @@ static void Reorder_Like_Devanagari(LPWSTR pwChar, IndicSyllable *s, lexical_fun
|
|||
Reorder_Matra_precede_syllable(pwChar, s, lexical);
|
||||
}
|
||||
|
||||
static void Reorder_Like_Bengali(LPWSTR pwChar, IndicSyllable *s, lexical_function lexical)
|
||||
static void Reorder_Like_Bengali(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
|
||||
{
|
||||
TRACE("Syllable (%i..%i..%i)\n",s->start,s->base,s->end);
|
||||
if (s->start == s->base && s->base == s->end) return;
|
||||
|
@ -1930,7 +1920,7 @@ static void Reorder_Like_Bengali(LPWSTR pwChar, IndicSyllable *s, lexical_functi
|
|||
Reorder_Matra_precede_syllable(pwChar, s, lexical);
|
||||
}
|
||||
|
||||
static void Reorder_Like_Kannada(LPWSTR pwChar, IndicSyllable *s, lexical_function lexical)
|
||||
static void Reorder_Like_Kannada(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
|
||||
{
|
||||
TRACE("Syllable (%i..%i..%i)\n",s->start,s->base,s->end);
|
||||
if (s->start == s->base && s->base == s->end) return;
|
||||
|
@ -1940,25 +1930,27 @@ static void Reorder_Like_Kannada(LPWSTR pwChar, IndicSyllable *s, lexical_functi
|
|||
Reorder_Matra_precede_syllable(pwChar, s, lexical);
|
||||
}
|
||||
|
||||
static void SecondReorder_Like_Telugu(LPWSTR pwChar, IndicSyllable *s, WORD* pwGlyphs, IndicSyllable *g, lexical_function lexical)
|
||||
static void SecondReorder_Like_Telugu(const WCHAR *chars, const IndicSyllable *s,
|
||||
WORD *glyphs, const IndicSyllable *g, lexical_function lexical)
|
||||
{
|
||||
TRACE("Syllable (%i..%i..%i)\n",s->start,s->base,s->end);
|
||||
TRACE("Glyphs (%i..%i..%i)\n",g->start,g->base,g->end);
|
||||
if (s->start == s->base && s->base == s->end) return;
|
||||
if (lexical(pwChar[s->base]) == lex_Vowel) return;
|
||||
if (lexical(chars[s->base]) == lex_Vowel) return;
|
||||
|
||||
SecondReorder_Blwf_follows_matra(pwChar, s, pwGlyphs, g, lexical);
|
||||
SecondReorder_Blwf_follows_matra(chars, s, glyphs, g, lexical);
|
||||
}
|
||||
|
||||
static void SecondReorder_Like_Tamil(LPWSTR pwChar, IndicSyllable *s, WORD* pwGlyphs, IndicSyllable *g, lexical_function lexical)
|
||||
static void SecondReorder_Like_Tamil(const WCHAR *chars, const IndicSyllable *s,
|
||||
WORD *glyphs, const IndicSyllable *g, lexical_function lexical)
|
||||
{
|
||||
TRACE("Syllable (%i..%i..%i)\n",s->start,s->base,s->end);
|
||||
TRACE("Glyphs (%i..%i..%i)\n",g->start,g->base,g->end);
|
||||
if (s->start == s->base && s->base == s->end) return;
|
||||
if (lexical(pwChar[s->base]) == lex_Vowel) return;
|
||||
if (lexical(chars[s->base]) == lex_Vowel) return;
|
||||
|
||||
SecondReorder_Matra_precede_base(pwChar, s, pwGlyphs, g, lexical);
|
||||
SecondReorder_Pref_precede_base(pwChar, s, pwGlyphs, g, lexical);
|
||||
SecondReorder_Matra_precede_base(chars, s, glyphs, g, lexical);
|
||||
SecondReorder_Pref_precede_base(s, glyphs, g, lexical);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2283,7 +2275,7 @@ static void ContextualShape_Sinhala(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *
|
|||
return;
|
||||
}
|
||||
|
||||
input = HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR) * (cChars * 3));
|
||||
input = heap_alloc(3 * cChars * sizeof(*input));
|
||||
|
||||
memcpy(input, pwcChars, cChars * sizeof(WCHAR));
|
||||
|
||||
|
@ -2309,8 +2301,8 @@ static void ContextualShape_Sinhala(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *
|
|||
*pcGlyphs = cCount;
|
||||
ShapeIndicSyllables(hdc, psc, psa, input, cChars, syllables, syllable_count, pwOutGlyphs, pcGlyphs, pwLogClust, sinhala_lex, NULL, TRUE);
|
||||
|
||||
HeapFree(GetProcessHeap(),0,input);
|
||||
HeapFree(GetProcessHeap(),0,syllables);
|
||||
heap_free(input);
|
||||
heap_free(syllables);
|
||||
}
|
||||
|
||||
static int devanagari_lex(WCHAR c)
|
||||
|
@ -2350,7 +2342,7 @@ static void ContextualShape_Devanagari(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSI
|
|||
return;
|
||||
}
|
||||
|
||||
input = HeapAlloc(GetProcessHeap(), 0, cChars * sizeof(WCHAR));
|
||||
input = heap_alloc(cChars * sizeof(*input));
|
||||
memcpy(input, pwcChars, cChars * sizeof(WCHAR));
|
||||
|
||||
/* Step 1: Compose Consonant and Nukta */
|
||||
|
@ -2366,8 +2358,8 @@ static void ContextualShape_Devanagari(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSI
|
|||
/* Step 3: Base Form application to syllables */
|
||||
ShapeIndicSyllables(hdc, psc, psa, input, cChars, syllables, syllable_count, pwOutGlyphs, pcGlyphs, pwLogClust, devanagari_lex, NULL, modern);
|
||||
|
||||
HeapFree(GetProcessHeap(),0,input);
|
||||
HeapFree(GetProcessHeap(),0,syllables);
|
||||
heap_free(input);
|
||||
heap_free(syllables);
|
||||
}
|
||||
|
||||
static int bengali_lex(WCHAR c)
|
||||
|
@ -2406,7 +2398,7 @@ static void ContextualShape_Bengali(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *
|
|||
return;
|
||||
}
|
||||
|
||||
input = HeapAlloc(GetProcessHeap(), 0, (cChars * 2) * sizeof(WCHAR));
|
||||
input = heap_alloc(2 * cChars * sizeof(*input));
|
||||
memcpy(input, pwcChars, cChars * sizeof(WCHAR));
|
||||
|
||||
/* Step 1: Decompose Vowels and Compose Consonants */
|
||||
|
@ -2436,8 +2428,8 @@ static void ContextualShape_Bengali(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *
|
|||
/* Step 4: Base Form application to syllables */
|
||||
ShapeIndicSyllables(hdc, psc, psa, input, cChars, syllables, syllable_count, pwOutGlyphs, pcGlyphs, pwLogClust, bengali_lex, NULL, modern);
|
||||
|
||||
HeapFree(GetProcessHeap(),0,input);
|
||||
HeapFree(GetProcessHeap(),0,syllables);
|
||||
heap_free(input);
|
||||
heap_free(syllables);
|
||||
}
|
||||
|
||||
static int gurmukhi_lex(WCHAR c)
|
||||
|
@ -2470,7 +2462,7 @@ static void ContextualShape_Gurmukhi(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS
|
|||
return;
|
||||
}
|
||||
|
||||
input = HeapAlloc(GetProcessHeap(), 0, cChars * sizeof(WCHAR));
|
||||
input = heap_alloc(cChars * sizeof(*input));
|
||||
memcpy(input, pwcChars, cChars * sizeof(WCHAR));
|
||||
|
||||
/* Step 1: Compose Consonants */
|
||||
|
@ -2486,8 +2478,8 @@ static void ContextualShape_Gurmukhi(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS
|
|||
/* Step 3: Base Form application to syllables */
|
||||
ShapeIndicSyllables(hdc, psc, psa, input, cChars, syllables, syllable_count, pwOutGlyphs, pcGlyphs, pwLogClust, gurmukhi_lex, NULL, modern);
|
||||
|
||||
HeapFree(GetProcessHeap(),0,input);
|
||||
HeapFree(GetProcessHeap(),0,syllables);
|
||||
heap_free(input);
|
||||
heap_free(syllables);
|
||||
}
|
||||
|
||||
static int gujarati_lex(WCHAR c)
|
||||
|
@ -2514,7 +2506,7 @@ static void ContextualShape_Gujarati(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS
|
|||
return;
|
||||
}
|
||||
|
||||
input = HeapAlloc(GetProcessHeap(), 0, cChars * sizeof(WCHAR));
|
||||
input = heap_alloc(cChars * sizeof(*input));
|
||||
memcpy(input, pwcChars, cChars * sizeof(WCHAR));
|
||||
|
||||
/* Step 1: Reorder within Syllables */
|
||||
|
@ -2526,8 +2518,8 @@ static void ContextualShape_Gujarati(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS
|
|||
/* Step 2: Base Form application to syllables */
|
||||
ShapeIndicSyllables(hdc, psc, psa, input, cChars, syllables, syllable_count, pwOutGlyphs, pcGlyphs, pwLogClust, gujarati_lex, NULL, modern);
|
||||
|
||||
HeapFree(GetProcessHeap(),0,input);
|
||||
HeapFree(GetProcessHeap(),0,syllables);
|
||||
heap_free(input);
|
||||
heap_free(syllables);
|
||||
}
|
||||
|
||||
static int oriya_lex(WCHAR c)
|
||||
|
@ -2565,7 +2557,7 @@ static void ContextualShape_Oriya(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *ps
|
|||
return;
|
||||
}
|
||||
|
||||
input = HeapAlloc(GetProcessHeap(), 0, (cChars*2) * sizeof(WCHAR));
|
||||
input = heap_alloc(2 * cChars * sizeof(*input));
|
||||
memcpy(input, pwcChars, cChars * sizeof(WCHAR));
|
||||
|
||||
/* Step 1: Decompose Vowels and Compose Consonants */
|
||||
|
@ -2582,8 +2574,8 @@ static void ContextualShape_Oriya(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *ps
|
|||
/* Step 3: Base Form application to syllables */
|
||||
ShapeIndicSyllables(hdc, psc, psa, input, cChars, syllables, syllable_count, pwOutGlyphs, pcGlyphs, pwLogClust, oriya_lex, NULL, modern);
|
||||
|
||||
HeapFree(GetProcessHeap(),0,input);
|
||||
HeapFree(GetProcessHeap(),0,syllables);
|
||||
heap_free(input);
|
||||
heap_free(syllables);
|
||||
}
|
||||
|
||||
static int tamil_lex(WCHAR c)
|
||||
|
@ -2615,7 +2607,7 @@ static void ContextualShape_Tamil(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *ps
|
|||
return;
|
||||
}
|
||||
|
||||
input = HeapAlloc(GetProcessHeap(), 0, (cChars*2) * sizeof(WCHAR));
|
||||
input = heap_alloc(2 * cChars * sizeof(*input));
|
||||
memcpy(input, pwcChars, cChars * sizeof(WCHAR));
|
||||
|
||||
/* Step 1: Decompose Vowels and Compose Consonants */
|
||||
|
@ -2632,8 +2624,8 @@ static void ContextualShape_Tamil(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *ps
|
|||
/* Step 3: Base Form application to syllables */
|
||||
ShapeIndicSyllables(hdc, psc, psa, input, cChars, syllables, syllable_count, pwOutGlyphs, pcGlyphs, pwLogClust, tamil_lex, SecondReorder_Like_Tamil, modern);
|
||||
|
||||
HeapFree(GetProcessHeap(),0,input);
|
||||
HeapFree(GetProcessHeap(),0,syllables);
|
||||
heap_free(input);
|
||||
heap_free(syllables);
|
||||
}
|
||||
|
||||
static int telugu_lex(WCHAR c)
|
||||
|
@ -2665,7 +2657,7 @@ static void ContextualShape_Telugu(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *p
|
|||
return;
|
||||
}
|
||||
|
||||
input = HeapAlloc(GetProcessHeap(), 0, (cChars*2) * sizeof(WCHAR));
|
||||
input = heap_alloc(2 * cChars * sizeof(*input));
|
||||
memcpy(input, pwcChars, cChars * sizeof(WCHAR));
|
||||
|
||||
/* Step 1: Decompose Vowels */
|
||||
|
@ -2681,8 +2673,8 @@ static void ContextualShape_Telugu(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *p
|
|||
/* Step 3: Base Form application to syllables */
|
||||
ShapeIndicSyllables(hdc, psc, psa, input, cChars, syllables, syllable_count, pwOutGlyphs, pcGlyphs, pwLogClust, telugu_lex, SecondReorder_Like_Telugu, modern);
|
||||
|
||||
HeapFree(GetProcessHeap(),0,input);
|
||||
HeapFree(GetProcessHeap(),0,syllables);
|
||||
heap_free(input);
|
||||
heap_free(syllables);
|
||||
}
|
||||
|
||||
static int kannada_lex(WCHAR c)
|
||||
|
@ -2717,7 +2709,7 @@ static void ContextualShape_Kannada(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *
|
|||
return;
|
||||
}
|
||||
|
||||
input = HeapAlloc(GetProcessHeap(), 0, (cChars*3) * sizeof(WCHAR));
|
||||
input = heap_alloc(3 * cChars * sizeof(*input));
|
||||
memcpy(input, pwcChars, cChars * sizeof(WCHAR));
|
||||
|
||||
/* Step 1: Decompose Vowels */
|
||||
|
@ -2733,8 +2725,8 @@ static void ContextualShape_Kannada(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *
|
|||
/* Step 3: Base Form application to syllables */
|
||||
ShapeIndicSyllables(hdc, psc, psa, input, cChars, syllables, syllable_count, pwOutGlyphs, pcGlyphs, pwLogClust, kannada_lex, SecondReorder_Like_Telugu, modern);
|
||||
|
||||
HeapFree(GetProcessHeap(),0,input);
|
||||
HeapFree(GetProcessHeap(),0,syllables);
|
||||
heap_free(input);
|
||||
heap_free(syllables);
|
||||
}
|
||||
|
||||
static int malayalam_lex(WCHAR c)
|
||||
|
@ -2762,7 +2754,7 @@ static void ContextualShape_Malayalam(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS
|
|||
return;
|
||||
}
|
||||
|
||||
input = HeapAlloc(GetProcessHeap(), 0, (cChars*2) * sizeof(WCHAR));
|
||||
input = heap_alloc(2 * cChars * sizeof(*input));
|
||||
memcpy(input, pwcChars, cChars * sizeof(WCHAR));
|
||||
|
||||
/* Step 1: Decompose Vowels */
|
||||
|
@ -2778,8 +2770,8 @@ static void ContextualShape_Malayalam(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS
|
|||
/* Step 3: Base Form application to syllables */
|
||||
ShapeIndicSyllables(hdc, psc, psa, input, cChars, syllables, syllable_count, pwOutGlyphs, pcGlyphs, pwLogClust, malayalam_lex, SecondReorder_Like_Tamil, modern);
|
||||
|
||||
HeapFree(GetProcessHeap(),0,input);
|
||||
HeapFree(GetProcessHeap(),0,syllables);
|
||||
heap_free(input);
|
||||
heap_free(syllables);
|
||||
}
|
||||
|
||||
static int khmer_lex(WCHAR c)
|
||||
|
@ -2800,7 +2792,7 @@ static void ContextualShape_Khmer(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *ps
|
|||
return;
|
||||
}
|
||||
|
||||
input = HeapAlloc(GetProcessHeap(), 0, cChars * sizeof(WCHAR));
|
||||
input = heap_alloc(cChars * sizeof(*input));
|
||||
memcpy(input, pwcChars, cChars * sizeof(WCHAR));
|
||||
|
||||
/* Step 1: Reorder within Syllables */
|
||||
|
@ -2812,8 +2804,8 @@ static void ContextualShape_Khmer(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *ps
|
|||
/* Step 2: Base Form application to syllables */
|
||||
ShapeIndicSyllables(hdc, psc, psa, input, cChars, syllables, syllable_count, pwOutGlyphs, pcGlyphs, pwLogClust, khmer_lex, NULL, FALSE);
|
||||
|
||||
HeapFree(GetProcessHeap(),0,input);
|
||||
HeapFree(GetProcessHeap(),0,syllables);
|
||||
heap_free(input);
|
||||
heap_free(syllables);
|
||||
}
|
||||
|
||||
static inline BOOL mongolian_wordbreak(WCHAR chr)
|
||||
|
@ -2843,7 +2835,7 @@ static void ContextualShape_Mongolian(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS
|
|||
if (!psc->GSUB_Table)
|
||||
return;
|
||||
|
||||
context_shape = HeapAlloc(GetProcessHeap(),0,sizeof(INT) * cChars);
|
||||
context_shape = heap_alloc(cChars * sizeof(*context_shape));
|
||||
|
||||
for (i = 0; i < cChars; i++)
|
||||
{
|
||||
|
@ -2888,7 +2880,7 @@ static void ContextualShape_Mongolian(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS
|
|||
}
|
||||
}
|
||||
|
||||
HeapFree(GetProcessHeap(),0,context_shape);
|
||||
heap_free(context_shape);
|
||||
}
|
||||
|
||||
static void ShapeCharGlyphProp_Default( 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)
|
||||
|
@ -2957,23 +2949,23 @@ static void ShapeCharGlyphProp_Arabic( HDC hdc, ScriptCache *psc, SCRIPT_ANALYSI
|
|||
INT dirR, dirL;
|
||||
BYTE *spaces;
|
||||
|
||||
spaces = HeapAlloc(GetProcessHeap(),0,cGlyphs);
|
||||
spaces = heap_alloc(cGlyphs);
|
||||
memset(spaces,0,cGlyphs);
|
||||
|
||||
if (!psa->fLogicalOrder && psa->fRTL)
|
||||
{
|
||||
initGlyph = cGlyphs-1;
|
||||
finaGlyph = 0;
|
||||
dirR = 1;
|
||||
dirL = -1;
|
||||
}
|
||||
else
|
||||
if (psa->fLogicalOrder && psa->fRTL)
|
||||
{
|
||||
initGlyph = 0;
|
||||
finaGlyph = cGlyphs-1;
|
||||
dirR = -1;
|
||||
dirL = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
initGlyph = cGlyphs-1;
|
||||
finaGlyph = 0;
|
||||
dirR = 1;
|
||||
dirL = -1;
|
||||
}
|
||||
|
||||
for (i = 0; i < cGlyphs; i++)
|
||||
{
|
||||
|
@ -3057,7 +3049,7 @@ static void ShapeCharGlyphProp_Arabic( HDC hdc, ScriptCache *psc, SCRIPT_ANALYSI
|
|||
|
||||
OpenType_GDEF_UpdateGlyphProps(psc, pwGlyphs, cGlyphs, pwLogClust, cChars, pGlyphProp);
|
||||
UpdateClustersFromGlyphProp(cGlyphs, cChars, pwLogClust, pGlyphProp);
|
||||
HeapFree(GetProcessHeap(),0,spaces);
|
||||
heap_free(spaces);
|
||||
}
|
||||
|
||||
static void ShapeCharGlyphProp_Hebrew( 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 )
|
||||
|
@ -3305,7 +3297,7 @@ static void ShapeCharGlyphProp_BaseIndic( HDC hdc, ScriptCache *psc, SCRIPT_ANAL
|
|||
}
|
||||
}
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, syllables);
|
||||
heap_free(syllables);
|
||||
}
|
||||
|
||||
UpdateClustersFromGlyphProp(cGlyphs, cChars, pwLogClust, pGlyphProp);
|
||||
|
@ -3397,7 +3389,7 @@ static void SHAPE_ApplyOpenTypeFeatures(HDC hdc, ScriptCache *psc, SCRIPT_ANALYS
|
|||
if (!psc->GSUB_Table)
|
||||
return;
|
||||
|
||||
if (!psa->fLogicalOrder && psa->fRTL)
|
||||
if (scriptInformation[psa->eScript].a.fRTL && (!psa->fLogicalOrder || !psa->fRTL))
|
||||
dirL = -1;
|
||||
else
|
||||
dirL = 1;
|
||||
|
|
|
@ -32,16 +32,16 @@
|
|||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(uniscribe);
|
||||
|
||||
typedef struct _scriptRange
|
||||
static const struct usp10_script_range
|
||||
{
|
||||
WORD script;
|
||||
enum usp10_script script;
|
||||
DWORD rangeFirst;
|
||||
DWORD rangeLast;
|
||||
WORD numericScript;
|
||||
WORD punctScript;
|
||||
} scriptRange;
|
||||
|
||||
static const scriptRange scriptRanges[] = {
|
||||
enum usp10_script numericScript;
|
||||
enum usp10_script punctScript;
|
||||
}
|
||||
script_ranges[] =
|
||||
{
|
||||
/* Basic Latin: U+0000–U+007A */
|
||||
{ Script_Latin, 0x00, 0x07a , Script_Numeric, Script_Punctuation},
|
||||
/* Latin-1 Supplement: U+0080–U+00FF */
|
||||
|
@ -285,8 +285,6 @@ static const scriptRange scriptRanges[] = {
|
|||
{ Script_Osmanya, 0x10480, 0x104AF, Script_Osmanya_Numeric, 0},
|
||||
/* Mathematical Alphanumeric Symbols: U+1D400–U+1D7FF */
|
||||
{ Script_MathAlpha, 0x1D400, 0x1D7FF, 0, 0},
|
||||
/* END */
|
||||
{ SCRIPT_UNDEFINED, 0, 0, 0}
|
||||
};
|
||||
|
||||
/* this must be in order so that the index matches the Script value */
|
||||
|
@ -699,19 +697,34 @@ typedef struct {
|
|||
WORD target;
|
||||
} FindGlyph_struct;
|
||||
|
||||
static inline void *heap_alloc(SIZE_T size)
|
||||
BOOL usp10_array_reserve(void **elements, SIZE_T *capacity, SIZE_T count, SIZE_T size)
|
||||
{
|
||||
return HeapAlloc(GetProcessHeap(), 0, size);
|
||||
}
|
||||
SIZE_T max_capacity, new_capacity;
|
||||
void *new_elements;
|
||||
|
||||
static inline void *heap_alloc_zero(SIZE_T size)
|
||||
{
|
||||
return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
|
||||
}
|
||||
if (count <= *capacity)
|
||||
return TRUE;
|
||||
|
||||
static inline BOOL heap_free(LPVOID mem)
|
||||
{
|
||||
return HeapFree(GetProcessHeap(), 0, mem);
|
||||
max_capacity = ~(SIZE_T)0 / size;
|
||||
if (count > max_capacity)
|
||||
return FALSE;
|
||||
|
||||
new_capacity = max(1, *capacity);
|
||||
while (new_capacity < count && new_capacity <= max_capacity / 2)
|
||||
new_capacity *= 2;
|
||||
if (new_capacity < count)
|
||||
new_capacity = count;
|
||||
|
||||
if (!*elements)
|
||||
new_elements = heap_alloc_zero(new_capacity * size);
|
||||
else
|
||||
new_elements = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, *elements, new_capacity * size);
|
||||
if (!new_elements)
|
||||
return FALSE;
|
||||
|
||||
*elements = new_elements;
|
||||
*capacity = new_capacity;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* TODO Fix font properties on Arabic locale */
|
||||
|
@ -866,7 +879,7 @@ static WCHAR mirror_char( WCHAR ch )
|
|||
return ch + wine_mirror_map[wine_mirror_map[ch >> 8] + (ch & 0xff)];
|
||||
}
|
||||
|
||||
static inline DWORD decode_surrogate_pair(LPCWSTR str, INT index, INT end)
|
||||
static DWORD decode_surrogate_pair(const WCHAR *str, unsigned int index, unsigned int end)
|
||||
{
|
||||
if (index < end-1 && IS_SURROGATE_PAIR(str[index],str[index+1]))
|
||||
{
|
||||
|
@ -877,12 +890,25 @@ static inline DWORD decode_surrogate_pair(LPCWSTR str, INT index, INT end)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static WORD get_char_script( LPCWSTR str, INT index, INT end, INT *consumed)
|
||||
static int usp10_compare_script_range(const void *key, const void *value)
|
||||
{
|
||||
const struct usp10_script_range *range = value;
|
||||
const DWORD *ch = key;
|
||||
|
||||
if (*ch < range->rangeFirst)
|
||||
return -1;
|
||||
if (*ch > range->rangeLast)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static enum usp10_script get_char_script(const WCHAR *str, unsigned int index,
|
||||
unsigned int end, unsigned int *consumed)
|
||||
{
|
||||
static const WCHAR latin_punc[] = {'#','$','&','\'',',',';','<','>','?','@','\\','^','_','`','{','|','}','~', 0x00a0, 0};
|
||||
struct usp10_script_range *range;
|
||||
WORD type = 0, type2 = 0;
|
||||
DWORD ch;
|
||||
int i;
|
||||
|
||||
*consumed = 1;
|
||||
|
||||
|
@ -924,24 +950,15 @@ static WORD get_char_script( LPCWSTR str, INT index, INT end, INT *consumed)
|
|||
else
|
||||
ch = str[index];
|
||||
|
||||
i = 0;
|
||||
do
|
||||
{
|
||||
if (ch < scriptRanges[i].rangeFirst || scriptRanges[i].script == SCRIPT_UNDEFINED)
|
||||
break;
|
||||
if (!(range = bsearch(&ch, script_ranges, ARRAY_SIZE(script_ranges),
|
||||
sizeof(*script_ranges), usp10_compare_script_range)))
|
||||
return Script_Undefined;
|
||||
|
||||
if (ch >= scriptRanges[i].rangeFirst && ch <= scriptRanges[i].rangeLast)
|
||||
{
|
||||
if (scriptRanges[i].numericScript && (type & C1_DIGIT || type2 == C2_ARABICNUMBER))
|
||||
return scriptRanges[i].numericScript;
|
||||
if (scriptRanges[i].punctScript && type & C1_PUNCT)
|
||||
return scriptRanges[i].punctScript;
|
||||
return scriptRanges[i].script;
|
||||
}
|
||||
i++;
|
||||
} while (1);
|
||||
|
||||
return SCRIPT_UNDEFINED;
|
||||
if (range->numericScript && (type & C1_DIGIT || type2 == C2_ARABICNUMBER))
|
||||
return range->numericScript;
|
||||
if (range->punctScript && type & C1_PUNCT)
|
||||
return range->punctScript;
|
||||
return range->script;
|
||||
}
|
||||
|
||||
static int compare_FindGlyph(const void *a, const void* b)
|
||||
|
@ -1140,7 +1157,8 @@ HRESULT WINAPI ScriptRecordDigitSubstitution(LCID locale, SCRIPT_DIGITSUBSTITUTE
|
|||
sds->NationalDigitLanguage = LANG_ENGLISH;
|
||||
|
||||
if (!GetLocaleInfoW(locale, LOCALE_IDIGITSUBSTITUTION | LOCALE_RETURN_NUMBER,
|
||||
(LPWSTR)&sub, sizeof(sub)/sizeof(WCHAR))) return E_INVALIDARG;
|
||||
(WCHAR *)&sub, sizeof(sub) / sizeof(WCHAR)))
|
||||
return E_INVALIDARG;
|
||||
|
||||
switch (sub)
|
||||
{
|
||||
|
@ -1209,12 +1227,12 @@ HRESULT WINAPI ScriptApplyDigitSubstitution(const SCRIPT_DIGITSUBSTITUTE *sds,
|
|||
}
|
||||
}
|
||||
|
||||
static inline BOOL is_indic(WORD script)
|
||||
static inline BOOL is_indic(enum usp10_script script)
|
||||
{
|
||||
return (script >= Script_Devanagari && script <= Script_Malayalam_Numeric);
|
||||
}
|
||||
|
||||
static inline WORD base_indic(WORD script)
|
||||
static inline enum usp10_script base_indic(enum usp10_script script)
|
||||
{
|
||||
switch (script)
|
||||
{
|
||||
|
@ -1239,11 +1257,11 @@ static inline WORD base_indic(WORD script)
|
|||
case Script_Malayalam:
|
||||
case Script_Malayalam_Numeric: return Script_Malayalam;
|
||||
default:
|
||||
return -1;
|
||||
return Script_Undefined;
|
||||
};
|
||||
}
|
||||
|
||||
static BOOL script_is_numeric(WORD script)
|
||||
static BOOL script_is_numeric(enum usp10_script script)
|
||||
{
|
||||
return scriptInformation[script].props.fNumeric;
|
||||
}
|
||||
|
@ -1259,21 +1277,21 @@ static HRESULT _ItemizeInternal(const WCHAR *pwcInChars, int cInChars,
|
|||
#define ZWNJ 0x200C
|
||||
#define ZWJ 0x200D
|
||||
|
||||
enum usp10_script last_indic = Script_Undefined;
|
||||
int cnt = 0, index = 0, str = 0;
|
||||
int New_Script = -1;
|
||||
enum usp10_script New_Script = -1;
|
||||
int i;
|
||||
WORD *levels = NULL;
|
||||
WORD *layout_levels = NULL;
|
||||
WORD *overrides = NULL;
|
||||
WORD *strength = NULL;
|
||||
WORD *scripts = NULL;
|
||||
enum usp10_script *scripts;
|
||||
WORD baselevel = 0;
|
||||
WORD baselayout = 0;
|
||||
BOOL new_run;
|
||||
WORD last_indic = -1;
|
||||
WORD layoutRTL = 0;
|
||||
BOOL forceLevels = FALSE;
|
||||
INT consumed = 0;
|
||||
unsigned int consumed = 0;
|
||||
HRESULT res = E_OUTOFMEMORY;
|
||||
|
||||
TRACE("%s,%d,%d,%p,%p,%p,%p\n", debugstr_wn(pwcInChars, cInChars), cInChars, cMaxItems,
|
||||
|
@ -1282,13 +1300,12 @@ static HRESULT _ItemizeInternal(const WCHAR *pwcInChars, int cInChars,
|
|||
if (!pwcInChars || !cInChars || !pItems || cMaxItems < 2)
|
||||
return E_INVALIDARG;
|
||||
|
||||
scripts = heap_alloc(cInChars * sizeof(WORD));
|
||||
if (!scripts)
|
||||
if (!(scripts = heap_alloc(cInChars * sizeof(*scripts))))
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
for (i = 0; i < cInChars; i++)
|
||||
{
|
||||
if (consumed <= 0)
|
||||
if (!consumed)
|
||||
{
|
||||
scripts[i] = get_char_script(pwcInChars,i,cInChars,&consumed);
|
||||
consumed --;
|
||||
|
@ -1300,7 +1317,7 @@ static HRESULT _ItemizeInternal(const WCHAR *pwcInChars, int cInChars,
|
|||
}
|
||||
/* Devanagari danda (U+0964) and double danda (U+0965) are used for
|
||||
all Indic scripts */
|
||||
if ((pwcInChars[i] == 0x964 || pwcInChars[i] ==0x965) && last_indic > 0)
|
||||
if ((pwcInChars[i] == 0x964 || pwcInChars[i] ==0x965) && last_indic != Script_Undefined)
|
||||
scripts[i] = last_indic;
|
||||
else if (is_indic(scripts[i]))
|
||||
last_indic = base_indic(scripts[i]);
|
||||
|
@ -1327,10 +1344,10 @@ static HRESULT _ItemizeInternal(const WCHAR *pwcInChars, int cInChars,
|
|||
{
|
||||
int j;
|
||||
BOOL asian = FALSE;
|
||||
WORD first_script = scripts[i-1];
|
||||
enum usp10_script first_script = scripts[i-1];
|
||||
for (j = i-1; j >= 0 && scripts[j] == first_script && pwcInChars[j] != Numeric_space; j--)
|
||||
{
|
||||
WORD original = scripts[j];
|
||||
enum usp10_script original = scripts[j];
|
||||
if (original == Script_Ideograph || original == Script_Kana || original == Script_Yi || original == Script_CJK_Han || original == Script_Bopomofo)
|
||||
{
|
||||
asian = TRUE;
|
||||
|
@ -1866,7 +1883,7 @@ static BOOL requires_fallback(HDC hdc, SCRIPT_CACHE *psc, SCRIPT_ANALYSIS *psa,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static void find_fallback_font(DWORD scriptid, LPWSTR FaceName)
|
||||
static void find_fallback_font(enum usp10_script scriptid, WCHAR *FaceName)
|
||||
{
|
||||
HKEY hkey;
|
||||
|
||||
|
@ -1878,7 +1895,7 @@ static void find_fallback_font(DWORD scriptid, LPWSTR FaceName)
|
|||
DWORD type;
|
||||
|
||||
sprintfW(value, szFmt, scriptInformation[scriptid].scriptTag);
|
||||
if (RegQueryValueExW(hkey, value, 0, &type, (LPBYTE)FaceName, &count))
|
||||
if (RegQueryValueExW(hkey, value, 0, &type, (BYTE *)FaceName, &count))
|
||||
lstrcpyW(FaceName,scriptInformation[scriptid].fallbackFont);
|
||||
RegCloseKey(hkey);
|
||||
}
|
||||
|
@ -1966,7 +1983,9 @@ HRESULT WINAPI ScriptStringAnalyse(HDC hdc, const void *pString, int cString,
|
|||
if ((analysis->logattrs = heap_alloc(sizeof(SCRIPT_LOGATTR) * cString)))
|
||||
{
|
||||
for (i = 0; i < analysis->numItems; i++)
|
||||
ScriptBreak(&((LPWSTR)pString)[analysis->pItem[i].iCharPos], analysis->pItem[i+1].iCharPos - analysis->pItem[i].iCharPos, &analysis->pItem[i].a, &analysis->logattrs[analysis->pItem[i].iCharPos]);
|
||||
ScriptBreak(&((WCHAR *)pString)[analysis->pItem[i].iCharPos],
|
||||
analysis->pItem[i + 1].iCharPos - analysis->pItem[i].iCharPos,
|
||||
&analysis->pItem[i].a, &analysis->logattrs[analysis->pItem[i].iCharPos]);
|
||||
}
|
||||
else
|
||||
goto error;
|
||||
|
@ -2984,14 +3003,16 @@ HRESULT WINAPI ScriptBreak(const WCHAR *chars, int count, const SCRIPT_ANALYSIS
|
|||
*/
|
||||
HRESULT WINAPI ScriptIsComplex(const WCHAR *chars, int len, DWORD flag)
|
||||
{
|
||||
int i;
|
||||
INT consumed = 0;
|
||||
enum usp10_script script;
|
||||
unsigned int i, consumed;
|
||||
|
||||
TRACE("(%s,%d,0x%x)\n", debugstr_wn(chars, len), len, flag);
|
||||
|
||||
if (!chars || len < 0)
|
||||
return E_INVALIDARG;
|
||||
|
||||
for (i = 0; i < len; i+=consumed)
|
||||
{
|
||||
int script;
|
||||
if (i >= len)
|
||||
break;
|
||||
|
||||
|
@ -3336,15 +3357,24 @@ HRESULT WINAPI ScriptPlaceOpenType( HDC hdc, SCRIPT_CACHE *psc, SCRIPT_ANALYSIS
|
|||
}
|
||||
else if (!get_cache_glyph_widths(psc, pwGlyphs[i], &abc))
|
||||
{
|
||||
BOOL ret;
|
||||
if (!hdc) return E_PENDING;
|
||||
if ((get_cache_pitch_family(psc) & TMPF_TRUETYPE) && !psa->fNoGlyphIndex)
|
||||
if (get_cache_pitch_family(psc) & TMPF_TRUETYPE)
|
||||
{
|
||||
if (!GetCharABCWidthsI(hdc, 0, 1, (WORD *)&pwGlyphs[i], &abc)) return S_FALSE;
|
||||
if (psa->fNoGlyphIndex)
|
||||
ret = GetCharABCWidthsW(hdc, pwGlyphs[i], pwGlyphs[i], &abc);
|
||||
else
|
||||
ret = GetCharABCWidthsI(hdc, 0, 1, (WORD *)&pwGlyphs[i], &abc);
|
||||
if (!ret) return S_FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
INT width;
|
||||
if (!GetCharWidth32W(hdc, pwGlyphs[i], pwGlyphs[i], &width)) return S_FALSE;
|
||||
if (psa->fNoGlyphIndex)
|
||||
ret = GetCharWidth32W(hdc, pwGlyphs[i], pwGlyphs[i], &width);
|
||||
else
|
||||
ret = GetCharWidthI(hdc, 0, 1, (WORD *)&pwGlyphs[i], &width);
|
||||
if (!ret) return S_FALSE;
|
||||
abc.abcB = width;
|
||||
abc.abcA = abc.abcC = 0;
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
@ stdcall ScriptGetFontScriptTags(long ptr ptr long ptr ptr)
|
||||
@ stdcall ScriptGetGlyphABCWidth(ptr ptr long ptr)
|
||||
@ stdcall ScriptGetLogicalWidths(ptr long long ptr ptr ptr ptr)
|
||||
@ stdcall ScriptGetProperties(ptr long)
|
||||
@ stdcall ScriptGetProperties(ptr ptr)
|
||||
@ stdcall ScriptIsComplex(wstr long long)
|
||||
@ stdcall ScriptItemize(wstr long long ptr ptr ptr ptr)
|
||||
@ stdcall ScriptItemizeOpenType(wstr long long ptr ptr ptr ptr ptr)
|
||||
|
|
|
@ -44,101 +44,108 @@
|
|||
( (ULONG)_x2 << 8 ) | \
|
||||
(ULONG)_x1 )
|
||||
|
||||
#ifndef ARRAY_SIZE
|
||||
#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
|
||||
#endif
|
||||
|
||||
#define Script_Latin 1
|
||||
#define Script_CR 2
|
||||
#define Script_Numeric 3
|
||||
#define Script_Control 4
|
||||
#define Script_Punctuation 5
|
||||
#define Script_Arabic 6
|
||||
#define Script_Arabic_Numeric 7
|
||||
#define Script_Hebrew 8
|
||||
#define Script_Syriac 9
|
||||
#define Script_Persian 10
|
||||
#define Script_Thaana 11
|
||||
#define Script_Greek 12
|
||||
#define Script_Cyrillic 13
|
||||
#define Script_Armenian 14
|
||||
#define Script_Georgian 15
|
||||
/* Unicode Chapter 10 */
|
||||
#define Script_Sinhala 16
|
||||
#define Script_Tibetan 17
|
||||
#define Script_Tibetan_Numeric 18
|
||||
#define Script_Phags_pa 19
|
||||
/* Unicode Chapter 11 */
|
||||
#define Script_Thai 20
|
||||
#define Script_Thai_Numeric 21
|
||||
#define Script_Lao 22
|
||||
#define Script_Lao_Numeric 23
|
||||
/* Unicode Chapter 9 */
|
||||
#define Script_Devanagari 24
|
||||
#define Script_Devanagari_Numeric 25
|
||||
#define Script_Bengali 26
|
||||
#define Script_Bengali_Numeric 27
|
||||
#define Script_Bengali_Currency 28
|
||||
#define Script_Gurmukhi 29
|
||||
#define Script_Gurmukhi_Numeric 30
|
||||
#define Script_Gujarati 31
|
||||
#define Script_Gujarati_Numeric 32
|
||||
#define Script_Gujarati_Currency 33
|
||||
#define Script_Oriya 34
|
||||
#define Script_Oriya_Numeric 35
|
||||
#define Script_Tamil 36
|
||||
#define Script_Tamil_Numeric 37
|
||||
#define Script_Telugu 38
|
||||
#define Script_Telugu_Numeric 39
|
||||
#define Script_Kannada 40
|
||||
#define Script_Kannada_Numeric 41
|
||||
#define Script_Malayalam 42
|
||||
#define Script_Malayalam_Numeric 43
|
||||
/* More supplemental */
|
||||
#define Script_Diacritical 44
|
||||
#define Script_Punctuation2 45
|
||||
#define Script_Numeric2 46
|
||||
/* Unicode Chapter 11 continued */
|
||||
#define Script_Myanmar 47
|
||||
#define Script_Myanmar_Numeric 48
|
||||
#define Script_Tai_Le 49
|
||||
#define Script_New_Tai_Lue 50
|
||||
#define Script_New_Tai_Lue_Numeric 51
|
||||
#define Script_Khmer 52
|
||||
#define Script_Khmer_Numeric 53
|
||||
/* Unicode Chapter 12 */
|
||||
#define Script_CJK_Han 54
|
||||
#define Script_Ideograph 55
|
||||
#define Script_Bopomofo 56
|
||||
#define Script_Kana 57
|
||||
#define Script_Hangul 58
|
||||
#define Script_Yi 59
|
||||
/* Unicode Chapter 13 */
|
||||
#define Script_Ethiopic 60
|
||||
#define Script_Ethiopic_Numeric 61
|
||||
#define Script_Mongolian 62
|
||||
#define Script_Mongolian_Numeric 63
|
||||
#define Script_Tifinagh 64
|
||||
#define Script_NKo 65
|
||||
#define Script_Vai 66
|
||||
#define Script_Vai_Numeric 67
|
||||
#define Script_Cherokee 68
|
||||
#define Script_Canadian 69
|
||||
/* Unicode Chapter 14 */
|
||||
#define Script_Ogham 70
|
||||
#define Script_Runic 71
|
||||
/* Unicode Chapter 15 */
|
||||
#define Script_Braille 72
|
||||
/* Unicode Chapter 16 */
|
||||
#define Script_Surrogates 73
|
||||
#define Script_Private 74
|
||||
/* Unicode Chapter 13 : Plane 1 */
|
||||
#define Script_Deseret 75
|
||||
#define Script_Osmanya 76
|
||||
#define Script_Osmanya_Numeric 77
|
||||
/* Unicode Chapter 15 : Plane 1 */
|
||||
#define Script_MathAlpha 78
|
||||
/* Additional Currency Scripts */
|
||||
#define Script_Hebrew_Currency 79
|
||||
#define Script_Vietnamese_Currency 80
|
||||
#define Script_Thai_Currency 81
|
||||
enum usp10_script
|
||||
{
|
||||
Script_Undefined = 0x00,
|
||||
Script_Latin = 0x01,
|
||||
Script_CR = 0x02,
|
||||
Script_Numeric = 0x03,
|
||||
Script_Control = 0x04,
|
||||
Script_Punctuation = 0x05,
|
||||
Script_Arabic = 0x06,
|
||||
Script_Arabic_Numeric = 0x07,
|
||||
Script_Hebrew = 0x08,
|
||||
Script_Syriac = 0x09,
|
||||
Script_Persian = 0x0a,
|
||||
Script_Thaana = 0x0b,
|
||||
Script_Greek = 0x0c,
|
||||
Script_Cyrillic = 0x0d,
|
||||
Script_Armenian = 0x0e,
|
||||
Script_Georgian = 0x0f,
|
||||
/* Unicode Chapter 10 */
|
||||
Script_Sinhala = 0x10,
|
||||
Script_Tibetan = 0x11,
|
||||
Script_Tibetan_Numeric = 0x12,
|
||||
Script_Phags_pa = 0x13,
|
||||
/* Unicode Chapter 11 */
|
||||
Script_Thai = 0x14,
|
||||
Script_Thai_Numeric = 0x15,
|
||||
Script_Lao = 0x16,
|
||||
Script_Lao_Numeric = 0x17,
|
||||
/* Unicode Chapter 9 */
|
||||
Script_Devanagari = 0x18,
|
||||
Script_Devanagari_Numeric = 0x19,
|
||||
Script_Bengali = 0x1a,
|
||||
Script_Bengali_Numeric = 0x1b,
|
||||
Script_Bengali_Currency = 0x1c,
|
||||
Script_Gurmukhi = 0x1d,
|
||||
Script_Gurmukhi_Numeric = 0x1e,
|
||||
Script_Gujarati = 0x1f,
|
||||
Script_Gujarati_Numeric = 0x20,
|
||||
Script_Gujarati_Currency = 0x21,
|
||||
Script_Oriya = 0x22,
|
||||
Script_Oriya_Numeric = 0x23,
|
||||
Script_Tamil = 0x24,
|
||||
Script_Tamil_Numeric = 0x25,
|
||||
Script_Telugu = 0x26,
|
||||
Script_Telugu_Numeric = 0x27,
|
||||
Script_Kannada = 0x28,
|
||||
Script_Kannada_Numeric = 0x29,
|
||||
Script_Malayalam = 0x2a,
|
||||
Script_Malayalam_Numeric = 0x2b,
|
||||
/* More supplemental */
|
||||
Script_Diacritical = 0x2c,
|
||||
Script_Punctuation2 = 0x2d,
|
||||
Script_Numeric2 = 0x2e,
|
||||
/* Unicode Chapter 11 continued */
|
||||
Script_Myanmar = 0x2f,
|
||||
Script_Myanmar_Numeric = 0x30,
|
||||
Script_Tai_Le = 0x31,
|
||||
Script_New_Tai_Lue = 0x32,
|
||||
Script_New_Tai_Lue_Numeric = 0x33,
|
||||
Script_Khmer = 0x34,
|
||||
Script_Khmer_Numeric = 0x35,
|
||||
/* Unicode Chapter 12 */
|
||||
Script_CJK_Han = 0x36,
|
||||
Script_Ideograph = 0x37,
|
||||
Script_Bopomofo = 0x38,
|
||||
Script_Kana = 0x39,
|
||||
Script_Hangul = 0x3a,
|
||||
Script_Yi = 0x3b,
|
||||
/* Unicode Chapter 13 */
|
||||
Script_Ethiopic = 0x3c,
|
||||
Script_Ethiopic_Numeric = 0x3d,
|
||||
Script_Mongolian = 0x3e,
|
||||
Script_Mongolian_Numeric = 0x3f,
|
||||
Script_Tifinagh = 0x40,
|
||||
Script_NKo = 0x41,
|
||||
Script_Vai = 0x42,
|
||||
Script_Vai_Numeric = 0x43,
|
||||
Script_Cherokee = 0x44,
|
||||
Script_Canadian = 0x45,
|
||||
/* Unicode Chapter 14 */
|
||||
Script_Ogham = 0x46,
|
||||
Script_Runic = 0x47,
|
||||
/* Unicode Chapter 15 */
|
||||
Script_Braille = 0x48,
|
||||
/* Unicode Chapter 16 */
|
||||
Script_Surrogates = 0x49,
|
||||
Script_Private = 0x4a,
|
||||
/* Unicode Chapter 13 : Plane 1 */
|
||||
Script_Deseret = 0x4b,
|
||||
Script_Osmanya = 0x4c,
|
||||
Script_Osmanya_Numeric = 0x4d,
|
||||
/* Unicode Chapter 15 : Plane 1 */
|
||||
Script_MathAlpha = 0x4e,
|
||||
/* Additional Currency Scripts */
|
||||
Script_Hebrew_Currency = 0x4f,
|
||||
Script_Vietnamese_Currency = 0x50,
|
||||
Script_Thai_Currency = 0x51,
|
||||
};
|
||||
|
||||
#define GLYPH_BLOCK_SHIFT 8
|
||||
#define GLYPH_BLOCK_SIZE (1UL << GLYPH_BLOCK_SHIFT)
|
||||
|
@ -157,15 +164,15 @@
|
|||
typedef struct {
|
||||
OPENTYPE_TAG tag;
|
||||
CHAR tableType;
|
||||
LPCVOID feature;
|
||||
const void *feature;
|
||||
INT lookup_count;
|
||||
WORD *lookups;
|
||||
} LoadedFeature;
|
||||
|
||||
typedef struct {
|
||||
OPENTYPE_TAG tag;
|
||||
LPCVOID gsub_table;
|
||||
LPCVOID gpos_table;
|
||||
const void *gsub_table;
|
||||
const void *gpos_table;
|
||||
BOOL features_initialized;
|
||||
INT feature_count;
|
||||
LoadedFeature *features;
|
||||
|
@ -173,12 +180,13 @@ typedef struct {
|
|||
|
||||
typedef struct {
|
||||
OPENTYPE_TAG tag;
|
||||
LPCVOID gsub_table;
|
||||
LPCVOID gpos_table;
|
||||
const void *gsub_table;
|
||||
const void *gpos_table;
|
||||
LoadedLanguage default_language;
|
||||
BOOL languages_initialized;
|
||||
INT language_count;
|
||||
LoadedLanguage *languages;
|
||||
SIZE_T languages_size;
|
||||
SIZE_T language_count;
|
||||
} LoadedScript;
|
||||
|
||||
typedef struct {
|
||||
|
@ -193,14 +201,15 @@ typedef struct {
|
|||
BOOL sfnt;
|
||||
CacheGlyphPage *page[NUM_PAGES];
|
||||
ABC *widths[GLYPH_MAX / GLYPH_BLOCK_SIZE];
|
||||
LPVOID GSUB_Table;
|
||||
LPVOID GDEF_Table;
|
||||
LPVOID CMAP_Table;
|
||||
LPVOID CMAP_format12_Table;
|
||||
LPVOID GPOS_Table;
|
||||
void *GSUB_Table;
|
||||
void *GDEF_Table;
|
||||
void *CMAP_Table;
|
||||
void *CMAP_format12_Table;
|
||||
void *GPOS_Table;
|
||||
BOOL scripts_initialized;
|
||||
INT script_count;
|
||||
LoadedScript *scripts;
|
||||
SIZE_T scripts_size;
|
||||
SIZE_T script_count;
|
||||
|
||||
OPENTYPE_TAG userScript;
|
||||
OPENTYPE_TAG userLang;
|
||||
|
@ -225,6 +234,21 @@ typedef struct {
|
|||
|
||||
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};
|
||||
|
||||
static inline void * __WINE_ALLOC_SIZE(1) heap_alloc(size_t size)
|
||||
{
|
||||
return HeapAlloc(GetProcessHeap(), 0, size);
|
||||
}
|
||||
|
||||
static inline void * __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t size)
|
||||
{
|
||||
return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
|
||||
}
|
||||
|
||||
static inline BOOL heap_free(void *mem)
|
||||
{
|
||||
return HeapFree(GetProcessHeap(), 0, mem);
|
||||
}
|
||||
|
||||
static inline BOOL is_consonant( int type )
|
||||
{
|
||||
return (type == lex_Ra || type == lex_Consonant);
|
||||
|
@ -236,19 +260,20 @@ static inline unsigned short get_table_entry( const unsigned short *table, WCHAR
|
|||
}
|
||||
|
||||
typedef int (*lexical_function)(WCHAR c);
|
||||
typedef void (*reorder_function)(LPWSTR pwChar, IndicSyllable *syllable, lexical_function lex);
|
||||
typedef void (*reorder_function)(WCHAR *chars, IndicSyllable *syllable, lexical_function lex);
|
||||
|
||||
#define odd(x) ((x) & 1)
|
||||
#define BIDI_STRONG 1
|
||||
#define BIDI_WEAK 2
|
||||
#define BIDI_NEUTRAL 0
|
||||
|
||||
BOOL usp10_array_reserve(void **elements, SIZE_T *capacity, SIZE_T count, SIZE_T size) DECLSPEC_HIDDEN;
|
||||
int USP10_FindGlyphInLogClust(const WORD* pwLogClust, int cChars, WORD target) DECLSPEC_HIDDEN;
|
||||
|
||||
BOOL BIDI_DetermineLevels( LPCWSTR lpString, INT uCount, const SCRIPT_STATE *s,
|
||||
const SCRIPT_CONTROL *c, WORD *lpOutLevels, WORD *lpOutOverrides ) DECLSPEC_HIDDEN;
|
||||
BOOL BIDI_GetStrengths(LPCWSTR lpString, INT uCount, const SCRIPT_CONTROL *c,
|
||||
WORD* lpStrength) DECLSPEC_HIDDEN;
|
||||
BOOL BIDI_DetermineLevels(const WCHAR *string, unsigned int count, const SCRIPT_STATE *s,
|
||||
const SCRIPT_CONTROL *c, WORD *levels, WORD *overrides) DECLSPEC_HIDDEN;
|
||||
BOOL BIDI_GetStrengths(const WCHAR *string, unsigned int count,
|
||||
const SCRIPT_CONTROL *c, WORD *strength) DECLSPEC_HIDDEN;
|
||||
INT BIDI_ReorderV2lLevel(int level, int *pIndexs, const BYTE* plevel, int cch, BOOL fReverse) DECLSPEC_HIDDEN;
|
||||
INT BIDI_ReorderL2vLevel(int level, int *pIndexs, const BYTE* plevel, int cch, BOOL fReverse) DECLSPEC_HIDDEN;
|
||||
void SHAPE_ContextualShaping(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR* pwcChars, INT cChars, WORD* pwOutGlyphs, INT* pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust) DECLSPEC_HIDDEN;
|
||||
|
@ -261,15 +286,21 @@ HRESULT SHAPE_GetFontScriptTags( HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa
|
|||
HRESULT SHAPE_GetFontLanguageTags( HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, OPENTYPE_TAG tagScript, int cMaxTags, OPENTYPE_TAG *pLangSysTags, int *pcTags) DECLSPEC_HIDDEN;
|
||||
HRESULT SHAPE_GetFontFeatureTags( HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, OPENTYPE_TAG tagScript, OPENTYPE_TAG tagLangSys, int cMaxTags, OPENTYPE_TAG *pFeatureTags, int *pcTags) DECLSPEC_HIDDEN;
|
||||
|
||||
void Indic_ReorderCharacters( HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPWSTR input, int cChars, IndicSyllable **syllables, int *syllable_count, lexical_function lexical_f, reorder_function reorder_f, BOOL modern) DECLSPEC_HIDDEN;
|
||||
void Indic_ParseSyllables( HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPCWSTR input, const int cChar, IndicSyllable **syllables, int *syllable_count, lexical_function lex, BOOL modern) DECLSPEC_HIDDEN;
|
||||
void Indic_ReorderCharacters(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, WCHAR *input, unsigned int cChars,
|
||||
IndicSyllable **syllables, int *syllable_count, lexical_function lexical_f,
|
||||
reorder_function reorder_f, BOOL modern) DECLSPEC_HIDDEN;
|
||||
void Indic_ParseSyllables(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, const WCHAR *input, unsigned int cChar,
|
||||
IndicSyllable **syllables, int *syllable_count, lexical_function lex, BOOL modern) DECLSPEC_HIDDEN;
|
||||
|
||||
void BREAK_line(const WCHAR *chars, int count, const SCRIPT_ANALYSIS *sa, SCRIPT_LOGATTR *la) DECLSPEC_HIDDEN;
|
||||
|
||||
DWORD OpenType_CMAP_GetGlyphIndex(HDC hdc, ScriptCache *psc, DWORD utf32c, LPWORD pgi, DWORD flags) DECLSPEC_HIDDEN;
|
||||
void OpenType_GDEF_UpdateGlyphProps(ScriptCache *psc, const WORD *pwGlyphs, const WORD cGlyphs, WORD* pwLogClust, const WORD cChars, SCRIPT_GLYPHPROP *pGlyphProp) DECLSPEC_HIDDEN;
|
||||
INT OpenType_apply_GSUB_lookup(LPCVOID table, INT lookup_index, WORD *glyphs, INT glyph_index, INT write_dir, INT *glyph_count) DECLSPEC_HIDDEN;
|
||||
INT OpenType_apply_GPOS_lookup(ScriptCache *psc, LPOUTLINETEXTMETRICW lpotm, LPLOGFONTW lplogfont, const SCRIPT_ANALYSIS *analysis, INT* piAdvance, INT lookup_index, const WORD *glyphs, INT glyph_index, INT glyph_count, GOFFSET *pGoffset) DECLSPEC_HIDDEN;
|
||||
int OpenType_apply_GSUB_lookup(const void *table, unsigned int lookup_index, WORD *glyphs,
|
||||
unsigned int glyph_index, int write_dir, int *glyph_count) DECLSPEC_HIDDEN;
|
||||
unsigned int OpenType_apply_GPOS_lookup(const ScriptCache *psc, const OUTLINETEXTMETRICW *otm,
|
||||
const LOGFONTW *logfont, const SCRIPT_ANALYSIS *analysis, int *advance, unsigned int lookup_index,
|
||||
const WORD *glyphs, unsigned int glyph_index, unsigned int glyph_count, GOFFSET *goffset) DECLSPEC_HIDDEN;
|
||||
HRESULT OpenType_GetFontScriptTags(ScriptCache *psc, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pScriptTags, int *pcTags) DECLSPEC_HIDDEN;
|
||||
HRESULT OpenType_GetFontLanguageTags(ScriptCache *psc, OPENTYPE_TAG script_tag, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pLanguageTags, int *pcTags) DECLSPEC_HIDDEN;
|
||||
HRESULT OpenType_GetFontFeatureTags(ScriptCache *psc, OPENTYPE_TAG script_tag, OPENTYPE_TAG language_tag, BOOL filtered, OPENTYPE_TAG searchingFor, char tableType, int cMaxTags, OPENTYPE_TAG *pFeatureTags, int *pcTags, LoadedFeature** feature) DECLSPEC_HIDDEN;
|
||||
|
|
|
@ -189,7 +189,7 @@ reactos/dll/win32/twain_32 # Synced to WineStaging-1.9.11
|
|||
reactos/dll/win32/updspapi # Synced to WineStaging-1.9.11
|
||||
reactos/dll/win32/url # Synced to WineStaging-1.9.11
|
||||
reactos/dll/win32/urlmon # Synced to WineStaging-2.9
|
||||
reactos/dll/win32/usp10 # Synced to WineStaging-2.2
|
||||
reactos/dll/win32/usp10 # Synced to WineStaging-2.9
|
||||
reactos/dll/win32/uxtheme # Forked
|
||||
reactos/dll/win32/vbscript # Synced to WineStaging-1.9.23
|
||||
reactos/dll/win32/version # Synced to WineStaging-2.2
|
||||
|
|
Loading…
Reference in a new issue