diff options
author | Owen Taylor <otaylor@redhat.com> | 2004-08-02 21:04:07 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2004-08-02 21:04:07 +0000 |
commit | f1fa44432a6c6e7ff74bc2f705056eeca6c1e2ed (patch) | |
tree | 9ef885dc596ef98df558579eed4150b08915adda /modules/indic | |
parent | 2d40d7568d436bae3bf74d46d08cded8dfa612fa (diff) | |
download | pango-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)
Diffstat (limited to 'modules/indic')
-rw-r--r-- | modules/indic/indic-fc.c | 1 | ||||
-rw-r--r-- | modules/indic/indic-ot.c | 22 | ||||
-rw-r--r-- | modules/indic/indic-ot.h | 13 |
3 files changed, 24 insertions, 12 deletions
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) }; /* |