[arch-commits] Commit in icu/repos (8 files)

Andreas Radke andyrtr at archlinux.org
Sat Dec 10 08:32:40 UTC 2016


    Date: Saturday, December 10, 2016 @ 08:32:40
  Author: andyrtr
Revision: 282996

archrelease: copy trunk to testing-i686, testing-x86_64

Added:
  icu/repos/testing-i686/
  icu/repos/testing-i686/PKGBUILD
    (from rev 282995, icu/trunk/PKGBUILD)
  icu/repos/testing-i686/icu-58.1-iterator-reset.patch
    (from rev 282995, icu/trunk/icu-58.1-iterator-reset.patch)
  icu/repos/testing-i686/icu.8198.revert.icu5431.patch
    (from rev 282995, icu/trunk/icu.8198.revert.icu5431.patch)
  icu/repos/testing-x86_64/
  icu/repos/testing-x86_64/PKGBUILD
    (from rev 282995, icu/trunk/PKGBUILD)
  icu/repos/testing-x86_64/icu-58.1-iterator-reset.patch
    (from rev 282995, icu/trunk/icu-58.1-iterator-reset.patch)
  icu/repos/testing-x86_64/icu.8198.revert.icu5431.patch
    (from rev 282995, icu/trunk/icu.8198.revert.icu5431.patch)

----------------------------------------------+
 testing-i686/PKGBUILD                        |   55 ++++++++++
 testing-i686/icu-58.1-iterator-reset.patch   |  124 ++++++++++++++++++++++++
 testing-i686/icu.8198.revert.icu5431.patch   |  129 +++++++++++++++++++++++++
 testing-x86_64/PKGBUILD                      |   55 ++++++++++
 testing-x86_64/icu-58.1-iterator-reset.patch |  124 ++++++++++++++++++++++++
 testing-x86_64/icu.8198.revert.icu5431.patch |  129 +++++++++++++++++++++++++
 6 files changed, 616 insertions(+)

Copied: icu/repos/testing-i686/PKGBUILD (from rev 282995, icu/trunk/PKGBUILD)
===================================================================
--- testing-i686/PKGBUILD	                        (rev 0)
+++ testing-i686/PKGBUILD	2016-12-10 08:32:40 UTC (rev 282996)
@@ -0,0 +1,55 @@
+# $Id$
+# Maintainer: Andreas Radke <andyrtr at archlinux.org>
+# Contributor: Art Gramlich <art at gramlich-net.com>
+
+pkgname=icu
+pkgver=58.2
+pkgrel=1
+pkgdesc="International Components for Unicode library"
+arch=(i686 x86_64)
+url="http://www.icu-project.org/"
+license=('custom:icu')
+depends=('gcc-libs>=4.7.1-5' 'sh')
+#makedepends=('clang')
+# no https available
+source=(#http://download.icu-project.org/files/${pkgname}4c/${pkgver}/${pkgname}4c-${pkgver/./_}-src.tgz
+	http://download.icu-project.org/files/${pkgname}4c/${pkgver}/${pkgname}4c-${pkgver//./_}-src.tgz
+	icu-58.1-iterator-reset.patch)
+#	icu.8198.revert.icu5431.patch)
+# upstream offers md5sum checks, only asc file for md5sum check
+md5sums=('fac212b32b7ec7ab007a12dff1f3aea1'
+         '8c09ae284967def053e9579d64d0f83c')
+#         'ebd5470fc969c75e52baf4af94a9ee82')
+
+prepare() {
+  cd icu/source
+
+# that file is no more present in current release, asume the bug to be fixed.
+#  # fix Malayalam encoding https://bugzilla.redhat.com/show_bug.cgi?id=654200
+#  patch -Rp3 -i ${srcdir}/icu.8198.revert.icu5431.patch
+
+  # http://bugs.icu-project.org/trac/ticket/12827
+  patch -Np4 -i ${srcdir}/icu-58.1-iterator-reset.patch
+}
+
+build() {
+  cd icu/source
+  ./configure --prefix=/usr \
+	--sysconfdir=/etc \
+	--mandir=/usr/share/man \
+	--sbindir=/usr/bin
+  make
+}
+
+check() {
+  cd icu/source
+  make -k check # passes all
+}
+
+package() {
+  cd icu/source
+  make -j1 DESTDIR=${pkgdir} install
+
+  # Install license
+  install -Dm644 ${srcdir}/icu/license.html ${pkgdir}/usr/share/licenses/icu/license.html
+}

Copied: icu/repos/testing-i686/icu-58.1-iterator-reset.patch (from rev 282995, icu/trunk/icu-58.1-iterator-reset.patch)
===================================================================
--- testing-i686/icu-58.1-iterator-reset.patch	                        (rev 0)
+++ testing-i686/icu-58.1-iterator-reset.patch	2016-12-10 08:32:40 UTC (rev 282996)
@@ -0,0 +1,124 @@
+Index: /icu/trunk/source/common/ulist.c
+===================================================================
+--- /icu/trunk/source/common/ulist.c	(revision 39483)
++++ /icu/trunk/source/common/ulist.c	(revision 39484)
+@@ -30,5 +30,4 @@
+     
+     int32_t size;
+-    int32_t currentIndex;
+ };
+ 
+@@ -52,5 +51,4 @@
+     newList->tail = NULL;
+     newList->size = 0;
+-    newList->currentIndex = -1;
+     
+     return newList;
+@@ -81,6 +79,7 @@
+         p->next->previous = p->previous;
+     }
+-    list->curr = NULL;
+-    list->currentIndex = 0;
++    if (p == list->curr) {
++        list->curr = p->next;
++    }
+     --list->size;
+     if (p->forceDelete) {
+@@ -151,5 +150,4 @@
+         list->head->previous = newItem;
+         list->head = newItem;
+-        list->currentIndex++;
+     }
+     
+@@ -194,5 +192,4 @@
+     curr = list->curr;
+     list->curr = curr->next;
+-    list->currentIndex++;
+     
+     return curr->data;
+@@ -210,5 +207,4 @@
+     if (list != NULL) {
+         list->curr = list->head;
+-        list->currentIndex = 0;
+     }
+ }
+@@ -273,3 +269,2 @@
+     return (UList *)(en->context);
+ }
+-
+Index: /icu/trunk/source/i18n/ucol_res.cpp
+===================================================================
+--- /icu/trunk/source/i18n/ucol_res.cpp	(revision 39483)
++++ /icu/trunk/source/i18n/ucol_res.cpp	(revision 39484)
+@@ -681,4 +681,5 @@
+     }
+     memcpy(en, &defaultKeywordValues, sizeof(UEnumeration));
++    ulist_resetList(sink.values);  // Initialize the iterator.
+     en->context = sink.values;
+     sink.values = NULL;  // Avoid deletion in the sink destructor.
+Index: /icu/trunk/source/test/intltest/apicoll.cpp
+===================================================================
+--- /icu/trunk/source/test/intltest/apicoll.cpp	(revision 39483)
++++ /icu/trunk/source/test/intltest/apicoll.cpp	(revision 39484)
+@@ -82,14 +82,7 @@
+     col = Collator::createInstance(Locale::getEnglish(), success);
+     if (U_FAILURE(success)){
+-        errcheckln(success, "Default Collator creation failed. - %s", u_errorName(success));
+-        return;
+-    }
+-
+-    StringEnumeration* kwEnum = col->getKeywordValuesForLocale("", Locale::getEnglish(),true,success);
+-    if (U_FAILURE(success)){
+-        errcheckln(success, "Get Keyword Values for Locale failed. - %s", u_errorName(success));
+-        return;
+-    }
+-    delete kwEnum;
++        errcheckln(success, "English Collator creation failed. - %s", u_errorName(success));
++        return;
++    }
+ 
+     col->getVersion(versionArray);
+@@ -230,4 +223,27 @@
+     delete aFrCol;
+     delete junk;
++}
++
++void CollationAPITest::TestKeywordValues() {
++    IcuTestErrorCode errorCode(*this, "TestKeywordValues");
++    LocalPointer<Collator> col(Collator::createInstance(Locale::getEnglish(), errorCode));
++    if (errorCode.logIfFailureAndReset("English Collator creation failed")) {
++        return;
++    }
++
++    LocalPointer<StringEnumeration> kwEnum(
++        col->getKeywordValuesForLocale("collation", Locale::getEnglish(), TRUE, errorCode));
++    if (errorCode.logIfFailureAndReset("Get Keyword Values for English Collator failed")) {
++        return;
++    }
++    assertTrue("expect at least one collation tailoring for English", kwEnum->count(errorCode) > 0);
++    const char *kw;
++    UBool hasStandard = FALSE;
++    while ((kw = kwEnum->next(NULL, errorCode)) != NULL) {
++        if (strcmp(kw, "standard") == 0) {
++            hasStandard = TRUE;
++        }
++    }
++    assertTrue("expect at least the 'standard' collation tailoring for English", hasStandard);
+ }
+ 
+@@ -2467,4 +2483,5 @@
+     TESTCASE_AUTO_BEGIN;
+     TESTCASE_AUTO(TestProperty);
++    TESTCASE_AUTO(TestKeywordValues);
+     TESTCASE_AUTO(TestOperators);
+     TESTCASE_AUTO(TestDuplicate);
+Index: /icu/trunk/source/test/intltest/apicoll.h
+===================================================================
+--- /icu/trunk/source/test/intltest/apicoll.h	(revision 39483)
++++ /icu/trunk/source/test/intltest/apicoll.h	(revision 39484)
+@@ -36,4 +36,5 @@
+      */
+     void TestProperty(/* char* par */);
++    void TestKeywordValues();
+ 
+     /**

Copied: icu/repos/testing-i686/icu.8198.revert.icu5431.patch (from rev 282995, icu/trunk/icu.8198.revert.icu5431.patch)
===================================================================
--- testing-i686/icu.8198.revert.icu5431.patch	                        (rev 0)
+++ testing-i686/icu.8198.revert.icu5431.patch	2016-12-10 08:32:40 UTC (rev 282996)
@@ -0,0 +1,129 @@
+Index: icu/trunk/source/layout/IndicReordering.cpp
+===================================================================
+--- icu/trunk/source/layout/IndicReordering.cpp	(revision 25772)
++++ icu/trunk/source/layout/IndicReordering.cpp	(revision 26090)
+@@ -126,4 +126,8 @@
+     FeatureMask fSMFeatures;
+ 
++    LEUnicode   fPreBaseConsonant;
++    LEUnicode   fPreBaseVirama;
++    le_int32    fPBCIndex;
++    FeatureMask fPBCFeatures;
+ 
+     void saveMatra(LEUnicode matra, le_int32 matraIndex, IndicClassTable::CharClass matraClass)
+@@ -172,5 +176,6 @@
+           fMatraFeatures(0), fMPreOutIndex(-1), fMPreFixups(mpreFixups),
+           fVMabove(0), fVMpost(0), fVMIndex(0), fVMFeatures(0),
+-          fSMabove(0), fSMbelow(0), fSMIndex(0), fSMFeatures(0)
++          fSMabove(0), fSMbelow(0), fSMIndex(0), fSMFeatures(0),
++          fPreBaseConsonant(0), fPreBaseVirama(0), fPBCIndex(0), fPBCFeatures(0)
+     {
+         // nothing else to do...
+@@ -191,4 +196,6 @@
+         fVMabove = fVMpost  = 0;
+         fSMabove = fSMbelow = 0;
++
++        fPreBaseConsonant = fPreBaseVirama = 0;
+     }
+ 
+@@ -386,4 +393,12 @@
+     }
+ 
++    void notePreBaseConsonant(le_uint32 index,LEUnicode PBConsonant, LEUnicode PBVirama, FeatureMask features)
++    {
++        fPBCIndex = index;
++        fPreBaseConsonant = PBConsonant;
++        fPreBaseVirama = PBVirama;
++        fPBCFeatures = features;
++    }
++
+     void noteBaseConsonant()
+     {
+@@ -465,4 +480,20 @@
+     }
+     
++    void writePreBaseConsonant()
++    {
++        // The TDIL spec says that consonant + virama + RRA should produce a rakar in Malayalam.  However,
++        // it seems that almost none of the fonts for Malayalam are set up to handle this.
++        // So, we're going to force the issue here by using the rakar as defined with RA in most fonts.
++
++        if (fPreBaseConsonant == 0x0d31) { // RRA
++            fPreBaseConsonant = 0x0d30; // RA
++        }
++        
++        if (fPreBaseConsonant != 0) {
++            writeChar(fPreBaseConsonant, fPBCIndex, fPBCFeatures);
++            writeChar(fPreBaseVirama,fPBCIndex-1,fPBCFeatures);
++        }
++    }
++
+     le_int32 getOutputIndex()
+     {
+@@ -723,4 +754,5 @@
+             }
+ 
++            
+             IndicClassTable::CharClass charClass = CC_RESERVED;
+             IndicClassTable::CharClass nextClass = CC_RESERVED;
+@@ -730,7 +762,9 @@
+             le_bool  seenVattu = FALSE;
+             le_bool  seenBelowBaseForm = FALSE;
++            le_bool  seenPreBaseForm = FALSE;
+             le_bool  hasNukta = FALSE;
+             le_bool  hasBelowBaseForm = FALSE;
+             le_bool  hasPostBaseForm = FALSE;
++            le_bool  hasPreBaseForm = FALSE;
+ 
+             if (postBase < markStart && classTable->isNukta(chars[postBase])) {
+@@ -746,12 +780,20 @@
+                 hasBelowBaseForm = IndicClassTable::hasBelowBaseForm(charClass) && !hasNukta;
+                 hasPostBaseForm  = IndicClassTable::hasPostBaseForm(charClass)  && !hasNukta;
++                hasPreBaseForm = IndicClassTable::hasPreBaseForm(charClass) && !hasNukta;
+ 
+                 if (IndicClassTable::isConsonant(charClass)) {
+                     if (postBaseLimit == 0 || seenVattu ||
+                         (baseConsonant > baseLimit && !classTable->isVirama(chars[baseConsonant - 1])) ||
+-                        !(hasBelowBaseForm || hasPostBaseForm)) {
++                        !(hasBelowBaseForm || hasPostBaseForm || hasPreBaseForm)) {
+                         break;
+                     }
+ 
++                    // Note any pre-base consonants
++                    if ( baseConsonant == lastConsonant && lastConsonant > 0 && 
++                         hasPreBaseForm && classTable->isVirama(chars[baseConsonant - 1])) {
++                        output.notePreBaseConsonant(lastConsonant,chars[lastConsonant],chars[lastConsonant-1],tagArray2);
++                        seenPreBaseForm = TRUE;
++   
++                    }
+                     // consonants with nuktas are never vattus
+                     seenVattu = IndicClassTable::isVattu(charClass) && !hasNukta;
+@@ -786,10 +828,12 @@
+ 
+             // write any pre-base consonants
++            output.writePreBaseConsonant();
++
+             le_bool supressVattu = TRUE;
+ 
+             for (i = baseLimit; i < baseConsonant; i += 1) {
+                 LEUnicode ch = chars[i];
+-                // Don't put 'blwf' on first consonant.
+-                FeatureMask features = (i == baseLimit? tagArray2 : tagArray1);
++                // Don't put 'pstf' or 'blwf' on anything before the base consonant.
++                FeatureMask features = tagArray1 & ~( pstfFeatureMask | blwfFeatureMask );
+ 
+                 charClass = classTable->getCharClass(ch);
+@@ -842,5 +886,5 @@
+ 
+             // write below-base consonants
+-            if (baseConsonant != lastConsonant) {
++            if (baseConsonant != lastConsonant && !seenPreBaseForm) {
+                 for (i = bcSpan + 1; i < postBase; i += 1) {
+                     output.writeChar(chars[i], i, tagArray1);
+@@ -872,5 +916,5 @@
+             // write post-base consonants
+             // FIXME: does this put the right tags on post-base consonants?
+-            if (baseConsonant != lastConsonant) {
++            if (baseConsonant != lastConsonant && !seenPreBaseForm) {
+                 if (postBase <= lastConsonant) {
+                     for (i = postBase; i <= lastConsonant; i += 1) {

Copied: icu/repos/testing-x86_64/PKGBUILD (from rev 282995, icu/trunk/PKGBUILD)
===================================================================
--- testing-x86_64/PKGBUILD	                        (rev 0)
+++ testing-x86_64/PKGBUILD	2016-12-10 08:32:40 UTC (rev 282996)
@@ -0,0 +1,55 @@
+# $Id$
+# Maintainer: Andreas Radke <andyrtr at archlinux.org>
+# Contributor: Art Gramlich <art at gramlich-net.com>
+
+pkgname=icu
+pkgver=58.2
+pkgrel=1
+pkgdesc="International Components for Unicode library"
+arch=(i686 x86_64)
+url="http://www.icu-project.org/"
+license=('custom:icu')
+depends=('gcc-libs>=4.7.1-5' 'sh')
+#makedepends=('clang')
+# no https available
+source=(#http://download.icu-project.org/files/${pkgname}4c/${pkgver}/${pkgname}4c-${pkgver/./_}-src.tgz
+	http://download.icu-project.org/files/${pkgname}4c/${pkgver}/${pkgname}4c-${pkgver//./_}-src.tgz
+	icu-58.1-iterator-reset.patch)
+#	icu.8198.revert.icu5431.patch)
+# upstream offers md5sum checks, only asc file for md5sum check
+md5sums=('fac212b32b7ec7ab007a12dff1f3aea1'
+         '8c09ae284967def053e9579d64d0f83c')
+#         'ebd5470fc969c75e52baf4af94a9ee82')
+
+prepare() {
+  cd icu/source
+
+# that file is no more present in current release, asume the bug to be fixed.
+#  # fix Malayalam encoding https://bugzilla.redhat.com/show_bug.cgi?id=654200
+#  patch -Rp3 -i ${srcdir}/icu.8198.revert.icu5431.patch
+
+  # http://bugs.icu-project.org/trac/ticket/12827
+  patch -Np4 -i ${srcdir}/icu-58.1-iterator-reset.patch
+}
+
+build() {
+  cd icu/source
+  ./configure --prefix=/usr \
+	--sysconfdir=/etc \
+	--mandir=/usr/share/man \
+	--sbindir=/usr/bin
+  make
+}
+
+check() {
+  cd icu/source
+  make -k check # passes all
+}
+
+package() {
+  cd icu/source
+  make -j1 DESTDIR=${pkgdir} install
+
+  # Install license
+  install -Dm644 ${srcdir}/icu/license.html ${pkgdir}/usr/share/licenses/icu/license.html
+}

Copied: icu/repos/testing-x86_64/icu-58.1-iterator-reset.patch (from rev 282995, icu/trunk/icu-58.1-iterator-reset.patch)
===================================================================
--- testing-x86_64/icu-58.1-iterator-reset.patch	                        (rev 0)
+++ testing-x86_64/icu-58.1-iterator-reset.patch	2016-12-10 08:32:40 UTC (rev 282996)
@@ -0,0 +1,124 @@
+Index: /icu/trunk/source/common/ulist.c
+===================================================================
+--- /icu/trunk/source/common/ulist.c	(revision 39483)
++++ /icu/trunk/source/common/ulist.c	(revision 39484)
+@@ -30,5 +30,4 @@
+     
+     int32_t size;
+-    int32_t currentIndex;
+ };
+ 
+@@ -52,5 +51,4 @@
+     newList->tail = NULL;
+     newList->size = 0;
+-    newList->currentIndex = -1;
+     
+     return newList;
+@@ -81,6 +79,7 @@
+         p->next->previous = p->previous;
+     }
+-    list->curr = NULL;
+-    list->currentIndex = 0;
++    if (p == list->curr) {
++        list->curr = p->next;
++    }
+     --list->size;
+     if (p->forceDelete) {
+@@ -151,5 +150,4 @@
+         list->head->previous = newItem;
+         list->head = newItem;
+-        list->currentIndex++;
+     }
+     
+@@ -194,5 +192,4 @@
+     curr = list->curr;
+     list->curr = curr->next;
+-    list->currentIndex++;
+     
+     return curr->data;
+@@ -210,5 +207,4 @@
+     if (list != NULL) {
+         list->curr = list->head;
+-        list->currentIndex = 0;
+     }
+ }
+@@ -273,3 +269,2 @@
+     return (UList *)(en->context);
+ }
+-
+Index: /icu/trunk/source/i18n/ucol_res.cpp
+===================================================================
+--- /icu/trunk/source/i18n/ucol_res.cpp	(revision 39483)
++++ /icu/trunk/source/i18n/ucol_res.cpp	(revision 39484)
+@@ -681,4 +681,5 @@
+     }
+     memcpy(en, &defaultKeywordValues, sizeof(UEnumeration));
++    ulist_resetList(sink.values);  // Initialize the iterator.
+     en->context = sink.values;
+     sink.values = NULL;  // Avoid deletion in the sink destructor.
+Index: /icu/trunk/source/test/intltest/apicoll.cpp
+===================================================================
+--- /icu/trunk/source/test/intltest/apicoll.cpp	(revision 39483)
++++ /icu/trunk/source/test/intltest/apicoll.cpp	(revision 39484)
+@@ -82,14 +82,7 @@
+     col = Collator::createInstance(Locale::getEnglish(), success);
+     if (U_FAILURE(success)){
+-        errcheckln(success, "Default Collator creation failed. - %s", u_errorName(success));
+-        return;
+-    }
+-
+-    StringEnumeration* kwEnum = col->getKeywordValuesForLocale("", Locale::getEnglish(),true,success);
+-    if (U_FAILURE(success)){
+-        errcheckln(success, "Get Keyword Values for Locale failed. - %s", u_errorName(success));
+-        return;
+-    }
+-    delete kwEnum;
++        errcheckln(success, "English Collator creation failed. - %s", u_errorName(success));
++        return;
++    }
+ 
+     col->getVersion(versionArray);
+@@ -230,4 +223,27 @@
+     delete aFrCol;
+     delete junk;
++}
++
++void CollationAPITest::TestKeywordValues() {
++    IcuTestErrorCode errorCode(*this, "TestKeywordValues");
++    LocalPointer<Collator> col(Collator::createInstance(Locale::getEnglish(), errorCode));
++    if (errorCode.logIfFailureAndReset("English Collator creation failed")) {
++        return;
++    }
++
++    LocalPointer<StringEnumeration> kwEnum(
++        col->getKeywordValuesForLocale("collation", Locale::getEnglish(), TRUE, errorCode));
++    if (errorCode.logIfFailureAndReset("Get Keyword Values for English Collator failed")) {
++        return;
++    }
++    assertTrue("expect at least one collation tailoring for English", kwEnum->count(errorCode) > 0);
++    const char *kw;
++    UBool hasStandard = FALSE;
++    while ((kw = kwEnum->next(NULL, errorCode)) != NULL) {
++        if (strcmp(kw, "standard") == 0) {
++            hasStandard = TRUE;
++        }
++    }
++    assertTrue("expect at least the 'standard' collation tailoring for English", hasStandard);
+ }
+ 
+@@ -2467,4 +2483,5 @@
+     TESTCASE_AUTO_BEGIN;
+     TESTCASE_AUTO(TestProperty);
++    TESTCASE_AUTO(TestKeywordValues);
+     TESTCASE_AUTO(TestOperators);
+     TESTCASE_AUTO(TestDuplicate);
+Index: /icu/trunk/source/test/intltest/apicoll.h
+===================================================================
+--- /icu/trunk/source/test/intltest/apicoll.h	(revision 39483)
++++ /icu/trunk/source/test/intltest/apicoll.h	(revision 39484)
+@@ -36,4 +36,5 @@
+      */
+     void TestProperty(/* char* par */);
++    void TestKeywordValues();
+ 
+     /**

Copied: icu/repos/testing-x86_64/icu.8198.revert.icu5431.patch (from rev 282995, icu/trunk/icu.8198.revert.icu5431.patch)
===================================================================
--- testing-x86_64/icu.8198.revert.icu5431.patch	                        (rev 0)
+++ testing-x86_64/icu.8198.revert.icu5431.patch	2016-12-10 08:32:40 UTC (rev 282996)
@@ -0,0 +1,129 @@
+Index: icu/trunk/source/layout/IndicReordering.cpp
+===================================================================
+--- icu/trunk/source/layout/IndicReordering.cpp	(revision 25772)
++++ icu/trunk/source/layout/IndicReordering.cpp	(revision 26090)
+@@ -126,4 +126,8 @@
+     FeatureMask fSMFeatures;
+ 
++    LEUnicode   fPreBaseConsonant;
++    LEUnicode   fPreBaseVirama;
++    le_int32    fPBCIndex;
++    FeatureMask fPBCFeatures;
+ 
+     void saveMatra(LEUnicode matra, le_int32 matraIndex, IndicClassTable::CharClass matraClass)
+@@ -172,5 +176,6 @@
+           fMatraFeatures(0), fMPreOutIndex(-1), fMPreFixups(mpreFixups),
+           fVMabove(0), fVMpost(0), fVMIndex(0), fVMFeatures(0),
+-          fSMabove(0), fSMbelow(0), fSMIndex(0), fSMFeatures(0)
++          fSMabove(0), fSMbelow(0), fSMIndex(0), fSMFeatures(0),
++          fPreBaseConsonant(0), fPreBaseVirama(0), fPBCIndex(0), fPBCFeatures(0)
+     {
+         // nothing else to do...
+@@ -191,4 +196,6 @@
+         fVMabove = fVMpost  = 0;
+         fSMabove = fSMbelow = 0;
++
++        fPreBaseConsonant = fPreBaseVirama = 0;
+     }
+ 
+@@ -386,4 +393,12 @@
+     }
+ 
++    void notePreBaseConsonant(le_uint32 index,LEUnicode PBConsonant, LEUnicode PBVirama, FeatureMask features)
++    {
++        fPBCIndex = index;
++        fPreBaseConsonant = PBConsonant;
++        fPreBaseVirama = PBVirama;
++        fPBCFeatures = features;
++    }
++
+     void noteBaseConsonant()
+     {
+@@ -465,4 +480,20 @@
+     }
+     
++    void writePreBaseConsonant()
++    {
++        // The TDIL spec says that consonant + virama + RRA should produce a rakar in Malayalam.  However,
++        // it seems that almost none of the fonts for Malayalam are set up to handle this.
++        // So, we're going to force the issue here by using the rakar as defined with RA in most fonts.
++
++        if (fPreBaseConsonant == 0x0d31) { // RRA
++            fPreBaseConsonant = 0x0d30; // RA
++        }
++        
++        if (fPreBaseConsonant != 0) {
++            writeChar(fPreBaseConsonant, fPBCIndex, fPBCFeatures);
++            writeChar(fPreBaseVirama,fPBCIndex-1,fPBCFeatures);
++        }
++    }
++
+     le_int32 getOutputIndex()
+     {
+@@ -723,4 +754,5 @@
+             }
+ 
++            
+             IndicClassTable::CharClass charClass = CC_RESERVED;
+             IndicClassTable::CharClass nextClass = CC_RESERVED;
+@@ -730,7 +762,9 @@
+             le_bool  seenVattu = FALSE;
+             le_bool  seenBelowBaseForm = FALSE;
++            le_bool  seenPreBaseForm = FALSE;
+             le_bool  hasNukta = FALSE;
+             le_bool  hasBelowBaseForm = FALSE;
+             le_bool  hasPostBaseForm = FALSE;
++            le_bool  hasPreBaseForm = FALSE;
+ 
+             if (postBase < markStart && classTable->isNukta(chars[postBase])) {
+@@ -746,12 +780,20 @@
+                 hasBelowBaseForm = IndicClassTable::hasBelowBaseForm(charClass) && !hasNukta;
+                 hasPostBaseForm  = IndicClassTable::hasPostBaseForm(charClass)  && !hasNukta;
++                hasPreBaseForm = IndicClassTable::hasPreBaseForm(charClass) && !hasNukta;
+ 
+                 if (IndicClassTable::isConsonant(charClass)) {
+                     if (postBaseLimit == 0 || seenVattu ||
+                         (baseConsonant > baseLimit && !classTable->isVirama(chars[baseConsonant - 1])) ||
+-                        !(hasBelowBaseForm || hasPostBaseForm)) {
++                        !(hasBelowBaseForm || hasPostBaseForm || hasPreBaseForm)) {
+                         break;
+                     }
+ 
++                    // Note any pre-base consonants
++                    if ( baseConsonant == lastConsonant && lastConsonant > 0 && 
++                         hasPreBaseForm && classTable->isVirama(chars[baseConsonant - 1])) {
++                        output.notePreBaseConsonant(lastConsonant,chars[lastConsonant],chars[lastConsonant-1],tagArray2);
++                        seenPreBaseForm = TRUE;
++   
++                    }
+                     // consonants with nuktas are never vattus
+                     seenVattu = IndicClassTable::isVattu(charClass) && !hasNukta;
+@@ -786,10 +828,12 @@
+ 
+             // write any pre-base consonants
++            output.writePreBaseConsonant();
++
+             le_bool supressVattu = TRUE;
+ 
+             for (i = baseLimit; i < baseConsonant; i += 1) {
+                 LEUnicode ch = chars[i];
+-                // Don't put 'blwf' on first consonant.
+-                FeatureMask features = (i == baseLimit? tagArray2 : tagArray1);
++                // Don't put 'pstf' or 'blwf' on anything before the base consonant.
++                FeatureMask features = tagArray1 & ~( pstfFeatureMask | blwfFeatureMask );
+ 
+                 charClass = classTable->getCharClass(ch);
+@@ -842,5 +886,5 @@
+ 
+             // write below-base consonants
+-            if (baseConsonant != lastConsonant) {
++            if (baseConsonant != lastConsonant && !seenPreBaseForm) {
+                 for (i = bcSpan + 1; i < postBase; i += 1) {
+                     output.writeChar(chars[i], i, tagArray1);
+@@ -872,5 +916,5 @@
+             // write post-base consonants
+             // FIXME: does this put the right tags on post-base consonants?
+-            if (baseConsonant != lastConsonant) {
++            if (baseConsonant != lastConsonant && !seenPreBaseForm) {
+                 if (postBase <= lastConsonant) {
+                     for (i = postBase; i <= lastConsonant; i += 1) {



More information about the arch-commits mailing list