summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2009-11-18 13:14:31 +0100
committerLars Knoll <lars.knoll@nokia.com>2009-11-18 13:14:31 +0100
commitb0d396aa88b3cdf8cea896bfeeba197656e1cdb1 (patch)
treed8b20abb3746d14d58577187a94dfb48ebcea2dc
parent797fe54d9ebbafb0cdc00705c008ea09e7ac1e9e (diff)
Post substitutions should apply to the whole indic syllable
This fixes a bug in the rendering of Malayalam
-rw-r--r--src/harfbuzz-indic.cpp10
-rw-r--r--tests/shaping/main.cpp34
2 files changed, 34 insertions, 10 deletions
diff --git a/src/harfbuzz-indic.cpp b/src/harfbuzz-indic.cpp
index 3008fca..3c9df93 100644
--- a/src/harfbuzz-indic.cpp
+++ b/src/harfbuzz-indic.cpp
@@ -1551,6 +1551,7 @@ static bool indic_shape_syllable(HB_Bool openType, HB_ShaperItem *item, bool inv
| PreSubstProperty
| BelowSubstProperty
| AboveSubstProperty
+ | PostSubstProperty
| HalantProperty
| PositioningProperties);
@@ -1608,14 +1609,7 @@ static bool indic_shape_syllable(HB_Bool openType, HB_ShaperItem *item, bool inv
// pres always applies
// blws always applies
// abvs always applies
-
- // psts
- // ### this looks slightly different from before, but I believe it's correct
- if (reordered[len-1] != halant || base != len-2)
- properties[base] &= ~PostSubstProperty;
- for (i = base+1; i < len; ++i)
- properties[i] &= ~PostSubstProperty;
-
+ // psts always applies
// halant always applies
#ifdef INDIC_DEBUG
diff --git a/tests/shaping/main.cpp b/tests/shaping/main.cpp
index 12fa7c4..827ac30 100644
--- a/tests/shaping/main.cpp
+++ b/tests/shaping/main.cpp
@@ -686,7 +686,7 @@ void tst_QScriptEngine::bengali()
void tst_QScriptEngine::gurmukhi()
{
{
- FT_Face face = loadFace("lohit.punjabi.1.1.ttf");
+ FT_Face face = loadFace("lohit_pa.ttf");
if (face) {
const ShapeTable shape_table [] = {
{ { 0xA15, 0xA4D, 0xa39, 0x0 },
@@ -998,6 +998,36 @@ void tst_QScriptEngine::malayalam()
QSKIP("couln't find AkrutiMal2Normal.ttf", SkipAll);
}
}
+
+ {
+ FT_Face face = loadFace("Rachana.ttf");
+ if (face) {
+ const ShapeTable shape_table [] = {
+ { { 0xd37, 0xd4d, 0xd1f, 0xd4d, 0xd30, 0xd40, 0x0 },
+ { 0x385, 0xa3, 0x0 } },
+ { { 0xd2f, 0xd4d, 0xd15, 0xd4d, 0xd15, 0xd41, 0x0 },
+ { 0x2ff, 0x0 } },
+ { { 0xd33, 0xd4d, 0xd33, 0x0 },
+ { 0x3f8, 0x0 } },
+ { { 0xd2f, 0xd4d, 0xd15, 0xd4d, 0xd15, 0xd41, 0x0 },
+ { 0x2ff, 0x0 } },
+
+ { {0}, {0} }
+ };
+
+
+ const ShapeTable *s = shape_table;
+ while (s->unicode[0]) {
+ QVERIFY( shaping(face, s, HB_Script_Malayalam) );
+ ++s;
+ }
+
+ FT_Done_Face(face);
+ } else {
+ QSKIP("couln't find Rachana.ttf", SkipAll);
+ }
+ }
+
}
void tst_QScriptEngine::sinhala()
@@ -1113,7 +1143,7 @@ void tst_QScriptEngine::nko()
void tst_QScriptEngine::linearB()
{
{
- FT_Face face = loadFace("PENUTURE.TTF");
+ FT_Face face = loadFace("penuture.ttf");
if (face) {
const ShapeTable shape_table [] = {
{ { 0xd800, 0xdc01, 0xd800, 0xdc02, 0xd800, 0xdc03, 0 },