39#define FIRST_ARABIC_CHAR 0x0600
40#define LAST_ARABIC_CHAR 0x06ff
484 {{
devanagari_features, 6}, {
devanagari_gpos_features, 4},
required_devanagari_features,
MS_MAKE_TAG(
'd',
'e',
'v',
'2'),
ContextualShape_Devanagari,
ShapeCharGlyphProp_Devanagari},
485 {{
devanagari_features, 6}, {
devanagari_gpos_features, 4},
required_devanagari_features,
MS_MAKE_TAG(
'd',
'e',
'v',
'2'),
ContextualShape_Devanagari,
NULL},
486 {{
devanagari_features, 6}, {
devanagari_gpos_features, 4},
required_bengali_features,
MS_MAKE_TAG(
'b',
'n',
'g',
'2'),
ContextualShape_Bengali,
ShapeCharGlyphProp_Bengali},
487 {{
devanagari_features, 6}, {
devanagari_gpos_features, 4},
required_bengali_features,
MS_MAKE_TAG(
'b',
'n',
'g',
'2'),
ContextualShape_Bengali,
NULL},
488 {{
devanagari_features, 6}, {
devanagari_gpos_features, 4},
required_bengali_features,
MS_MAKE_TAG(
'b',
'n',
'g',
'2'),
ContextualShape_Bengali,
ShapeCharGlyphProp_Bengali},
489 {{
devanagari_features, 6}, {
devanagari_gpos_features, 4},
required_gurmukhi_features,
MS_MAKE_TAG(
'g',
'u',
'r',
'2'),
ContextualShape_Gurmukhi,
ShapeCharGlyphProp_Gurmukhi},
490 {{
devanagari_features, 6}, {
devanagari_gpos_features, 4},
required_gurmukhi_features,
MS_MAKE_TAG(
'g',
'u',
'r',
'2'),
ContextualShape_Gurmukhi,
NULL},
491 {{
devanagari_features, 6}, {
devanagari_gpos_features, 4},
required_devanagari_features,
MS_MAKE_TAG(
'g',
'j',
'r',
'2'),
ContextualShape_Gujarati,
ShapeCharGlyphProp_Gujarati},
492 {{
devanagari_features, 6}, {
devanagari_gpos_features, 4},
required_devanagari_features,
MS_MAKE_TAG(
'g',
'j',
'r',
'2'),
ContextualShape_Gujarati,
NULL},
493 {{
devanagari_features, 6}, {
devanagari_gpos_features, 4},
required_devanagari_features,
MS_MAKE_TAG(
'g',
'j',
'r',
'2'),
ContextualShape_Gujarati,
ShapeCharGlyphProp_Gujarati},
494 {{
devanagari_features, 6}, {
devanagari_gpos_features, 4},
required_oriya_features,
MS_MAKE_TAG(
'o',
'r',
'y',
'2'),
ContextualShape_Oriya,
ShapeCharGlyphProp_Oriya},
495 {{
devanagari_features, 6}, {
devanagari_gpos_features, 4},
required_oriya_features,
MS_MAKE_TAG(
'o',
'r',
'y',
'2'),
ContextualShape_Oriya,
NULL},
496 {{
devanagari_features, 6}, {
devanagari_gpos_features, 4},
required_tamil_features,
MS_MAKE_TAG(
't',
'a',
'm',
'2'),
ContextualShape_Tamil,
ShapeCharGlyphProp_Tamil},
497 {{
devanagari_features, 6}, {
devanagari_gpos_features, 4},
required_tamil_features,
MS_MAKE_TAG(
't',
'a',
'm',
'2'),
ContextualShape_Tamil,
NULL},
498 {{
devanagari_features, 6}, {
devanagari_gpos_features, 4},
required_telugu_features,
MS_MAKE_TAG(
't',
'e',
'l',
'2'),
ContextualShape_Telugu,
ShapeCharGlyphProp_Telugu},
499 {{
devanagari_features, 6}, {
devanagari_gpos_features, 4},
required_telugu_features,
MS_MAKE_TAG(
't',
'e',
'l',
'2'),
ContextualShape_Telugu,
NULL},
500 {{
devanagari_features, 6}, {
devanagari_gpos_features, 4},
required_telugu_features,
MS_MAKE_TAG(
'k',
'n',
'd',
'2'),
ContextualShape_Kannada,
ShapeCharGlyphProp_Kannada},
501 {{
devanagari_features, 6}, {
devanagari_gpos_features, 4},
required_telugu_features,
MS_MAKE_TAG(
'k',
'n',
'd',
'2'),
ContextualShape_Kannada,
NULL},
502 {{
devanagari_features, 6}, {
devanagari_gpos_features, 4},
required_telugu_features,
MS_MAKE_TAG(
'm',
'l',
'm',
'2'),
ContextualShape_Malayalam,
ShapeCharGlyphProp_Malayalam},
503 {{
devanagari_features, 6}, {
devanagari_gpos_features, 4},
required_telugu_features,
MS_MAKE_TAG(
'm',
'l',
'm',
'2'),
ContextualShape_Malayalam,
NULL},
547 WORD *
glyphs,
unsigned int glyph_index,
int write_dir,
int *glyph_count)
560 TRACE(
"lookups found no glyphs\n");
620 if (
psc->GSUB_Table ||
psc->GPOS_Table)
631 if (
psc->userLang != 0)
632 language =
psc->userLang;
637 OpenType_GetFontFeatureTags(
psc,
script, language,
FALSE,
MS_MAKE_TAG(feat[0],feat[1],feat[2],feat[3]), tableType, 1, &
tags, &cTags, &
feature);
646 OpenType_GetFontFeatureTags(
psc,
script,
MS_MAKE_TAG(
'd',
'f',
'l',
't'),
FALSE,
MS_MAKE_TAG(feat[0],feat[1],feat[2],feat[3]), tableType, 1, &
tags, &cTags, &
feature);
662 TRACE(
"applying feature %s\n",feat);
707 if (!
psc->GSUB_Table)
709 if (!
psc->GPOS_Table)
711 if (!
psc->GDEF_Table)
726 rc =
count - glyph_count;
740 if (!pGlyphProp[
i].sva.fClusterStart)
760 if (changeCount == 0)
766 int target_glyph = nextIndex - write_dir;
767 int target_index = -1;
768 int replacing_glyph = -1;
774 target_glyph = nextIndex - changeCount;
776 target_glyph = nextIndex + (changeCount + 1);
780 if (target_index == -1)
782 ERR(
"Unable to find target glyph\n");
789 for (
i = target_index; i < chars && i >= 0;
i += cluster_dir)
798 if (changed >= changeCount)
809 for (
i = target_index; i < chars && i >= 0;
i += cluster_dir)
817 for (
i = target_index; i < chars && i >= 0;
i += cluster_dir)
835 for (lookup_index = 0; lookup_index <
feature->lookup_count; lookup_index++)
843 TRACE(
"applying lookup (%i/%i)\n",lookup_index,
feature->lookup_count);
844 while(i < *pcGlyphs && i >= 0)
869 unsigned int start_idx,
i,
j;
873 start_idx =
dir < 0 ? glyph_count - 1 : 0;
876 for (
j = 0;
j < glyph_count; )
897 pwGlyphs[
i+1] = pwGlyphs[
i];
898 pwGlyphs[
index] = glyph;
922 if (context_type[
i] != 0 && context_type[
i+write_dir]==context_type[
i])
956 if (
i+ delta >= cchLen)
968 if (
psa->fLinkBefore)
973 if (
i+ delta >= cchLen)
983 if (context_type[
i] ==
jtT)
986 return context_type[
i];
991 return (joining_type ==
jtL || joining_type ==
jtD || joining_type ==
jtC);
996 return (joining_type ==
jtR || joining_type ==
jtD || joining_type ==
jtC);
1004 return (chr == 0 || chr == 0x20 );
1009 enum {Arab_Norm = 0, Arab_DIAC1, Arab_DIAC2, Arab_DIAC3, Arab_DIAC4, Arab_DIAC5, Arab_DIAC6, Arab_DIAC7, Arab_DIAC8};
1020 case 0x06E1:
return Arab_DIAC1;
1023 case 0x0656:
return Arab_DIAC2;
1024 case 0x0651:
return Arab_DIAC3;
1040 case 0x06EC:
return Arab_DIAC4;
1043 case 0x06ED:
return Arab_DIAC5;
1044 case 0x0670:
return Arab_DIAC6;
1045 case 0x0653:
return Arab_DIAC7;
1047 case 0x0654:
return Arab_DIAC8;
1048 default:
return Arab_Norm;
1066 ERR(
"Number of Glyphs and Chars need to match at the beginning\n");
1070 if (
psa->fLogicalOrder &&
psa->fRTL)
1092 context_shape[
i] =
Xr;
1094 context_shape[
i] =
Xl;
1096 context_shape[
i] =
Xm;
1098 context_shape[
i] =
Xr;
1100 context_shape[
i] =
Xl;
1102 context_shape[
i] =
Xn;
1107 char_index = glyph_index = 0;
1109 char_index = glyph_index =
cChars-1;
1111 while(char_index < cChars && char_index >= 0)
1115 if (
psc->GSUB_Table)
1127 glyph_index -=
offset * dirL;
1138 glyph_index = nextIndex;
1142 glyph_index += dirL * (
offset + 1);
1149 glyph_index += dirL;
1156 if (context_shape[char_index] ==
Xn)
1168 glyph_index += dirL;
1180 enum {Hebr_Norm=0, Hebr_DIAC, Hebr_CANT1, Hebr_CANT2, Hebr_CANT3, Hebr_CANT4, Hebr_CANT5, Hebr_CANT6, Hebr_CANT7, Hebr_CANT8, Hebr_CANT9, Hebr_CANT10, Hebr_DAGESH, Hebr_DOTABV, Hebr_HOLAM, Hebr_METEG, Hebr_PATAH, Hebr_QAMATS, Hebr_RAFE, Hebr_SHINSIN};
1191 case 0x05BB:
return Hebr_DIAC;
1195 case 0x05AE:
return Hebr_CANT1;
1198 case 0x05AC:
return Hebr_CANT2;
1204 case 0x05AB:
return Hebr_CANT3;
1208 case 0x059F:
return Hebr_CANT4;
1210 case 0x05A0:
return Hebr_CANT5;
1212 case 0x05A5:
return Hebr_CANT6;
1215 case 0x05A6:
return Hebr_CANT7;
1218 case 0x05AA:
return Hebr_CANT8;
1220 case 0x05AD:
return Hebr_CANT9;
1221 case 0x05AF:
return Hebr_CANT10;
1222 case 0x05BC:
return Hebr_DAGESH;
1223 case 0x05C4:
return Hebr_DOTABV;
1224 case 0x05B9:
return Hebr_HOLAM;
1225 case 0x05BD:
return Hebr_METEG;
1226 case 0x05B7:
return Hebr_PATAH;
1227 case 0x05B8:
return Hebr_QAMATS;
1228 case 0x05BF:
return Hebr_RAFE;
1230 case 0x05C2:
return Hebr_SHINSIN;
1231 default:
return Hebr_Norm;
1241 ERR(
"Number of Glyphs and Chars need to match at the beginning\n");
1245 if (!
psa->fLogicalOrder &&
psa->fRTL)
1259 enum {Syriac_Norm=0, Syriac_DIAC1, Syriac_DIAC2, Syriac_DIAC3, Syriac_DIAC4, Syriac_DIAC5, Syriac_DIAC6, Syriac_DIAC7, Syriac_DIAC8, Syriac_DIAC9, Syriac_DIAC10, Syriac_DIAC11, Syriac_DIAC12, Syriac_DIAC13, Syriac_DIAC14, Syriac_DIAC15, Syriac_DIAC16, Syriac_DIAC17};
1267 case 0x73D:
return Syriac_DIAC1;
1272 case 0x73E:
return Syriac_DIAC2;
1275 case 0x74A:
return Syriac_DIAC3;
1278 case 0x73F:
return Syriac_DIAC4;
1281 case 0x73C:
return Syriac_DIAC5;
1283 case 0x30A:
return Syriac_DIAC6;
1285 case 0x325:
return Syriac_DIAC7;
1287 case 0x303:
return Syriac_DIAC8;
1292 case 0x331:
return Syriac_DIAC9;
1293 case 0x308:
return Syriac_DIAC10;
1294 case 0x304:
return Syriac_DIAC11;
1295 case 0x307:
return Syriac_DIAC12;
1296 case 0x323:
return Syriac_DIAC13;
1297 case 0x743:
return Syriac_DIAC14;
1298 case 0x744:
return Syriac_DIAC15;
1299 case 0x745:
return Syriac_DIAC16;
1300 case 0x746:
return Syriac_DIAC17;
1301 default:
return Syriac_Norm;
1320 ERR(
"Number of Glyphs and Chars need to match at the beginning\n");
1324 if (!
psa->fLogicalOrder &&
psa->fRTL)
1337 if (!
psc->GSUB_Table)
1353 context_shape[
i] =
Afj;
1354 else if ( rchar !=
DALATH && rchar !=
RISH &&
1357 context_shape[
i] =
Afn;
1359 context_shape[
i] =
Afx;
1361 context_shape[
i] =
Xn;
1363 else if (context_type[
i] ==
jtR &&
1365 context_shape[
i] =
Xr;
1367 context_shape[
i] =
Xl;
1369 context_shape[
i] =
Xm;
1371 context_shape[
i] =
Xr;
1373 context_shape[
i] =
Xl;
1375 context_shape[
i] =
Xn;
1380 char_index = glyph_index = 0;
1382 char_index = glyph_index =
cChars-1;
1384 while(char_index < cChars && char_index >= 0)
1396 glyph_index -=
offset * dirL;
1406 glyph_index = nextIndex;
1410 glyph_index += dirL * (
offset + 1);
1416 glyph_index += dirL;
1428 enum {Thaana_Norm=0, Thaana_FILI};
1441 case 0x7AF:
return Thaana_FILI;
1442 default:
return Thaana_Norm;
1452 ERR(
"Number of Glyphs and Chars need to match at the beginning\n");
1456 if (!
psa->fLogicalOrder &&
psa->fRTL)
1468#define phags_pa_CANDRABINDU 0xA873
1469#define phags_pa_START 0xA840
1470#define phags_pa_END 0xA87F
1482 ERR(
"Number of Glyphs and Chars need to match at the beginning\n");
1486 if (!
psa->fLogicalOrder &&
psa->fRTL)
1499 if (!
psc->GSUB_Table)
1513 if (jrchar && jlchar)
1514 context_shape[
i] =
Xm;
1516 context_shape[
i] =
Xr;
1518 context_shape[
i] =
Xl;
1520 context_shape[
i] =
Xn;
1523 context_shape[
i] = -1;
1528 char_index = glyph_index = 0;
1530 char_index = glyph_index =
cChars-1;
1532 while(char_index < cChars && char_index >= 0)
1534 if (context_shape[char_index] >= 0)
1543 glyph_index = nextIndex;
1549 glyph_index += dirL;
1555 glyph_index += dirL;
1564 enum {Thai_Norm=0, Thai_ABOVE1, Thai_ABOVE2, Thai_ABOVE3, Thai_ABOVE4, Thai_BELOW1, Thai_BELOW2, Thai_AM};
1572 case 0xE37:
return Thai_ABOVE1;
1574 case 0xE4D:
return Thai_ABOVE2;
1578 case 0xE4B:
return Thai_ABOVE3;
1580 case 0xE4E:
return Thai_ABOVE4;
1582 case 0xE39:
return Thai_BELOW1;
1583 case 0xE3A:
return Thai_BELOW2;
1584 case 0xE33:
return Thai_AM;
1585 default:
return Thai_Norm;
1595 ERR(
"Number of Glyphs and Chars need to match at the beginning\n");
1599 if (!
psa->fLogicalOrder &&
psa->fRTL)
1609 enum {Lao_Norm=0, Lao_ABOVE1, Lao_ABOVE2, Lao_BELOW1, Lao_BELOW2, Lao_AM};
1619 case 0xECD:
return Lao_ABOVE1;
1624 case 0xECC:
return Lao_ABOVE2;
1625 case 0xEBC:
return Lao_BELOW1;
1627 case 0xEB9:
return Lao_BELOW2;
1628 case 0xEB3:
return Lao_AM;
1629 default:
return Lao_Norm;
1639 ERR(
"Number of Glyphs and Chars need to match at the beginning\n");
1643 if (!
psa->fLogicalOrder &&
psa->fRTL)
1656 pwOutChars[cWalk] = replacements[0];
1660 for (
i = 1;
i < 3 && replacements[
i] != 0x0000;
i++)
1663 for (
j = *pcChars;
j > cWalk;
j--)
1664 pwOutChars[
j] = pwOutChars[
j-1];
1665 *pcChars= *pcChars+1;
1666 pwOutChars[cWalk] = replacements[
i];
1676 for (cWalk = 0; cWalk < *pcChars; cWalk++)
1678 for (
i = 0; vowels[
i].
base != 0x0;
i++)
1680 if (pwOutChars[cWalk] == vowels[
i].
base)
1684 if (vowels[
i].
parts[1]) { cWalk++; o++; }
1685 if (vowels[
i].
parts[2]) { cWalk++; o++; }
1699 for (cWalk = 0; cWalk < *pcChars; cWalk += 2)
1701 for (
i = 0; consonants[
i].
output!= 0x0;
i++)
1704 for (
j = 0;
j + cWalk < *pcChars && consonants[
i].
parts[
j]!=0x0;
j++)
1705 if (pwOutChars[cWalk+
j] != consonants[
i].
parts[
j])
1708 if (consonants[
i].
parts[
j]==0x0)
1712 pwOutChars[cWalk] = consonants[
i].
output;
1713 for(
k = cWalk+1;
k < *pcChars -
j;
k++)
1714 pwOutChars[
k] = pwOutChars[
k+
j];
1715 *pcChars = *pcChars -
j;
1716 for (
k =
j ;
k > 0;
k--)
1732 WORD Ra = pwChar[
s->start];
1733 WORD H = pwChar[
s->start+1];
1735 TRACE(
"Doing reorder of Ra to %i\n",
s->base);
1736 for (
j =
s->start; j < s->
base-1;
j++)
1737 pwChar[
j] = pwChar[
j+2];
1738 pwChar[
s->base-1] = Ra;
1739 pwChar[
s->base] =
H;
1741 s->ralf =
s->base-1;
1751 int stop = (
s->blwf >=0)?
s->blwf+1 :
s->base;
1752 WORD Ra = pwChar[
s->start];
1753 WORD H = pwChar[
s->start+1];
1754 for (loc =
s->end; loc > stop; loc--)
1758 TRACE(
"Doing reorder of Ra to %i\n",loc);
1759 for (
j =
s->start;
j < loc-1;
j++)
1760 pwChar[
j] = pwChar[
j+2];
1766 if (
s->blwf >= 0)
s->blwf -= 2;
1767 if (
s->pref >= 0)
s->pref -= 2;
1776 WORD Ra = pwChar[
s->start];
1777 WORD H = pwChar[
s->start+1];
1779 TRACE(
"Doing reorder of Ra to %i\n",
s->end-1);
1780 for (
j =
s->start; j < s->
end-1;
j++)
1781 pwChar[
j] = pwChar[
j+2];
1782 pwChar[
s->end-1] = Ra;
1787 if (
s->blwf >= 0)
s->blwf -= 2;
1788 if (
s->pref >= 0)
s->pref -= 2;
1797 if (
s->end >
s->base)
1799 for (
i = 1;
i <=
s->end-
s->base;
i++)
1805 TRACE(
"Doing reorder of %x %x\n",
c,pwChar[
s->base]);
1806 for (
j =
s->base+
i;
j >
s->base;
j--)
1807 pwChar[
j] = pwChar[
j-1];
1808 pwChar[
s->base] =
c;
1810 if (
s->ralf >=
s->base)
s->ralf++;
1811 if (
s->blwf >=
s->base)
s->blwf++;
1812 if (
s->pref >=
s->base)
s->pref++;
1824 if (
s->end >
s->base)
1826 for (
i = 1;
i <=
s->end-
s->base;
i++)
1832 TRACE(
"Doing reorder of %x to %i\n",
c,
s->start);
1833 for (
j =
s->base+
i;
j >
s->start;
j--)
1834 pwChar[
j] = pwChar[
j-1];
1835 pwChar[
s->start] =
c;
1837 if (
s->ralf >= 0)
s->ralf++;
1838 if (
s->blwf >= 0)
s->blwf++;
1839 if (
s->pref >= 0)
s->pref++;
1849 if (
s->blwf >= 0 &&
g->blwf >
g->base)
1853 for (loc =
s->end; loc >
s->blwf; loc--)
1858 g_offset = (loc -
s->blwf) - 1;
1863 TRACE(
"Doing reorder of Below-base to %i (glyph offset %i)\n",loc,g_offset);
1865 for (
j = 0;
j < g_offset;
j++)
1867 glyphs[
g->blwf + g_offset] = blwf;
1878 for (
i =
s->start; i < s->
base;
i++)
1883 int g_start =
g->start +
i -
s->start;
1884 if (g_start < g->
base -1 )
1887 TRACE(
"Doing reorder of matra from %i to %i\n",g_start,
g->base);
1888 for (
j = g_start;
j <
g->base-1;
j++)
1899 if (
s->pref >= 0 &&
g->pref >
g->base)
1903 TRACE(
"Doing reorder of pref from %i to %i\n",
g->pref,
g->base);
1904 for (
j =
g->pref;
j >
g->base;
j--)
1912 TRACE(
"Syllable (%i..%i..%i)\n",
s->start,
s->base,
s->end);
1913 if (
s->start ==
s->base &&
s->base ==
s->end)
return;
1914 if (lexical(pwChar[
s->base]) ==
lex_Vowel)
return;
1922 TRACE(
"Syllable (%i..%i..%i)\n",
s->start,
s->base,
s->end);
1923 if (
s->start ==
s->base &&
s->base ==
s->end)
return;
1924 if (lexical(pwChar[
s->base]) ==
lex_Vowel)
return;
1932 TRACE(
"Syllable (%i..%i..%i)\n",
s->start,
s->base,
s->end);
1933 if (
s->start ==
s->base &&
s->base ==
s->end)
return;
1934 if (lexical(pwChar[
s->base]) ==
lex_Vowel)
return;
1942 TRACE(
"Syllable (%i..%i..%i)\n",
s->start,
s->base,
s->end);
1943 if (
s->start ==
s->base &&
s->base ==
s->end)
return;
1944 if (lexical(pwChar[
s->base]) ==
lex_Vowel)
return;
1953 TRACE(
"Syllable (%i..%i..%i)\n",
s->start,
s->base,
s->end);
1954 TRACE(
"Glyphs (%i..%i..%i)\n",
g->start,
g->base,
g->end);
1955 if (
s->start ==
s->base &&
s->base ==
s->end)
return;
1956 if (lexical(chars[
s->base]) ==
lex_Vowel)
return;
1964 TRACE(
"Syllable (%i..%i..%i)\n",
s->start,
s->base,
s->end);
1965 TRACE(
"Glyphs (%i..%i..%i)\n",
g->start,
g->base,
g->end);
1966 if (
s->start ==
s->base &&
s->base ==
s->end)
return;
1967 if (lexical(chars[
s->base]) ==
lex_Vowel)
return;
1993static void Apply_Indic_BasicForm(
HDC hdc,
ScriptCache *
psc,
SCRIPT_ANALYSIS *
psa,
WCHAR* pwChars,
INT cChars,
IndicSyllable *syllable,
WORD *
pwOutGlyphs,
INT*
pcGlyphs,
WORD *
pwLogClust,
lexical_function lexical,
IndicSyllable *glyph_index,
LoadedFeature *
feature )
2000 while(index <= glyph_index->
end)
2027static void Apply_Indic_PreBase(
HDC hdc,
ScriptCache *
psc,
SCRIPT_ANALYSIS *
psa,
WCHAR* pwChars,
INT cChars,
IndicSyllable *syllable,
WORD *
pwOutGlyphs,
INT*
pcGlyphs,
WORD *
pwLogClust,
lexical_function lexical,
IndicSyllable *glyph_index,
const char*
feature)
2044 g_offset += (*
pcGlyphs - prevCount);
2052static void Apply_Indic_Rphf(
HDC hdc,
ScriptCache *
psc,
SCRIPT_ANALYSIS *
psa,
WCHAR* pwChars,
INT cChars,
IndicSyllable *syllable,
WORD *
pwOutGlyphs,
INT*
pcGlyphs,
WORD *
pwLogClust,
lexical_function lexical,
IndicSyllable *glyph_index)
2057 if (syllable->
ralf >= 0)
2081static void Apply_Indic_PostBase(
HDC hdc,
ScriptCache *
psc,
SCRIPT_ANALYSIS *
psa,
WCHAR* pwChars,
INT cChars,
IndicSyllable *syllable,
WORD *
pwOutGlyphs,
INT*
pcGlyphs,
WORD *
pwLogClust,
lexical_function lexical,
IndicSyllable *glyph_index,
BOOL modern,
const char* feat)
2094 if (ralf >=0 && ralf <
index)
2112 g_offset += (*
pcGlyphs - prevCount);
2126static void ShapeIndicSyllables(
HDC hdc,
ScriptCache *
psc,
SCRIPT_ANALYSIS *
psa,
WCHAR* pwChars,
INT cChars,
IndicSyllable *syllables,
INT syllable_count,
WORD *
pwOutGlyphs,
INT*
pcGlyphs,
WORD *
pwLogClust,
lexical_function lexical,
second_reorder_function second_reorder,
BOOL modern)
2129 int overall_shift = 0;
2143 for (
c = 0;
c < syllable_count;
c++)
2148 old_end = glyph_indexs.
end;
2152 TRACE(
"applying feature locl\n");
2153 Apply_Indic_BasicForm(
hdc,
psc,
psa, pwChars,
cChars, &syllables[
c],
pwOutGlyphs,
pcGlyphs,
pwLogClust, lexical, &glyph_indexs, locl);
2157 TRACE(
"applying feature nukt\n");
2158 Apply_Indic_BasicForm(
hdc,
psc,
psa, pwChars,
cChars, &syllables[
c],
pwOutGlyphs,
pcGlyphs,
pwLogClust, lexical, &glyph_indexs, nukt);
2162 TRACE(
"applying feature akhn\n");
2163 Apply_Indic_BasicForm(
hdc,
psc,
psa, pwChars,
cChars, &syllables[
c],
pwOutGlyphs,
pcGlyphs,
pwLogClust, lexical, &glyph_indexs, akhn);
2167 Apply_Indic_Rphf(
hdc,
psc,
psa, pwChars,
cChars, &syllables[
c],
pwOutGlyphs,
pcGlyphs,
pwLogClust, lexical, &glyph_indexs);
2170 TRACE(
"applying feature rkrf\n");
2171 Apply_Indic_BasicForm(
hdc,
psc,
psa, pwChars,
cChars, &syllables[
c],
pwOutGlyphs,
pcGlyphs,
pwLogClust, lexical, &glyph_indexs, rkrf);
2174 Apply_Indic_PostBase(
hdc,
psc,
psa, pwChars,
cChars, &syllables[
c],
pwOutGlyphs,
pcGlyphs,
pwLogClust, lexical, &glyph_indexs, modern,
"pref");
2178 Apply_Indic_PreBase(
hdc,
psc,
psa, pwChars,
cChars, &syllables[
c],
pwOutGlyphs,
pcGlyphs,
pwLogClust, lexical, &glyph_indexs,
"blwf");
2180 Apply_Indic_PostBase(
hdc,
psc,
psa, pwChars,
cChars, &syllables[
c],
pwOutGlyphs,
pcGlyphs,
pwLogClust, lexical, &glyph_indexs, modern,
"blwf");
2184 Apply_Indic_PreBase(
hdc,
psc,
psa, pwChars,
cChars, &syllables[
c],
pwOutGlyphs,
pcGlyphs,
pwLogClust, lexical, &glyph_indexs,
"half");
2187 TRACE(
"applying feature pstf\n");
2188 Apply_Indic_BasicForm(
hdc,
psc,
psa, pwChars,
cChars, &syllables[
c],
pwOutGlyphs,
pcGlyphs,
pwLogClust, lexical, &glyph_indexs, pstf);
2192 TRACE(
"applying feature vatu\n");
2193 Apply_Indic_BasicForm(
hdc,
psc,
psa, pwChars,
cChars, &syllables[
c],
pwOutGlyphs,
pcGlyphs,
pwLogClust, lexical, &glyph_indexs, vatu);
2197 TRACE(
"applying feature cjct\n");
2198 Apply_Indic_BasicForm(
hdc,
psc,
psa, pwChars,
cChars, &syllables[
c],
pwOutGlyphs,
pcGlyphs,
pwLogClust, lexical, &glyph_indexs, cjct);
2202 second_reorder(pwChars, &syllables[
c],
pwOutGlyphs, &glyph_indexs, lexical);
2204 overall_shift += glyph_indexs.
end - old_end;
2257 case 0x0015:
return lex_Ra;
2275 {0x0DDA, {0x0DD9,0x0DDA,0x0}},
2276 {0x0DDC, {0x0DD9,0x0DDC,0x0}},
2277 {0x0DDD, {0x0DD9,0x0DDD,0x0}},
2278 {0x0DDE, {0x0DD9,0x0DDE,0x0}},
2279 {0x0000, {0x0000,0x0000,0x0}}};
2287 int syllable_count = 0;
2291 ERR(
"Number of Glyphs and Chars need to match at the beginning\n");
2309 for (
i = 0;
i < cCount;
i++)
2312 (
i == 0 ||
input[
i-1] == 0x0020 ||
i == cCount-1 ||
input[
i+1] == 0x0020))
2319 ShapeIndicSyllables(
hdc,
psc,
psa,
input,
cChars, syllables, syllable_count,
pwOutGlyphs,
pcGlyphs,
pwLogClust,
sinhala_lex,
NULL,
TRUE);
2329 case 0x0930:
return lex_Ra;
2336 {{0x0928, 0x093C, 0x00000}, 0x0929},
2337 {{0x0930, 0x093C, 0x00000}, 0x0931},
2338 {{0x0933, 0x093C, 0x00000}, 0x0934},
2339 {{0x0915, 0x093C, 0x00000}, 0x0958},
2340 {{0x0916, 0x093C, 0x00000}, 0x0959},
2341 {{0x0917, 0x093C, 0x00000}, 0x095A},
2342 {{0x091C, 0x093C, 0x00000}, 0x095B},
2343 {{0x0921, 0x093C, 0x00000}, 0x095C},
2344 {{0x0922, 0x093C, 0x00000}, 0x095D},
2345 {{0x092B, 0x093C, 0x00000}, 0x095E},
2346 {{0x092F, 0x093C, 0x00000}, 0x095F}};
2353 int syllable_count = 0;
2358 ERR(
"Number of Glyphs and Chars need to match at the beginning\n");
2376 ShapeIndicSyllables(
hdc,
psc,
psa,
input,
cChars, syllables, syllable_count,
pwOutGlyphs,
pcGlyphs,
pwLogClust,
devanagari_lex,
NULL, modern);
2386 case 0x09B0:
return lex_Ra;
2393 {0x09CB, {0x09C7,0x09BE,0x0000}},
2394 {0x09CC, {0x09C7,0x09D7,0x0000}},
2395 {0x0000, {0x0000,0x0000,0x0000}}};
2398 {{0x09A4,0x09CD,0x200D}, 0x09CE},
2399 {{0x09A1,0x09BC,0x0000}, 0x09DC},
2400 {{0x09A2,0x09BC,0x0000}, 0x09DD},
2401 {{0x09AF,0x09BC,0x0000}, 0x09DF},
2402 {{0x0000,0x0000,0x0000}, 0x0000}};
2409 int syllable_count = 0;
2414 ERR(
"Number of Glyphs and Chars need to match at the beginning\n");
2433 for (cCount = cCount - 1 ; cCount >= 0; cCount --)
2435 if (cCount == 0 ||
input[cCount] == 0x0020)
2446 ShapeIndicSyllables(
hdc,
psc,
psa,
input,
cChars, syllables, syllable_count,
pwOutGlyphs,
pcGlyphs,
pwLogClust,
bengali_lex,
NULL, modern);
2461 {{0x0A32,0x0A3C,0x0000}, 0x0A33},
2462 {{0x0A16,0x0A3C,0x0000}, 0x0A59},
2463 {{0x0A17,0x0A3C,0x0000}, 0x0A5A},
2464 {{0x0A1C,0x0A3C,0x0000}, 0x0A5B},
2465 {{0x0A2B,0x0A3C,0x0000}, 0x0A5E},
2466 {{0x0000,0x0000,0x0000}, 0x0000}};
2473 int syllable_count = 0;
2478 ERR(
"Number of Glyphs and Chars need to match at the beginning\n");
2496 ShapeIndicSyllables(
hdc,
psc,
psa,
input,
cChars, syllables, syllable_count,
pwOutGlyphs,
pcGlyphs,
pwLogClust,
gurmukhi_lex,
NULL, modern);
2506 case 0x0AB0:
return lex_Ra;
2517 int syllable_count = 0;
2522 ERR(
"Number of Glyphs and Chars need to match at the beginning\n");
2536 ShapeIndicSyllables(
hdc,
psc,
psa,
input,
cChars, syllables, syllable_count,
pwOutGlyphs,
pcGlyphs,
pwLogClust,
gujarati_lex,
NULL, modern);
2546 case 0x0B30:
return lex_Ra;
2553 {0x0B48, {0x0B47,0x0B56,0x0000}},
2554 {0x0B4B, {0x0B47,0x0B3E,0x0000}},
2555 {0x0B4C, {0x0B47,0x0B57,0x0000}},
2556 {0x0000, {0x0000,0x0000,0x0000}}};
2559 {{0x0B21,0x0B3C,0x0000}, 0x0B5C},
2560 {{0x0B22,0x0B3C,0x0000}, 0x0B5D},
2561 {{0x0000,0x0000,0x0000}, 0x0000}};
2568 int syllable_count = 0;
2573 ERR(
"Number of Glyphs and Chars need to match at the beginning\n");
2592 ShapeIndicSyllables(
hdc,
psc,
psa,
input,
cChars, syllables, syllable_count,
pwOutGlyphs,
pcGlyphs,
pwLogClust,
oriya_lex,
NULL, modern);
2604 {0x0BCA, {0x0BC6,0x0BBE,0x0000}},
2605 {0x0BCB, {0x0BC7,0x0BBE,0x0000}},
2606 {0x0BCB, {0x0BC6,0x0BD7,0x0000}},
2607 {0x0000, {0x0000,0x0000,0x0000}}};
2610 {{0x0B92,0x0BD7,0x0000}, 0x0B94},
2611 {{0x0000,0x0000,0x0000}, 0x0000}};
2618 int syllable_count = 0;
2623 ERR(
"Number of Glyphs and Chars need to match at the beginning\n");
2642 ShapeIndicSyllables(
hdc,
psc,
psa,
input,
cChars, syllables, syllable_count,
pwOutGlyphs,
pcGlyphs,
pwLogClust,
tamil_lex,
SecondReorder_Like_Tamil, modern);
2660 {0x0C48, {0x0C46,0x0C56,0x0000}},
2661 {0x0000, {0x0000,0x0000,0x0000}}};
2668 int syllable_count = 0;
2673 ERR(
"Number of Glyphs and Chars need to match at the beginning\n");
2691 ShapeIndicSyllables(
hdc,
psc,
psa,
input,
cChars, syllables, syllable_count,
pwOutGlyphs,
pcGlyphs,
pwLogClust,
telugu_lex,
SecondReorder_Like_Telugu, modern);
2701 case 0x0CB0:
return lex_Ra;
2708 {0x0CC0, {0x0CBF,0x0CD5,0x0000}},
2709 {0x0CC7, {0x0CC6,0x0CD5,0x0000}},
2710 {0x0CC8, {0x0CC6,0x0CD6,0x0000}},
2711 {0x0CCA, {0x0CC6,0x0CC2,0x0000}},
2712 {0x0CCB, {0x0CC6,0x0CC2,0x0CD5}},
2713 {0x0000, {0x0000,0x0000,0x0000}}};
2720 int syllable_count = 0;
2725 ERR(
"Number of Glyphs and Chars need to match at the beginning\n");
2743 ShapeIndicSyllables(
hdc,
psc,
psa,
input,
cChars, syllables, syllable_count,
pwOutGlyphs,
pcGlyphs,
pwLogClust,
kannada_lex,
SecondReorder_Like_Telugu, modern);
2755 {0x0D4A, {0x0D46,0x0D3E,0x0000}},
2756 {0x0D4B, {0x0D47,0x0D3E,0x0000}},
2757 {0x0D4C, {0x0D46,0x0D57,0x0000}},
2758 {0x0000, {0x0000,0x0000,0x0000}}};
2765 int syllable_count = 0;
2770 ERR(
"Number of Glyphs and Chars need to match at the beginning\n");
2788 ShapeIndicSyllables(
hdc,
psc,
psa,
input,
cChars, syllables, syllable_count,
pwOutGlyphs,
pcGlyphs,
pwLogClust,
malayalam_lex,
SecondReorder_Like_Tamil, modern);
2804 int syllable_count = 0;
2808 ERR(
"Number of Glyphs and Chars need to match at the beginning\n");
2822 ShapeIndicSyllables(
hdc,
psc,
psa,
input,
cChars, syllables, syllable_count,
pwOutGlyphs,
pcGlyphs,
pwLogClust,
khmer_lex,
NULL,
FALSE);
2830 return ((chr == 0x0020) || (chr == 0x200C) || (chr == 0x202F) || (chr == 0x180E) || (chr == 0x1800) || (chr == 0x1802) || (chr == 0x1803) || (chr == 0x1805) || (chr == 0x1808) || (chr == 0x1809) || (chr == 0x1807));
2843 ERR(
"Number of Glyphs and Chars need to match at the beginning\n");
2847 if (!
psa->fLogicalOrder &&
psa->fRTL)
2852 if (!
psc->GSUB_Table)
2862 context_shape[
i] =
Xn;
2864 context_shape[
i] =
Xl;
2869 context_shape[
i] =
Xr;
2871 context_shape[
i] =
Xm;
2877 char_index = glyph_index = 0;
2879 char_index = glyph_index =
cChars-1;
2881 while(char_index < cChars && char_index >= 0)
2890 glyph_index = nextIndex;
2896 glyph_index += dirL;
2916 char_index[char_count++] =
k;
2919 if (char_count == 0)
2922 if (char_count ==1 &&
pwcChars[char_index[0]] == 0x0020)
2942 if (pGlyphProp[
i].sva.fZeroWidth)
2955 if (pwGlyphs[
i] ==
psc->sfp.wgDefault)
2965 int initGlyph, finaGlyph;
2972 if (
psa->fLogicalOrder &&
psa->fRTL)
3001 BOOL isInit, isFinal;
3007 char_index[char_count++] =
k;
3010 isInit = (
i == initGlyph || (
i+dirR > 0 &&
i+dirR <
cGlyphs && spaces[
i+dirR]));
3011 isFinal = (
i == finaGlyph || (
i+dirL > 0 &&
i+dirL <
cGlyphs && spaces[
i+dirL]));
3013 if (char_count == 0)
3016 if (char_count == 1)