summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2004-08-02 21:04:07 +0000
committerOwen Taylor <otaylor@src.gnome.org>2004-08-02 21:04:07 +0000
commitf1fa44432a6c6e7ff74bc2f705056eeca6c1e2ed (patch)
tree9ef885dc596ef98df558579eed4150b08915adda
parent2d40d7568d436bae3bf74d46d08cded8dfa612fa (diff)
downloadpango-f1fa44432a6c6e7ff74bc2f705056eeca6c1e2ed.tar.gz
Add support for 'init' feature for Bengali. (#130966, Sayamindu Dasgupta)
Mon Aug 2 17:00:19 2004 Owen Taylor <otaylor@redhat.com> * modules/indic/indic-fc.c modules/indic/indic-ot.[ch]: Add support for 'init' feature for Bengali. (#130966, Sayamindu Dasgupta)
-rw-r--r--ChangeLog6
-rw-r--r--ChangeLog.pre-1-106
-rw-r--r--ChangeLog.pre-1-66
-rw-r--r--ChangeLog.pre-1-86
-rw-r--r--modules/indic/indic-fc.c1
-rw-r--r--modules/indic/indic-ot.c22
-rw-r--r--modules/indic/indic-ot.h13
7 files changed, 48 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 351ebe54..8fba3c9c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Mon Aug 2 17:00:19 2004 Owen Taylor <otaylor@redhat.com>
+
+ * modules/indic/indic-fc.c modules/indic/indic-ot.[ch]:
+ Add support for 'init' feature for Bengali.
+ (#130966, Sayamindu Dasgupta)
+
Fri Jul 30 17:17:05 2004 Owen Taylor <otaylor@redhat.com>
* pango/opentype/ftxgpos.[ch] pango/opentype/ftxgsub.[ch]
diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10
index 351ebe54..8fba3c9c 100644
--- a/ChangeLog.pre-1-10
+++ b/ChangeLog.pre-1-10
@@ -1,3 +1,9 @@
+Mon Aug 2 17:00:19 2004 Owen Taylor <otaylor@redhat.com>
+
+ * modules/indic/indic-fc.c modules/indic/indic-ot.[ch]:
+ Add support for 'init' feature for Bengali.
+ (#130966, Sayamindu Dasgupta)
+
Fri Jul 30 17:17:05 2004 Owen Taylor <otaylor@redhat.com>
* pango/opentype/ftxgpos.[ch] pango/opentype/ftxgsub.[ch]
diff --git a/ChangeLog.pre-1-6 b/ChangeLog.pre-1-6
index 351ebe54..8fba3c9c 100644
--- a/ChangeLog.pre-1-6
+++ b/ChangeLog.pre-1-6
@@ -1,3 +1,9 @@
+Mon Aug 2 17:00:19 2004 Owen Taylor <otaylor@redhat.com>
+
+ * modules/indic/indic-fc.c modules/indic/indic-ot.[ch]:
+ Add support for 'init' feature for Bengali.
+ (#130966, Sayamindu Dasgupta)
+
Fri Jul 30 17:17:05 2004 Owen Taylor <otaylor@redhat.com>
* pango/opentype/ftxgpos.[ch] pango/opentype/ftxgsub.[ch]
diff --git a/ChangeLog.pre-1-8 b/ChangeLog.pre-1-8
index 351ebe54..8fba3c9c 100644
--- a/ChangeLog.pre-1-8
+++ b/ChangeLog.pre-1-8
@@ -1,3 +1,9 @@
+Mon Aug 2 17:00:19 2004 Owen Taylor <otaylor@redhat.com>
+
+ * modules/indic/indic-fc.c modules/indic/indic-ot.[ch]:
+ Add support for 'init' feature for Bengali.
+ (#130966, Sayamindu Dasgupta)
+
Fri Jul 30 17:17:05 2004 Owen Taylor <otaylor@redhat.com>
* pango/opentype/ftxgpos.[ch] pango/opentype/ftxgsub.[ch]
diff --git a/modules/indic/indic-fc.c b/modules/indic/indic-fc.c
index 45eb48f8..4fab97cc 100644
--- a/modules/indic/indic-fc.c
+++ b/modules/indic/indic-fc.c
@@ -186,6 +186,7 @@ get_gsub_ruleset (FT_Face face, PangoIndicInfo *indic_info)
if (pango_ot_info_find_script (info, PANGO_OT_TABLE_GSUB,
indic_info->scriptTag, &script_index))
{
+ maybe_add_GSUB_feature (ruleset, info, script_index, FT_MAKE_TAG ('i','n','i','t'), init);
maybe_add_GSUB_feature (ruleset, info, script_index, FT_MAKE_TAG ('n','u','k','t'), nukt);
maybe_add_GSUB_feature (ruleset, info, script_index, FT_MAKE_TAG ('a','k','h','n'), akhn);
maybe_add_GSUB_feature (ruleset, info, script_index, FT_MAKE_TAG ('r','p','h','f'), rphf);
diff --git a/modules/indic/indic-ot.c b/modules/indic/indic-ot.c
index 6670ae4a..941688f1 100644
--- a/modules/indic/indic-ot.c
+++ b/modules/indic/indic-ot.c
@@ -31,6 +31,7 @@ struct _Output
gunichar fLengthMark;
glong fMatraIndex;
gulong fMatraTags;
+ gboolean fMatraWordStart;
glong fMPreOutIndex;
MPreFixups *fMPreFixups;
@@ -71,12 +72,13 @@ static void saveMatra(Output *output, gunichar matra, IndicOTCharClass matraClas
}
}
-static void initMatra(Output *output, guint32 matraIndex, gulong matraTags)
+static void initMatra(Output *output, guint32 matraIndex, gulong matraTags, gboolean wordStart)
{
output->fMpre = output->fMbelow = output->fMabove = output->fMpost = output->fLengthMark = 0;
output->fMPreOutIndex = -1;
output->fMatraIndex = matraIndex;
output->fMatraTags = matraTags;
+ output->fMatraWordStart = wordStart;
}
static gboolean noteMatra(Output *output, const IndicOTClassTable *classTable, gunichar matra)
@@ -123,8 +125,12 @@ static void writeChar(Output *output, gunichar ch, guint32 charIndex, gulong cha
static void writeMpre(Output *output)
{
if (output->fMpre != 0) {
+ gulong tags = output->fMatraTags;
+ if (output->fMatraWordStart)
+ tags &= ~init;
+
output->fMPreOutIndex = output->fOutIndex;
- writeChar(output, output->fMpre, output->fMatraIndex, output->fMatraTags);
+ writeChar(output, output->fMpre, output->fMatraIndex, tags);
}
}
@@ -169,6 +175,7 @@ glong indic_ot_reorder(const gunichar *chars, const glong *utf8_offsets, glong c
MPreFixups *mpreFixups = NULL;
Output output;
glong i, prev = 0;
+ gboolean last_in_word = FALSE;
if (outMPreFixups && (class_table->scriptFlags & SF_MPRE_FIXUP)) {
mpreFixups = indic_mprefixups_new (char_count);
@@ -190,13 +197,16 @@ glong indic_ot_reorder(const gunichar *chars, const glong *utf8_offsets, glong c
}
matra = vmabove - 1;
- initMatra(&output, prev, blwf_p);
- while (noteMatra(&output, class_table, chars[matra]) &&
- matra != prev)
- matra--;
+ initMatra(&output, prev, blwf_p, !last_in_word);
+ while (noteMatra(&output, class_table, chars[matra]) &&
+ matra != prev)
+ matra--;
+ last_in_word = TRUE;
switch (indic_ot_get_char_class(class_table, chars[prev]) & CF_CLASS_MASK) {
case CC_RESERVED:
+ last_in_word = FALSE;
+ /* Fall through */
case CC_INDEPENDENT_VOWEL:
case CC_ZERO_WIDTH_MARK:
for (i = prev; i < syllable; i += 1) {
diff --git a/modules/indic/indic-ot.h b/modules/indic/indic-ot.h
index 9fb46877..3337fe0e 100644
--- a/modules/indic/indic-ot.h
+++ b/modules/indic/indic-ot.h
@@ -114,7 +114,8 @@ enum indic_glyph_feature_
blwm = 0x1000,
abvm = 0x2000,
dist = 0x4000,
- junk = 0x8000
+ junk = 0x8000,
+ init = 0x10000
};
/*
@@ -130,11 +131,11 @@ enum indic_glyph_feature_
*/
enum indic_glyph_property_
{
- rphf_p = (junk | dist),
- blwf_p = (junk | dist | rphf),
- half_p = (junk | dist | rphf | blwf),
- pstf_p = (junk | dist | rphf | blwf | half),
- nukt_p = (junk | dist | rphf | blwf | half | pstf)
+ rphf_p = (junk | dist | init),
+ blwf_p = (junk | dist | init | rphf),
+ half_p = (junk | dist | init | rphf | blwf),
+ pstf_p = (junk | dist | init | rphf | blwf | half),
+ nukt_p = (junk | dist | init | rphf | blwf | half | pstf)
};
/*