summaryrefslogtreecommitdiff
path: root/Build/source/libs/icu
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/icu')
-rw-r--r--Build/source/libs/icu/icu-4.2.1-PATCHES/ChangeLog132
-rw-r--r--Build/source/libs/icu/icu-4.2.1-PATCHES/MakeShapingTypeData.pl90
-rw-r--r--Build/source/libs/icu/icu-4.2.1-PATCHES/TL-Changes15
-rwxr-xr-xBuild/source/libs/icu/icu-4.2.1-PATCHES/fix-case-insensitive25
-rw-r--r--Build/source/libs/icu/icu-4.2.1-PATCHES/patch-05-auxParam389
-rw-r--r--Build/source/libs/icu/icu-4.2.1-PATCHES/patch-07-cygwin16
-rw-r--r--Build/source/libs/icu/icu-4.2.1-PATCHES/patch-08-avoid-rebuild79
-rw-r--r--Build/source/libs/icu/icu-4.2.1-PATCHES/patch-09-cross22
-rw-r--r--Build/source/libs/icu/icu-4.2.1-PATCHES/patch-20-fix-gt_ge12
-rw-r--r--Build/source/libs/icu/icu-4.2.1-PATCHES/patch-21-fix-not_aligned21
-rw-r--r--Build/source/libs/icu/icu-4.2.1-PATCHES/patch-22-fix-JK-adjust_for_marks31
-rw-r--r--Build/source/libs/icu/icu-4.2.1-PATCHES/patch-23-fix-JK-GlyphPos56
-rw-r--r--Build/source/libs/icu/icu-4.2.1-PATCHES/patch-50-Vertical245
-rw-r--r--Build/source/libs/icu/icu-4.2.1-PATCHES/patch-60-KernPair61
-rw-r--r--Build/source/libs/icu/icu-4.2.1-PATCHES/patch-70-Arabic204
-rw-r--r--Build/source/libs/icu/icu-4.2.1-PATCHES/patch-80-Indic28
16 files changed, 1426 insertions, 0 deletions
diff --git a/Build/source/libs/icu/icu-4.2.1-PATCHES/ChangeLog b/Build/source/libs/icu/icu-4.2.1-PATCHES/ChangeLog
new file mode 100644
index 00000000000..359bd8c440a
--- /dev/null
+++ b/Build/source/libs/icu/icu-4.2.1-PATCHES/ChangeLog
@@ -0,0 +1,132 @@
+2009-10-28 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * patch-09-cross (new): Modify AC_CHECK_64BIT_LIBS in aclocal.m4
+ to allow cross compilation.
+
+2009-10-26 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * patch-08-avoid-rebuild (new): Modify data/Makefile.in such
+ that libsicudata.a is not rebuilt again and again.
+
+2009-10-25 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ Imported icu-4.2.1 source tree (icu4c-4_2_1-src.tgz) from:
+ http://download.icu-project.org/files/icu4c/4.2.1/
+
+ * patch-02-syntax, patch-40-Shaping (both removed): Obsolete.
+
+ * TL-Changes, patch-80-Indic: Adapted.
+
+2009-10-24 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ Imported icu-4.0.1 source tree (icu4c-4_0_1-src.tgz) from:
+ http://download.icu-project.org/files/icu4c/4.0.1/
+
+ * patch-01-backport-4.0.1, patch-01-too_much-4.0.1,
+ patch-06-build-fix, patch-06-partial-4.0.1,
+ patch-10-backport-4.0.1, patch-11-partial-4.0.1,
+ patch-99-test (all removed): Obsolete.
+
+ * TL-Changes, patch-40-Shaping, patch-80-Indic: Adapted.
+
+2009-10-23 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ Imported icu-3.8.1 source tree (icu4c-3_8_1-src.tgz) from:
+ http://download.icu-project.org/files/icu4c/3.8.1/
+
+ * TL-Changes (new): Description of modifications of source tree.
+
+ * fix-case-insensitive (new): Shell script used to rename
+ source/layout/Features.h => ICUFeatures.h (required for Cygwin)
+ and modify references to that file accordingly.
+
+ * patch-01-backport-4.0.1 (new): Replace layout/CanonData.cpp,
+ layout/GlyphPositionAdjustments.cpp,
+ layout/IndicReordering.{cpp,h}, layout/LELanguages.h,
+ layout/LESwaps.h, layout/OpenTypeLayoutEngine.cpp,
+ layout/ScriptAndLanguage.cpp, layout/ThaiLayoutEngine.{cpp,h},
+ layoutex/ParagraphLayout.cpp, and test/letest/sfnt.h by their
+ 4.0.1 versions.
+ * patch-01-too_much-4.0.1 (new): Undo one change in
+ layoutex/ParagraphLayout.cpp.
+
+ * patch-02-syntax (new): Fix some dubious syntax in
+ layoutex/ParagraphLayout.cpp.
+
+ * patch-05-auxParam (new): Handling of extension for XeTeX in
+ layout/AlternateSubstSubtables.cpp,
+ layout/GlyphIterator.{cpp,h},
+ layout/LEGlyphStorage.{cpp,h},
+ and layout/OpenTypeLayoutEngine.{cpp,h}.
+
+ * patch-06-build-fix (new): Build fix in common/ubidi.c.
+ * patch-06-partial-4.0.1 (new): Partial backport of common/putil.c
+ from 4.0.1.
+ * patch-07-cygwin (new): Changes in config/mh-cygwin (libraries
+ named as for everyone else).
+
+ * patch-10-backport-4.0.1 (new): Replace
+ layout/ScriptAndLanguageTags.{cpp,h} by their 4.0.1 versions.
+ * patch-11-partial-4.0.1 (new): Backport of some changes in
+ layout/LayoutEngine.cpp from 4.0.1.
+
+ Bug fixes originally by: Jonathan Kew <jfkthame@googlemail.com>
+ * patch-20-fix-gt_ge (new): In layout/ClassDefinitionTables.cpp.
+ * patch-21-fix-not_aligned (new): In layout/ExtensionSubtables.cpp.
+ * patch-22-fix-JK-adjust_for_marks (new): In
+ layout/MarkToBasePosnSubtables.cpp.
+ * patch-23-fix-JK-GlyphPos (new): In
+ layout/OpenTypeLayoutEngine.cpp.
+
+ * patch-40-Shaping (new): Update shaping type data in
+ layout/ShapingTypeData.cpp to Unicode 5.1.
+
+ * patch-50-Vertical (new): Handling vertical writing in
+ layout/LEFontInstance.h and layout/ValueRecords.cpp.
+
+ * patch-60-KernPair (new): Modified handling of kerns in
+ layout/LEFontInstance.{cpp,h} and layout/LayoutEngine.cpp.
+
+ * patch-70-Arabic (new): Add Draft Mongolian shaping classes
+ in layout/ArabicShaping.{cpp,h} and LayoutEngine.cpp.
+
+ * patch-80-Indic (new): Backport of some changes in
+ layout/IndicClassTables.cpp from 4.0.1 and in
+ layout/IndicReordering.cpp from 4.2.1.
+
+ * patch-99-test (new): Changes from TeX Live icu-xetex in
+ test/letest/PortableFontInstance.{cpp,h},
+ test/letest/gendata.{cpp,xml}, test/letest/letest.{cpp,xml}.
+
+ These modifications and patches of icu-3.8.1/ reproduce the
+ previous icu-xetex/ source tree (except for test data).
+
+2009-10-22 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ Slightly rearranged the icu-xetex/ source tree.
+
+ * layout/LELanguages.h: Changed some comments, from 4.0.1.
+
+ * layout/LEGlyphStorage.{cpp,h},
+ layout/OpenTypeLayoutEngine.cpp: Renamed adoptAuxDataArrays
+ back to adoptAuxDataArray as it was in 3.8.1.
+
+ * layout/LEGlyphStorage.h: The XeTeX modifications have added
+ an additional parameter for setAuxData, however, in most cases
+ the corresponding argument is NULL. Added an inline definition
+ of the original method.
+ layout/ArabicShaping.cpp, layout/HanLayoutEngine.cpp,
+ layout/HangulLayoutEngine.cpp, layout/IndicReordering.cpp,
+ layout/KhmerReordering.cpp, layout/LayoutEngine.cpp,
+ layout/TibetanReordering.cpp: Restored the original 3.8.1 use of
+ setAuxData without the additional argument NULL.
+
+ * data/Makefile.in: Restored 3.8.1 version, Autoconf >=2.61 ensures
+ a posix shell making, these changes obsolete.
+
+ * layout/ScriptAndLanguageTags.{cpp,h}: Backport from 4.0.1,
+ additional tags and changed comments.
+
+ * layout/OpenTypeLayoutEngine.cpp: Removed some obsolete code,
+ surrounded by #if 0...#endif.
+
diff --git a/Build/source/libs/icu/icu-4.2.1-PATCHES/MakeShapingTypeData.pl b/Build/source/libs/icu/icu-4.2.1-PATCHES/MakeShapingTypeData.pl
new file mode 100644
index 00000000000..e8e5a105082
--- /dev/null
+++ b/Build/source/libs/icu/icu-4.2.1-PATCHES/MakeShapingTypeData.pl
@@ -0,0 +1,90 @@
+#! /usr/bin/perl
+
+# script to create ShapingTypeData.cpp from UCD file DerivedJoiningType.txt
+# written by JK, 2007-01-16
+# This script may be distributed and used freely
+
+%types = (
+ 'C' => 1,
+ 'D' => 2,
+ 'R' => 4,
+ 'T' => 5
+);
+
+@ranges = ();
+
+sub addRange
+{
+ my ($s, $e, $t) = @_;
+
+ if ((scalar @ranges > 0)
+ && ($ranges[$#ranges]->[2] == $t)
+ && ($ranges[$#ranges]->[1] == $s - 1)) {
+ $ranges[$#ranges]->[1] = $e;
+ return;
+ }
+
+ push @ranges, [ $s, $e, $t ];
+}
+
+# read the DerivedJoiningType.txt file and remember all the ranges
+while (<>) {
+ if (m/^([0-9A-F]{4})\s+; ([CDRT]) \#/) {
+ # single codepoint
+ $start = hex $1;
+ $end = $start;
+ $type = $types{$2};
+ addRange($start, $end, $type);
+ next;
+ }
+ if (m/^([0-9A-F]{4})\.\.([0-9A-F]{4})\s+; ([CDRT]) \#/) {
+ # range of codes
+ $start = hex $1;
+ $end = hex $2;
+ $type = $types{$3};
+ addRange($start, $end, $type);
+ next;
+ }
+}
+
+# write the ShapingTypeData.cpp file
+
+$date = `date +"%F %T %Z"`;
+print <<__EOT__;
+/*
+ *
+ * (C) Copyright SIL International. 2007-2008.
+ * (C) Copyright IBM Corp. 1998-2005.
+ * Based on code distributed with ICU 3.6
+ * and the Unicode Character Database, version 5.1.0d10
+ *
+ * WARNING: THIS FILE IS MACHINE GENERATED. DO NOT HAND EDIT IT UNLESS
+ * YOU REALLY KNOW WHAT YOU'RE DOING.
+ *
+ * Generated on: $date
+ */
+
+#include "LETypes.h"
+#include "ArabicShaping.h"
+
+U_NAMESPACE_BEGIN
+
+const le_uint8 ArabicShaping::shapingTypeTable[] = {
+__EOT__
+
+printf " 0x%02X, 0x%02X, /* classFormat */\n", 0, 2;
+printf " 0x%02X, 0x%02X, /* classRangeCount */\n",
+ (scalar @ranges) / 256, (scalar @ranges) % 256;
+print join(",\n", map {
+ sprintf " 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X",
+ $_->[0] / 256, $_->[0] % 256,
+ $_->[1] / 256, $_->[1] % 256,
+ $_->[2] / 256, $_->[2] % 256,
+ } sort { $a->[0] <=> $b->[0] } @ranges);
+
+print <<__EOT__;
+
+};
+
+U_NAMESPACE_END
+__EOT__
diff --git a/Build/source/libs/icu/icu-4.2.1-PATCHES/TL-Changes b/Build/source/libs/icu/icu-4.2.1-PATCHES/TL-Changes
new file mode 100644
index 00000000000..b5affa2e3b6
--- /dev/null
+++ b/Build/source/libs/icu/icu-4.2.1-PATCHES/TL-Changes
@@ -0,0 +1,15 @@
+Changes applied to the icu-4.2.1/ tree as obtained from:
+ http://download.icu-project.org/files/icu4c/4.2.1/icu4c-4_2_1-src.tgz
+
+Rebuilt source/configure with Autoconf 2.63.
+
+Updated:
+ source/config.guess
+ source/config.sub
+ source/install-sh
+ source/mkinstalldirs
+
+Run the shell script fix-case-insensitive to rename
+ source/layout/Features.h => ICUFeatures.h
+and modify references to that file accordingly.
+
diff --git a/Build/source/libs/icu/icu-4.2.1-PATCHES/fix-case-insensitive b/Build/source/libs/icu/icu-4.2.1-PATCHES/fix-case-insensitive
new file mode 100755
index 00000000000..da968babade
--- /dev/null
+++ b/Build/source/libs/icu/icu-4.2.1-PATCHES/fix-case-insensitive
@@ -0,0 +1,25 @@
+#! /bin/sh
+#
+# On a case insensitive filesystem, e.g., in cygwin on a Win host, the
+# header name "Features.h" conflicts with "features.h" of GNU libc.
+#
+# A logical replacement would be "LEFeatures.h", however, that would
+# imply to install this header.
+#
+# Thus, this srcipt renames Features.h=>ICUFeatures.h and modifies
+# all occurences of that filename accordingly.
+
+file=`find -name Features.h`
+test -n "$file" || exit
+
+sed 's/__FEATURES_H/__ICUFEATURES_H/' $file >$file.tmp
+touch -r $file $file.tmp
+mv -f $file.tmp `echo $file | sed 's/Features.h/ICUFeatures.h/'`
+rm -f $file
+
+
+for file in `grep -rl 'Features\.h' .`; do
+ sed 's/\([\\"]\)Features\.h/\1ICUFeatures.h/' $file >$file.tmp
+ touch -r $file $file.tmp
+ mv -f $file.tmp $file
+done
diff --git a/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-05-auxParam b/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-05-auxParam
new file mode 100644
index 00000000000..c68d525e3e3
--- /dev/null
+++ b/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-05-auxParam
@@ -0,0 +1,389 @@
+diff -ur icu-4.2.1.orig/source/layout/AlternateSubstSubtables.cpp icu-4.2.1/source/layout/AlternateSubstSubtables.cpp
+--- icu-4.2.1.orig/source/layout/AlternateSubstSubtables.cpp 2009-07-01 20:51:24.000000000 +0200
++++ icu-4.2.1/source/layout/AlternateSubstSubtables.cpp 2009-10-23 00:00:56.000000000 +0200
+@@ -27,13 +27,20 @@
+ Offset alternateSetTableOffset = SWAPW(alternateSetTableOffsetArray[coverageIndex]);
+ const AlternateSetTable *alternateSetTable =
+ (const AlternateSetTable *) ((char *) this + alternateSetTableOffset);
+- TTGlyphID alternate = SWAPW(alternateSetTable->alternateArray[0]);
++ le_int32 altIndex = glyphIterator->getFeatureParam();
+
+- if (filter == NULL || filter->accept(LE_SET_GLYPH(glyph, alternate))) {
+- glyphIterator->setCurrGlyphID(SWAPW(alternateSetTable->alternateArray[0]));
++ if (altIndex < SWAPW(alternateSetTable->glyphCount)) {
++ TTGlyphID alternate = SWAPW(alternateSetTable->alternateArray[altIndex]);
++
++ if (filter == NULL || filter->accept(LE_SET_GLYPH(glyph, alternate))) {
++ glyphIterator->setCurrGlyphID(alternate);
++ }
++
++ return 1;
+ }
+-
+- return 1;
++
++ // feature param was out of range for the glyph
++ return 0;
+ }
+
+ // XXXX If we get here, the table's mal-formed...
+diff -ur icu-4.2.1.orig/source/layout/GlyphIterator.cpp icu-4.2.1/source/layout/GlyphIterator.cpp
+--- icu-4.2.1.orig/source/layout/GlyphIterator.cpp 2009-07-01 20:51:24.000000000 +0200
++++ icu-4.2.1/source/layout/GlyphIterator.cpp 2009-10-23 00:00:56.000000000 +0200
+@@ -19,7 +19,7 @@
+ FeatureMask theFeatureMask, const GlyphDefinitionTableHeader *theGlyphDefinitionTableHeader)
+ : direction(1), position(-1), nextLimit(-1), prevLimit(-1),
+ glyphStorage(theGlyphStorage), glyphPositionAdjustments(theGlyphPositionAdjustments),
+- srcIndex(-1), destIndex(-1), lookupFlags(theLookupFlags), featureMask(theFeatureMask), glyphGroup(0),
++ srcIndex(-1), destIndex(-1), lookupFlags(theLookupFlags), featureMask(theFeatureMask), featureParam(0), glyphGroup(0),
+ glyphClassDefinitionTable(NULL), markAttachClassDefinitionTable(NULL)
+
+ {
+@@ -53,12 +53,13 @@
+ destIndex = that.destIndex;
+ lookupFlags = that.lookupFlags;
+ featureMask = that.featureMask;
++ featureParam = that.featureParam;
+ glyphGroup = that.glyphGroup;
+ glyphClassDefinitionTable = that.glyphClassDefinitionTable;
+ markAttachClassDefinitionTable = that.markAttachClassDefinitionTable;
+ }
+
+-GlyphIterator::GlyphIterator(GlyphIterator &that, FeatureMask newFeatureMask)
++GlyphIterator::GlyphIterator(GlyphIterator &that, FeatureMask newFeatureMask, le_int32 newFeatureParam)
+ : glyphStorage(that.glyphStorage)
+ {
+ direction = that.direction;
+@@ -71,6 +72,7 @@
+ destIndex = that.destIndex;
+ lookupFlags = that.lookupFlags;
+ featureMask = newFeatureMask;
++ featureParam = newFeatureParam;
+ glyphGroup = 0;
+ glyphClassDefinitionTable = that.glyphClassDefinitionTable;
+ markAttachClassDefinitionTable = that.markAttachClassDefinitionTable;
+@@ -89,6 +91,7 @@
+ destIndex = that.destIndex;
+ lookupFlags = newLookupFlags;
+ featureMask = that.featureMask;
++ featureParam = that.featureParam;
+ glyphGroup = that.glyphGroup;
+ glyphClassDefinitionTable = that.glyphClassDefinitionTable;
+ markAttachClassDefinitionTable = that.markAttachClassDefinitionTable;
+@@ -103,6 +106,7 @@
+ {
+ position = prevLimit;
+ featureMask = newFeatureMask;
++ featureParam = 0;
+ glyphGroup = 0;
+ lookupFlags = newLookupFlags;
+ }
+@@ -130,6 +134,11 @@
+ return position;
+ }
+
++le_int32 GlyphIterator::getFeatureParam() const
++{
++ return featureParam;
++}
++
+ le_bool GlyphIterator::isRightToLeft() const
+ {
+ return direction < 0;
+@@ -400,8 +409,10 @@
+ }
+ }
+
+-le_bool GlyphIterator::hasFeatureTag(le_bool matchGroup) const
++le_bool GlyphIterator::hasFeatureTag(le_bool matchGroup)
+ {
++ featureParam = 0;
++
+ if (featureMask == 0) {
+ return TRUE;
+ }
+@@ -409,7 +420,20 @@
+ LEErrorCode success = LE_NO_ERROR;
+ FeatureMask fm = glyphStorage.getAuxData(position, success);
+
+- return ((fm & featureMask) == featureMask) && (!matchGroup || (le_int32)(fm & LE_GLYPH_GROUP_MASK) == glyphGroup);
++ if (((fm & featureMask) == featureMask) && (!matchGroup || (le_int32)(fm & LE_GLYPH_GROUP_MASK) == glyphGroup)) {
++ const le_int32 *paramList = (const le_int32 *) glyphStorage.getAuxParam(position, success);
++ if (paramList != NULL) {
++ fm = featureMask;
++ while ((fm & 0x80000000UL) == 0) {
++ ++paramList;
++ fm <<= 1;
++ }
++ featureParam = *paramList;
++ }
++ return TRUE;
++ }
++
++ return FALSE;
+ }
+
+ le_bool GlyphIterator::findFeatureTag()
+diff -ur icu-4.2.1.orig/source/layout/GlyphIterator.h icu-4.2.1/source/layout/GlyphIterator.h
+--- icu-4.2.1.orig/source/layout/GlyphIterator.h 2009-07-01 20:51:26.000000000 +0200
++++ icu-4.2.1/source/layout/GlyphIterator.h 2009-10-23 00:00:56.000000000 +0200
+@@ -28,7 +28,7 @@
+
+ GlyphIterator(GlyphIterator &that);
+
+- GlyphIterator(GlyphIterator &that, FeatureMask newFeatureMask);
++ GlyphIterator(GlyphIterator &that, FeatureMask newFeatureMask, le_int32 featureParam = 0);
+
+ GlyphIterator(GlyphIterator &that, le_uint16 newLookupFlags);
+
+@@ -51,6 +51,8 @@
+ le_int32 getMarkComponent(le_int32 markPosition) const;
+ le_bool findMark2Glyph();
+
++ le_int32 getFeatureParam() const;
++
+ void getCursiveEntryPoint(LEPoint &entryPoint) const;
+ void getCursiveExitPoint(LEPoint &exitPoint) const;
+
+@@ -74,7 +76,7 @@
+
+ private:
+ le_bool filterGlyph(le_uint32 index) const;
+- le_bool hasFeatureTag(le_bool matchGroup) const;
++ le_bool hasFeatureTag(le_bool matchGroup); /* not const because it updates the featureParam field */
+ le_bool nextInternal(le_uint32 delta = 1);
+ le_bool prevInternal(le_uint32 delta = 1);
+
+@@ -92,6 +94,7 @@
+ FeatureMask featureMask;
+ le_int32 glyphGroup;
+
++ le_int32 featureParam;
+ const GlyphClassDefinitionTable *glyphClassDefinitionTable;
+ const MarkAttachClassDefinitionTable *markAttachClassDefinitionTable;
+
+diff -ur icu-4.2.1.orig/source/layout/LEGlyphStorage.cpp icu-4.2.1/source/layout/LEGlyphStorage.cpp
+--- icu-4.2.1.orig/source/layout/LEGlyphStorage.cpp 2009-07-01 20:51:26.000000000 +0200
++++ icu-4.2.1/source/layout/LEGlyphStorage.cpp 2009-10-23 00:00:56.000000000 +0200
+@@ -20,7 +20,7 @@
+
+ LEGlyphStorage::LEGlyphStorage()
+ : fGlyphCount(0), fGlyphs(NULL), fCharIndices(NULL), fPositions(NULL),
+- fAuxData(NULL), fInsertionList(NULL), fSrcIndex(0), fDestIndex(0)
++ fAuxData(NULL), fAuxParam(NULL), fInsertionList(NULL), fSrcIndex(0), fDestIndex(0)
+ {
+ // nothing else to do!
+ }
+@@ -44,6 +44,11 @@
+ fAuxData = NULL;
+ }
+
++ if (fAuxParam != NULL) {
++ LE_DELETE_ARRAY(fAuxParam);
++ fAuxParam = NULL;
++ }
++
+ if (fInsertionList != NULL) {
+ delete fInsertionList;
+ fInsertionList = NULL;
+@@ -151,14 +156,15 @@
+ return -1;
+ }
+
+- if (fAuxData != NULL) {
++ if (fAuxData != NULL || fAuxParam != NULL) {
+ success = LE_INTERNAL_ERROR;
+ return -1;
+ }
+
+ fAuxData = LE_NEW_ARRAY(le_uint32, fGlyphCount);
++ fAuxParam = LE_NEW_ARRAY(void *, fGlyphCount);
+
+- if (fAuxData == NULL) {
++ if (fAuxData == NULL || fAuxParam == NULL) {
+ success = LE_MEMORY_ALLOCATION_ERROR;
+ return -1;
+ }
+@@ -365,13 +371,32 @@
+ return fAuxData[glyphIndex];
+ }
+
+-void LEGlyphStorage::setAuxData(le_int32 glyphIndex, le_uint32 auxData, LEErrorCode &success)
++void *LEGlyphStorage::getAuxParam(le_int32 glyphIndex, LEErrorCode &success) const
++{
++ if (LE_FAILURE(success)) {
++ return NULL;
++ }
++
++ if (fAuxParam == NULL) {
++ success = LE_NO_LAYOUT_ERROR;
++ return NULL;
++ }
++
++ if (glyphIndex < 0 || glyphIndex >= fGlyphCount) {
++ success = LE_INDEX_OUT_OF_BOUNDS_ERROR;
++ return NULL;
++ }
++
++ return fAuxParam[glyphIndex];
++}
++
++void LEGlyphStorage::setAuxData(le_int32 glyphIndex, le_uint32 auxData, void *auxParam, LEErrorCode &success)
+ {
+ if (LE_FAILURE(success)) {
+ return;
+ }
+
+- if (fAuxData == NULL) {
++ if (fAuxData == NULL || fAuxParam == NULL) {
+ success = LE_NO_LAYOUT_ERROR;
+ return;
+ }
+@@ -382,6 +407,7 @@
+ }
+
+ fAuxData[glyphIndex] = auxData;
++ fAuxParam[glyphIndex] = auxParam;
+ }
+
+ void LEGlyphStorage::getGlyphPositions(float positions[], LEErrorCode &success) const
+@@ -496,8 +522,14 @@
+ LE_DELETE_ARRAY(fAuxData);
+ }
+
++ if (fAuxParam != NULL) {
++ LE_DELETE_ARRAY(fAuxParam);
++ }
++
+ fAuxData = from.fAuxData;
+ from.fAuxData = NULL;
++ fAuxParam = from.fAuxParam;
++ from.fAuxParam = NULL;
+ }
+
+ void LEGlyphStorage::adoptGlyphCount(LEGlyphStorage &from)
+@@ -590,6 +622,10 @@
+ fGlyphs = newGlyphs;
+ fCharIndices = newCharIndices;
+
++ if (fAuxParam != NULL) {
++ fAuxParam = (void **) LE_GROW_ARRAY(fAuxParam, newGlyphCount);
++ }
++
+ fSrcIndex = fGlyphCount - 1;
+ fDestIndex = newGlyphCount - 1;
+
+@@ -642,6 +678,18 @@
+ }
+ }
+
++ if (fAuxParam != NULL) {
++ le_int32 src = fSrcIndex, dest = fDestIndex;
++
++ while (src > atPosition) {
++ fAuxParam[dest--] = fAuxParam[src--];
++ }
++
++ for (le_int32 i = count - 1; i >= 0; i -= 1) {
++ fAuxParam[dest--] = fAuxParam[atPosition];
++ }
++ }
++
+ while (fSrcIndex > atPosition) {
+ fGlyphs[fDestIndex] = fGlyphs[fSrcIndex];
+ fCharIndices[fDestIndex] = fCharIndices[fSrcIndex];
+diff -ur icu-4.2.1.orig/source/layout/LEGlyphStorage.h icu-4.2.1/source/layout/LEGlyphStorage.h
+--- icu-4.2.1.orig/source/layout/LEGlyphStorage.h 2009-07-01 20:51:24.000000000 +0200
++++ icu-4.2.1/source/layout/LEGlyphStorage.h 2009-10-23 00:00:56.000000000 +0200
+@@ -63,12 +63,12 @@
+ float *fPositions;
+
+ /**
+- * The auxillary data array.
++ * The auxiliary data arrays.
+ *
+ * @internal
+ */
+ le_uint32 *fAuxData;
+-
++ void **fAuxParam;
+
+ /**
+ * The insertion list, used to grow the above arrays.
+@@ -299,6 +299,7 @@
+ * @stable ICU 3.6
+ */
+ le_uint32 getAuxData(le_int32 glyphIndex, LEErrorCode &success) const;
++ void *getAuxParam(le_int32 glyphIndex, LEErrorCode &success) const;
+
+ /**
+ * This operator allows direct access to the glyph array
+@@ -428,15 +429,20 @@
+ void adjustPosition(le_int32 glyphIndex, float xAdjust, float yAdjust, LEErrorCode &success);
+
+ /**
+- * Set the auxillary data for a particular glyph.
++ * Set the auxiliary data for a particular glyph.
+ *
+ * @param glyphIndex the index of the glyph
+- * @param auxData the new auxillary data
+- * @param success will be set to an error code if the auxillary data cannot be set.
++ * @param auxData the new auxiliary data
++ * @param auxParam the new secondary auxiliary data (parameter)
++ * @param success will be set to an error code if the auxiliary data cannot be set.
+ *
+- * @stable ICU 3.6
++ * @stable ICU 3.6 - mod for XeTeX
++ */
++ void setAuxData(le_int32 glyphIndex, le_uint32 auxData, void *auxParam, LEErrorCode &success);
++ /**
++ * The common case when @param auxParam is <code>NULL</code>.
+ */
+- void setAuxData(le_int32 glyphIndex, le_uint32 auxData, LEErrorCode &success);
++ inline void setAuxData(le_int32 glyphIndex, le_uint32 auxData, LEErrorCode &success);
+
+ /**
+ * Delete the glyph array and replace it with the one
+@@ -541,6 +547,10 @@
+ return fGlyphs[glyphIndex];
+ }
+
++inline void LEGlyphStorage::setAuxData(le_int32 glyphIndex, le_uint32 auxData, LEErrorCode &success)
++{
++ setAuxData(glyphIndex, auxData, NULL, success);
++}
+
+ U_NAMESPACE_END
+ #endif
+diff -ur icu-4.2.1.orig/source/layout/OpenTypeLayoutEngine.cpp icu-4.2.1/source/layout/OpenTypeLayoutEngine.cpp
+--- icu-4.2.1.orig/source/layout/OpenTypeLayoutEngine.cpp 2009-07-01 20:51:24.000000000 +0200
++++ icu-4.2.1/source/layout/OpenTypeLayoutEngine.cpp 2009-10-23 00:04:31.000000000 +0200
+@@ -73,7 +73,7 @@
+ OpenTypeLayoutEngine::OpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode,
+ le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable, LEErrorCode &success)
+ : LayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, success), fFeatureMask(minimalFeatures),
+- fFeatureMap(featureMap), fFeatureMapCount(featureMapCount), fFeatureOrder(FALSE),
++ fFeatureMap(featureMap), fFeatureParamList(NULL), fFeatureMapCount(featureMapCount), fFeatureOrder(FALSE),
+ fGSUBTable(gsubTable), fGDEFTable(NULL), fGPOSTable(NULL), fSubstitutionFilter(NULL)
+ {
+ static const le_uint32 gdefTableTag = LE_GDEF_TABLE_TAG;
+@@ -200,7 +200,7 @@
+ glyphStorage.allocateAuxData(success);
+
+ for (le_int32 i = 0; i < count; i += 1) {
+- glyphStorage.setAuxData(i, fFeatureMask, success);
++ glyphStorage.setAuxData(i, fFeatureMask, (void *) fFeatureParamList, success);
+ }
+
+ return count;
+diff -ur icu-4.2.1.orig/source/layout/OpenTypeLayoutEngine.h icu-4.2.1/source/layout/OpenTypeLayoutEngine.h
+--- icu-4.2.1.orig/source/layout/OpenTypeLayoutEngine.h 2009-07-01 20:51:24.000000000 +0200
++++ icu-4.2.1/source/layout/OpenTypeLayoutEngine.h 2009-10-23 00:00:56.000000000 +0200
+@@ -176,6 +176,7 @@
+ * @internal
+ */
+ const FeatureMap *fFeatureMap;
++ const le_int32 *fFeatureParamList;
+
+ /**
+ * The length of the feature map.
diff --git a/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-07-cygwin b/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-07-cygwin
new file mode 100644
index 00000000000..540b413dc18
--- /dev/null
+++ b/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-07-cygwin
@@ -0,0 +1,16 @@
+ We don't want this for TeX Live.
+
+diff -ur icu-4.2.1.orig/source/config/mh-cygwin icu-4.2.1/source/config/mh-cygwin
+--- icu-4.2.1.orig/source/config/mh-cygwin 2009-07-01 20:50:48.000000000 +0200
++++ icu-4.2.1/source/config/mh-cygwin 2009-10-22 23:26:13.000000000 +0200
+@@ -55,10 +55,6 @@
+ ## To have an import library is better on Cygwin
+ IMPORT_LIB_EXT = .dll.a
+
+-# Change the stubnames so that poorly working FAT disks and installation programs can work.
+-# This is also for backwards compatibility.
+-DATA_STUBNAME = dt
+-I18N_STUBNAME = in
+
+ ## Compilation rules
+ %.$(STATIC_O): $(srcdir)/%.c
diff --git a/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-08-avoid-rebuild b/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-08-avoid-rebuild
new file mode 100644
index 00000000000..9c722e2081e
--- /dev/null
+++ b/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-08-avoid-rebuild
@@ -0,0 +1,79 @@
+ Avoid to rebuild libsicudata.a again and again.
+
+diff -ur icu-4.2.1.orig/source/data/Makefile.in icu-4.2.1/source/data/Makefile.in
+--- icu-4.2.1.orig/source/data/Makefile.in 2009-07-01 20:51:20.000000000 +0200
++++ icu-4.2.1/source/data/Makefile.in 2009-10-26 12:10:19.000000000 +0100
+@@ -90,7 +90,7 @@
+ .PHONY : all all-local all-recursive install install-local install-files \
+ install-recursive clean clean-local clean-recursive distclean \
+ distclean-local distclean-recursive dist dist-local dist-recursive \
+-check check-local check-recursive build-local clean-resindex build-dir
++check check-local check-recursive clean-resindex
+
+ ## Clear suffix list
+ .SUFFIXES :
+@@ -115,6 +115,7 @@
+ -test -z *.map || $(RMV) *.map
+
+ clean-local: cleanpackage cleanfiles clean-map
++ $(RMV) build-dir* build-local packagedata uni-core-data
+
+ cleanfiles:
+ test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
+@@ -159,6 +160,7 @@
+ else
+ $(INSTALL_DATA) $(ICUDATA_SOURCE_ARCHIVE) $(OUTDIR)
+ endif
++ echo timestamp > $@
+
+ ## Install ICU data.
+ install-local: $(PKGDATA_LIST) ./icupkg.inc packagedata $(OS390INSTALL)
+@@ -345,6 +347,7 @@
+ ifneq ($(INCLUDE_UNI_CORE_DATA),)
+ ALL_FILES_LIST+=$(UNI_CORE_DATA)
+ build-local: uni-core-data
++ echo timestamp > $@
+ endif
+
+ #####################################################
+@@ -355,6 +358,7 @@
+
+ ifeq ($(ICUDATA_SOURCE_ARCHIVE),)
+ build-local: build-dir $(SO_VERSION_DATA) $(ALL_FILES) $(PKGDATA_LIST) $(OS390LIST)
++ echo timestamp > $@
+ $(PKGDATA_LIST): $(SRCLISTDEPS)
+ @echo "generating $@ (list of data files)"
+ @-$(RMV) $@
+@@ -363,6 +367,7 @@
+ done;
+ else
+ build-local: build-dir $(SO_VERSION_DATA) $(PKGDATA_LIST) $(OS390LIST)
++ echo timestamp > $@
+ $(PKGDATA_LIST): $(SRCLISTDEPS) $(ICUDATA_SOURCE_ARCHIVE)
+ ifneq ($(ICUDATA_SOURCE_IS_NATIVE_TARGET),YES)
+ @echo "Unpacking $(ICUDATA_SOURCE_ARCHIVE) and generating $@ (list of data files)"
+@@ -377,6 +382,8 @@
+ $(BUILD_DIRS): build-dir
+
+ build-dir:
++ @-$(RMV) $@
++ echo timestamp > $@.tmp
+ @list='$(BUILD_DIRS)'; \
+ for dir in $$list; do \
+ if ! test -d $$dir; then \
+@@ -384,6 +391,7 @@
+ $(MKINSTALLDIRS) $(BUILD_DIRS); \
+ fi; \
+ done
++ mv $@.tmp $@
+
+ # The | is an order-only prerequisite. This helps when the -j option is used,
+ # and we don't want the files to be built before the directories are built.
+@@ -599,6 +607,7 @@
+ uni-core-data: build-dir $(UNI_CORE_TARGET_DATA)
+ @echo Unicode .icu files built to $(BUILDDIR)
+ @echo Unicode .c source files built to $(OUTTMPDIR)
++ echo timestamp > $@
+
+ build-icu4j: all
+ $(MAKE) -C ../tools/genrb $@
diff --git a/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-09-cross b/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-09-cross
new file mode 100644
index 00000000000..db9d037a273
--- /dev/null
+++ b/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-09-cross
@@ -0,0 +1,22 @@
+ Replace AC_RUN_IFELSE by AC_CHECK_SIZEOF for cross compilation.
+
+diff -ur icu-4.2.1.orig/source/aclocal.m4 icu-4.2.1/source/aclocal.m4
+--- icu-4.2.1.orig/source/aclocal.m4 2009-07-01 20:51:26.000000000 +0200
++++ icu-4.2.1/source/aclocal.m4 2009-10-28 20:38:09.000000000 +0100
+@@ -149,10 +149,13 @@
+ if test "$cross_compiling" = "yes" -a "${BITS_REQ}" != "nochange"; then
+ AC_MSG_ERROR([Don't specify bitness when cross compiling. See readme.html for help with cross compilation., and set compiler options manually.])
+ fi
+- DEFAULT_64BIT=no
++ AC_CHECK_SIZEOF([void *])
+ AC_MSG_CHECKING([whether runnable 64 bit binaries are built by default])
+- AC_RUN_IFELSE(int main(void) {return (sizeof(void*)*8==64)?0:1;},
+- DEFAULT_64BIT=yes, DEFAULT_64BIT=no, DEFAULT_64BIT=unknown)
++ case $ac_cv_sizeof_void_p in
++ 8) DEFAULT_64BIT=yes ;;
++ 4) DEFAULT_64BIT=no ;;
++ *) DEFAULT_64BIT=unknown
++ esac
+ BITS_GOT=unknown
+
+ # 'OK' here means, we can exit any further checking, everything's copa
diff --git a/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-20-fix-gt_ge b/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-20-fix-gt_ge
new file mode 100644
index 00000000000..445aa07d7e5
--- /dev/null
+++ b/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-20-fix-gt_ge
@@ -0,0 +1,12 @@
+diff -ur icu-4.2.1.orig/source/layout/ClassDefinitionTables.cpp icu-4.2.1/source/layout/ClassDefinitionTables.cpp
+--- icu-4.2.1.orig/source/layout/ClassDefinitionTables.cpp 2009-07-01 20:51:26.000000000 +0200
++++ icu-4.2.1/source/layout/ClassDefinitionTables.cpp 2009-10-22 23:15:27.000000000 +0200
+@@ -68,7 +68,7 @@
+ TTGlyphID firstGlyph = SWAPW(startGlyph);
+ TTGlyphID lastGlyph = firstGlyph + SWAPW(glyphCount);
+
+- if (ttGlyphID > firstGlyph && ttGlyphID < lastGlyph) {
++ if (ttGlyphID >= firstGlyph && ttGlyphID < lastGlyph) {
+ return SWAPW(classValueArray[ttGlyphID - firstGlyph]);
+ }
+
diff --git a/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-21-fix-not_aligned b/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-21-fix-not_aligned
new file mode 100644
index 00000000000..9842c6d92d9
--- /dev/null
+++ b/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-21-fix-not_aligned
@@ -0,0 +1,21 @@
+diff -ur icu-4.2.1.orig/source/layout/ExtensionSubtables.cpp icu-4.2.1/source/layout/ExtensionSubtables.cpp
+--- icu-4.2.1.orig/source/layout/ExtensionSubtables.cpp 2009-07-01 20:51:24.000000000 +0200
++++ icu-4.2.1/source/layout/ExtensionSubtables.cpp 2009-10-22 23:17:59.000000000 +0200
+@@ -15,6 +15,8 @@
+
+ U_NAMESPACE_BEGIN
+
++// read a 32-bit value that might only be 16-bit-aligned in memory
++#define READ_LONG(code) (le_uint32)((SWAPW(*(le_uint16*)&code) << 16) + SWAPW(*(((le_uint16*)&code) + 1)))
+
+ // FIXME: should look at the format too... maybe have a sub-class for it?
+ le_uint32 ExtensionSubtable::process(const LookupProcessor *lookupProcessor, le_uint16 lookupType,
+@@ -27,7 +29,7 @@
+ le_uint16 elt = SWAPW(extensionLookupType);
+
+ if (elt != lookupType) {
+- le_uint32 extOffset = SWAPL(extensionOffset);
++ le_uint32 extOffset = READ_LONG(extensionOffset);
+ LookupSubtable *subtable = (LookupSubtable *) ((char *) this + extOffset);
+
+ return lookupProcessor->applySubtable(subtable, elt, glyphIterator, fontInstance, success);
diff --git a/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-22-fix-JK-adjust_for_marks b/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-22-fix-JK-adjust_for_marks
new file mode 100644
index 00000000000..4c4119de776
--- /dev/null
+++ b/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-22-fix-JK-adjust_for_marks
@@ -0,0 +1,31 @@
+diff -ur icu-4.2.1.orig/source/layout/MarkToBasePosnSubtables.cpp icu-4.2.1/source/layout/MarkToBasePosnSubtables.cpp
+--- icu-4.2.1.orig/source/layout/MarkToBasePosnSubtables.cpp 2009-07-01 20:51:24.000000000 +0200
++++ icu-4.2.1/source/layout/MarkToBasePosnSubtables.cpp 2009-10-22 23:46:21.000000000 +0200
+@@ -83,11 +83,27 @@
+ glyphIterator->setCurrGlyphBaseOffset(baseIterator.getCurrStreamPosition());
+
+ if (glyphIterator->isRightToLeft()) {
++ ///// FIXME: need similar patch to below; also in MarkToLigature and MarkToMark
++ ///// (is there a better way to approach this for all the cases?)
+ glyphIterator->setCurrGlyphPositionAdjustment(anchorDiffX, anchorDiffY, -markAdvance.fX, -markAdvance.fY);
+ } else {
+ LEPoint baseAdvance;
+
+ fontInstance->getGlyphAdvance(baseGlyph, pixels);
++
++ ///// JK: adjustment needs to account for non-zero advance of any marks between base glyph and current mark
++ GlyphIterator gi(baseIterator, (le_uint16)0); // copy of baseIterator that won't ignore marks
++ gi.next(); // point beyond the base glyph
++ while (gi.getCurrStreamPosition() < glyphIterator->getCurrStreamPosition()) { // for all intervening glyphs (marks)...
++ LEGlyphID otherMark = gi.getCurrGlyphID();
++ LEPoint px;
++ fontInstance->getGlyphAdvance(otherMark, px); // get advance, in case it's non-zero
++ pixels.fX += px.fX; // and add that to the base glyph's advance
++ pixels.fY += px.fY;
++ gi.next();
++ }
++ ///// end of JK patch
++
+ fontInstance->pixelsToUnits(pixels, baseAdvance);
+
+ glyphIterator->setCurrGlyphPositionAdjustment(anchorDiffX - baseAdvance.fX, anchorDiffY - baseAdvance.fY, -markAdvance.fX, -markAdvance.fY);
diff --git a/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-23-fix-JK-GlyphPos b/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-23-fix-JK-GlyphPos
new file mode 100644
index 00000000000..192e6f84627
--- /dev/null
+++ b/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-23-fix-JK-GlyphPos
@@ -0,0 +1,56 @@
+diff -ur icu-4.2.1.orig/source/layout/OpenTypeLayoutEngine.cpp icu-4.2.1/source/layout/OpenTypeLayoutEngine.cpp
+--- icu-4.2.1.orig/source/layout/OpenTypeLayoutEngine.cpp 2009-10-23 00:04:31.000000000 +0200
++++ icu-4.2.1/source/layout/OpenTypeLayoutEngine.cpp 2009-10-23 00:09:47.000000000 +0200
+@@ -96,8 +96,10 @@
+ setScriptAndLanguageTags();
+
+ fGDEFTable = (const GlyphDefinitionTableHeader *) getFontTable(gdefTableTag);
+-
+- if (gposTable != NULL && gposTable->coversScriptAndLanguage(fScriptTag, fLangSysTag)) {
++
++// JK patch, 2008-05-30 - see Sinhala bug report and LKLUG font
++// if (gposTable != NULL && gposTable->coversScriptAndLanguage(fScriptTag, fLangSysTag)) {
++ if (gposTable != NULL && gposTable->coversScript(fScriptTag)) {
+ fGPOSTable = gposTable;
+ }
+ }
+@@ -193,8 +195,16 @@
+ return 0;
+ }
+
++ if (LE_FAILURE(success)) {
++ LE_DELETE_ARRAY(outChars);
++ return 0;
++ }
++
+ CanonShaping::reorderMarks(&chars[offset], count, rightToLeft, outChars, glyphStorage);
+ }
++ if (LE_FAILURE(success)) {
++ return 0;
++ }
+
+ glyphStorage.allocateGlyphArray(count, rightToLeft, success);
+ glyphStorage.allocateAuxData(success);
+@@ -333,8 +343,10 @@
+ }
+
+ le_int32 glyphCount = glyphStorage.getGlyphCount();
++ if (glyphCount == 0)
++ return;
+
+- if (glyphCount > 0 && fGPOSTable != NULL) {
++ if (fGPOSTable != NULL) {
+ GlyphPositionAdjustments *adjustments = new GlyphPositionAdjustments(glyphCount);
+ le_int32 i;
+
+@@ -401,6 +413,10 @@
+
+ delete adjustments;
+ }
++ else {
++ // if there was no GPOS table, maybe there's non-OpenType kerning we can use
++ LayoutEngine::adjustGlyphPositions(chars, offset, count, reverse, glyphStorage, success);
++ }
+
+ LEGlyphID zwnj = fFontInstance->mapCharToGlyph(0x200C);
+
diff --git a/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-50-Vertical b/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-50-Vertical
new file mode 100644
index 00000000000..ea362d76cf0
--- /dev/null
+++ b/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-50-Vertical
@@ -0,0 +1,245 @@
+diff -ur icu-4.2.1.orig/source/layout/LEFontInstance.h icu-4.2.1/source/layout/LEFontInstance.h
+--- icu-4.2.1.orig/source/layout/LEFontInstance.h 2009-07-01 20:51:24.000000000 +0200
++++ icu-4.2.1/source/layout/LEFontInstance.h 2009-10-23 00:14:44.000000000 +0200
+@@ -509,6 +509,10 @@
+ */
+ static UClassID getStaticClassID();
+
++ /**
++ * Returns true if writing direction is vertical.
++ */
++ virtual inline bool getLayoutDirVertical() const;
+ };
+
+ inline float LEFontInstance::fixedToFloat(le_int32 fixed)
+@@ -521,6 +525,11 @@
+ return (le_int32) (theFloat * 65536.0);
+ }
+
++inline bool LEFontInstance::getLayoutDirVertical() const
++{
++ return false;
++}
++
+ U_NAMESPACE_END
+ #endif
+
+diff -ur icu-4.2.1.orig/source/layout/ValueRecords.cpp icu-4.2.1/source/layout/ValueRecords.cpp
+--- icu-4.2.1.orig/source/layout/ValueRecords.cpp 2009-07-01 20:51:26.000000000 +0200
++++ icu-4.2.1/source/layout/ValueRecords.cpp 2009-10-23 00:14:44.000000000 +0200
+@@ -48,8 +48,12 @@
+
+ fontInstance->transformFunits(value, 0, pixels);
+
+- xPlacementAdjustment += fontInstance->xPixelsToUnits(pixels.fX);
+- yPlacementAdjustment += fontInstance->yPixelsToUnits(pixels.fY);
++ xPlacementAdjustment += fontInstance->getLayoutDirVertical()
++ ? -fontInstance->yPixelsToUnits(pixels.fY)
++ : fontInstance->xPixelsToUnits(pixels.fX);
++ yPlacementAdjustment += fontInstance->getLayoutDirVertical()
++ ? fontInstance->xPixelsToUnits(pixels.fX)
++ : fontInstance->yPixelsToUnits(pixels.fY);
+ }
+
+ if ((valueFormat & vfbYPlacement) != 0) {
+@@ -58,8 +62,12 @@
+
+ fontInstance->transformFunits(0, value, pixels);
+
+- xPlacementAdjustment += fontInstance->xPixelsToUnits(pixels.fX);
+- yPlacementAdjustment += fontInstance->yPixelsToUnits(pixels.fY);
++ xPlacementAdjustment += fontInstance->getLayoutDirVertical()
++ ? -fontInstance->yPixelsToUnits(pixels.fY)
++ : fontInstance->xPixelsToUnits(pixels.fX);
++ yPlacementAdjustment += fontInstance->getLayoutDirVertical()
++ ? fontInstance->xPixelsToUnits(pixels.fX)
++ : fontInstance->yPixelsToUnits(pixels.fY);
+ }
+
+ if ((valueFormat & vfbXAdvance) != 0) {
+@@ -68,8 +76,12 @@
+
+ fontInstance->transformFunits(value, 0, pixels);
+
+- xAdvanceAdjustment += fontInstance->xPixelsToUnits(pixels.fX);
+- yAdvanceAdjustment += fontInstance->yPixelsToUnits(pixels.fY);
++ xAdvanceAdjustment += fontInstance->getLayoutDirVertical()
++ ? fontInstance->yPixelsToUnits(pixels.fY)
++ : fontInstance->xPixelsToUnits(pixels.fX);
++ yAdvanceAdjustment += fontInstance->getLayoutDirVertical()
++ ? -fontInstance->xPixelsToUnits(pixels.fX)
++ : fontInstance->yPixelsToUnits(pixels.fY);
+ }
+
+ if ((valueFormat & vfbYAdvance) != 0) {
+@@ -78,8 +90,12 @@
+
+ fontInstance->transformFunits(0, value, pixels);
+
+- xAdvanceAdjustment += fontInstance->xPixelsToUnits(pixels.fX);
+- yAdvanceAdjustment += fontInstance->yPixelsToUnits(pixels.fY);
++ xAdvanceAdjustment += fontInstance->getLayoutDirVertical()
++ ? fontInstance->yPixelsToUnits(pixels.fY)
++ : fontInstance->xPixelsToUnits(pixels.fX);
++ yAdvanceAdjustment += fontInstance->getLayoutDirVertical()
++ ? -fontInstance->xPixelsToUnits(pixels.fX)
++ : fontInstance->yPixelsToUnits(pixels.fY);
+ }
+
+ // FIXME: The device adjustments should really be transformed, but
+@@ -96,7 +112,10 @@
+ const DeviceTable *dt = (const DeviceTable *) (base + dtOffset);
+ le_int16 xAdj = dt->getAdjustment(xppem);
+
+- xPlacementAdjustment += fontInstance->xPixelsToUnits(xAdj);
++ if (fontInstance->getLayoutDirVertical())
++ yPlacementAdjustment += fontInstance->xPixelsToUnits(xAdj);
++ else
++ xPlacementAdjustment += fontInstance->xPixelsToUnits(xAdj);
+ }
+ }
+
+@@ -107,7 +126,10 @@
+ const DeviceTable *dt = (const DeviceTable *) (base + dtOffset);
+ le_int16 yAdj = dt->getAdjustment(yppem);
+
+- yPlacementAdjustment += fontInstance->yPixelsToUnits(yAdj);
++ if (fontInstance->getLayoutDirVertical())
++ xPlacementAdjustment -= fontInstance->yPixelsToUnits(yAdj);
++ else
++ yPlacementAdjustment += fontInstance->yPixelsToUnits(yAdj);
+ }
+ }
+
+@@ -118,7 +140,10 @@
+ const DeviceTable *dt = (const DeviceTable *) (base + dtOffset);
+ le_int16 xAdj = dt->getAdjustment(xppem);
+
+- xAdvanceAdjustment += fontInstance->xPixelsToUnits(xAdj);
++ if (fontInstance->getLayoutDirVertical())
++ yAdvanceAdjustment -= fontInstance->xPixelsToUnits(xAdj);
++ else
++ xAdvanceAdjustment += fontInstance->xPixelsToUnits(xAdj);
+ }
+ }
+
+@@ -129,7 +154,10 @@
+ const DeviceTable *dt = (const DeviceTable *) (base + dtOffset);
+ le_int16 yAdj = dt->getAdjustment(yppem);
+
+- yAdvanceAdjustment += fontInstance->yPixelsToUnits(yAdj);
++ if (fontInstance->getLayoutDirVertical())
++ xAdvanceAdjustment += fontInstance->yPixelsToUnits(yAdj);
++ else
++ yAdvanceAdjustment += fontInstance->yPixelsToUnits(yAdj);
+ }
+ }
+ }
+@@ -152,8 +180,12 @@
+
+ fontInstance->transformFunits(value, 0, pixels);
+
+- xPlacementAdjustment += fontInstance->xPixelsToUnits(pixels.fX);
+- yPlacementAdjustment += fontInstance->yPixelsToUnits(pixels.fY);
++ xPlacementAdjustment += fontInstance->getLayoutDirVertical()
++ ? -fontInstance->yPixelsToUnits(pixels.fY)
++ : fontInstance->xPixelsToUnits(pixels.fX);
++ yPlacementAdjustment += fontInstance->getLayoutDirVertical()
++ ? fontInstance->xPixelsToUnits(pixels.fX)
++ : fontInstance->yPixelsToUnits(pixels.fY);
+ }
+
+ if ((valueFormat & vfbYPlacement) != 0) {
+@@ -162,8 +194,12 @@
+
+ fontInstance->transformFunits(0, value, pixels);
+
+- xPlacementAdjustment += fontInstance->xPixelsToUnits(pixels.fX);
+- yPlacementAdjustment += fontInstance->yPixelsToUnits(pixels.fY);
++ xPlacementAdjustment += fontInstance->getLayoutDirVertical()
++ ? -fontInstance->yPixelsToUnits(pixels.fY)
++ : fontInstance->xPixelsToUnits(pixels.fX);
++ yPlacementAdjustment += fontInstance->getLayoutDirVertical()
++ ? fontInstance->xPixelsToUnits(pixels.fX)
++ : fontInstance->yPixelsToUnits(pixels.fY);
+ }
+
+ if ((valueFormat & vfbXAdvance) != 0) {
+@@ -172,8 +208,12 @@
+
+ fontInstance->transformFunits(value, 0, pixels);
+
+- xAdvanceAdjustment += fontInstance->xPixelsToUnits(pixels.fX);
+- yAdvanceAdjustment += fontInstance->yPixelsToUnits(pixels.fY);
++ xAdvanceAdjustment += fontInstance->getLayoutDirVertical()
++ ? fontInstance->yPixelsToUnits(pixels.fY)
++ : fontInstance->xPixelsToUnits(pixels.fX);
++ yAdvanceAdjustment += fontInstance->getLayoutDirVertical()
++ ? -fontInstance->xPixelsToUnits(pixels.fX)
++ : fontInstance->yPixelsToUnits(pixels.fY);
+ }
+
+ if ((valueFormat & vfbYAdvance) != 0) {
+@@ -182,8 +222,12 @@
+
+ fontInstance->transformFunits(0, value, pixels);
+
+- xAdvanceAdjustment += fontInstance->xPixelsToUnits(pixels.fX);
+- yAdvanceAdjustment += fontInstance->yPixelsToUnits(pixels.fY);
++ xAdvanceAdjustment += fontInstance->getLayoutDirVertical()
++ ? fontInstance->yPixelsToUnits(pixels.fY)
++ : fontInstance->xPixelsToUnits(pixels.fX);
++ yAdvanceAdjustment += fontInstance->getLayoutDirVertical()
++ ? -fontInstance->xPixelsToUnits(pixels.fX)
++ : fontInstance->yPixelsToUnits(pixels.fY);
+ }
+
+ // FIXME: The device adjustments should really be transformed, but
+@@ -200,7 +244,10 @@
+ const DeviceTable *dt = (const DeviceTable *) (base + dtOffset);
+ le_int16 xAdj = dt->getAdjustment(xppem);
+
+- xPlacementAdjustment += fontInstance->xPixelsToUnits(xAdj);
++ if (fontInstance->getLayoutDirVertical())
++ yPlacementAdjustment += fontInstance->xPixelsToUnits(xAdj);
++ else
++ xPlacementAdjustment += fontInstance->xPixelsToUnits(xAdj);
+ }
+ }
+
+@@ -211,7 +258,10 @@
+ const DeviceTable *dt = (const DeviceTable *) (base + dtOffset);
+ le_int16 yAdj = dt->getAdjustment(yppem);
+
+- yPlacementAdjustment += fontInstance->yPixelsToUnits(yAdj);
++ if (fontInstance->getLayoutDirVertical())
++ xPlacementAdjustment -= fontInstance->yPixelsToUnits(yAdj);
++ else
++ yPlacementAdjustment += fontInstance->yPixelsToUnits(yAdj);
+ }
+ }
+
+@@ -222,7 +272,10 @@
+ const DeviceTable *dt = (const DeviceTable *) (base + dtOffset);
+ le_int16 xAdj = dt->getAdjustment(xppem);
+
+- xAdvanceAdjustment += fontInstance->xPixelsToUnits(xAdj);
++ if (fontInstance->getLayoutDirVertical())
++ yAdvanceAdjustment -= fontInstance->xPixelsToUnits(xAdj);
++ else
++ xAdvanceAdjustment += fontInstance->xPixelsToUnits(xAdj);
+ }
+ }
+
+@@ -233,7 +286,10 @@
+ const DeviceTable *dt = (const DeviceTable *) (base + dtOffset);
+ le_int16 yAdj = dt->getAdjustment(yppem);
+
+- yAdvanceAdjustment += fontInstance->yPixelsToUnits(yAdj);
++ if (fontInstance->getLayoutDirVertical())
++ xAdvanceAdjustment += fontInstance->yPixelsToUnits(yAdj);
++ else
++ yAdvanceAdjustment += fontInstance->yPixelsToUnits(yAdj);
+ }
+ }
+ }
diff --git a/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-60-KernPair b/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-60-KernPair
new file mode 100644
index 00000000000..983f0d685cf
--- /dev/null
+++ b/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-60-KernPair
@@ -0,0 +1,61 @@
+diff -ur icu-4.2.1.orig/source/layout/LEFontInstance.cpp icu-4.2.1/source/layout/LEFontInstance.cpp
+--- icu-4.2.1.orig/source/layout/LEFontInstance.cpp 2009-07-01 20:51:24.000000000 +0200
++++ icu-4.2.1/source/layout/LEFontInstance.cpp 2009-10-23 00:16:48.000000000 +0200
+@@ -145,5 +145,10 @@
+ return getAscent() + getDescent() + getLeading();
+ }
+
++void LEFontInstance::getKernPair(LEGlyphID leftGlyph, LEGlyphID rightGlyph, LEPoint &kern) const
++{
++ kern.fX = kern.fY = 0;
++}
++
+ U_NAMESPACE_END
+
+diff -ur icu-4.2.1.orig/source/layout/LEFontInstance.h icu-4.2.1/source/layout/LEFontInstance.h
+--- icu-4.2.1.orig/source/layout/LEFontInstance.h 2009-10-23 00:14:44.000000000 +0200
++++ icu-4.2.1/source/layout/LEFontInstance.h 2009-10-23 00:16:48.000000000 +0200
+@@ -510,6 +510,11 @@
+ static UClassID getStaticClassID();
+
+ /**
++ * Returns kern value for a glyph pair, if the font has a kern pair list.
++ */
++ virtual void getKernPair(LEGlyphID leftGlyph, LEGlyphID rightGlyph, LEPoint &kern) const;
++
++ /**
+ * Returns true if writing direction is vertical.
+ */
+ virtual inline bool getLayoutDirVertical() const;
+diff -ur icu-4.2.1.orig/source/layout/LayoutEngine.cpp icu-4.2.1/source/layout/LayoutEngine.cpp
+--- icu-4.2.1.orig/source/layout/LayoutEngine.cpp 2009-07-01 20:51:24.000000000 +0200
++++ icu-4.2.1/source/layout/LayoutEngine.cpp 2009-10-23 00:16:48.000000000 +0200
+@@ -369,9 +369,25 @@
+
+ if (fTypoFlags & 0x1) { /* kerning enabled */
+ static const le_uint32 kernTableTag = LE_KERN_TABLE_TAG;
+-
+- KernTable kt(fFontInstance, getFontTable(kernTableTag));
+- kt.process(glyphStorage);
++ const void* kernTableData = getFontTable(kernTableTag);
++ if (kernTableData != NULL) {
++ KernTable kt(fFontInstance, kernTableData);
++ kt.process(glyphStorage);
++ }
++ else { /* no 'kern' table, but the font might know kern pairs from an AFM file, for instance */
++ float xAdjust = 0.0, yAdjust = 0.0;
++ LEGlyphID leftGlyph = glyphStorage.getGlyphID(0, success);
++ for (le_int32 i = 1; i < glyphStorage.getGlyphCount(); ++i) {
++ LEGlyphID rightGlyph = glyphStorage.getGlyphID(i, success);
++ LEPoint kern;
++ fFontInstance->getKernPair(leftGlyph, rightGlyph, kern);
++ xAdjust += fFontInstance->xUnitsToPoints(kern.fX);
++ yAdjust += fFontInstance->yUnitsToPoints(kern.fY);
++ glyphStorage.adjustPosition(i, xAdjust, yAdjust, success);
++ leftGlyph = rightGlyph;
++ }
++ glyphStorage.adjustPosition(glyphStorage.getGlyphCount(), xAdjust, yAdjust, success);
++ }
+ }
+
+ // default is no adjustments
diff --git a/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-70-Arabic b/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-70-Arabic
new file mode 100644
index 00000000000..0046f27b065
--- /dev/null
+++ b/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-70-Arabic
@@ -0,0 +1,204 @@
+diff -ur icu-4.2.1.orig/source/layout/ArabicShaping.cpp icu-4.2.1/source/layout/ArabicShaping.cpp
+--- icu-4.2.1.orig/source/layout/ArabicShaping.cpp 2009-07-01 20:51:24.000000000 +0200
++++ icu-4.2.1/source/layout/ArabicShaping.cpp 2009-10-23 14:00:28.000000000 +0200
+@@ -24,6 +24,31 @@
+ ArabicShaping::ST_TRANSPARENT // [T]
+ };
+
++// Draft Mongolian shaping classes, not provided by the Unicode data files at this time
++enum {
++ _c_ = ArabicShaping::ST_NOSHAPE_DUAL,
++ _d_ = ArabicShaping::ST_DUAL,
++ _n_ = ArabicShaping::ST_NONE,
++ _r_ = ArabicShaping::ST_RIGHT,
++ _t_ = ArabicShaping::ST_TRANSPARENT,
++ _x_ = ArabicShaping::ST_NOSHAPE_NONE
++};
++
++const ArabicShaping::ShapeType ArabicShaping::mongolianTypes[] =
++{
++ _n_, _n_, _n_, _n_, _n_, _n_, _n_, _n_, _n_, _n_, _n_, _t_, _t_, _t_, _t_, _n_, // 0x1800 - 0x180f
++ _n_, _n_, _n_, _n_, _n_, _n_, _n_, _n_, _n_, _n_, _n_, _n_, _n_, _n_, _n_, _n_, // 0x1810 - 0x181f
++ _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, // 0x1820 - 0x182f
++ _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, // 0x1830 - 0x183f
++ _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, // 0x1840 - 0x184f
++ _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, // 0x1850 - 0x185f
++ _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, // 0x1860 - 0x186f
++ _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _n_, _n_, _n_, _n_, _n_, _n_, _n_, _n_, // 0x1870 - 0x187f
++ _n_, _n_, _n_, _n_, _n_, _n_, _n_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, // 0x1880 - 0x188f
++ _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, // 0x1890 - 0x189f
++ _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _t_, _n_, _n_, _n_, _n_, _n_, _n_ // 0x18a0 - 0x18af
++};
++
+ /*
+ shaping array holds types for Arabic chars between 0610 and 0700
+ other values are either unshaped, or transparent if a mark or format
+@@ -36,17 +61,32 @@
+ const ClassDefinitionTable *joiningTypes = (const ClassDefinitionTable *) ArabicShaping::shapingTypeTable;
+ le_int32 joiningType = joiningTypes->getGlyphClass(c);
+
+- if (joiningType >= 0 && joiningType < ArabicShaping::JT_COUNT) {
+- return ArabicShaping::shapeTypes[joiningType];
++ if (joiningType == JT_RIGHT_JOINING) { // check for Syriac exceptions ALAPH, DALATH, RISH
++ if (c == 0x0710)
++ return ST_ALAPH;
++ if (c == 0x0715 || c == 0x0716 || c == 0x072A || c == 0x072F)
++ return ST_DALATH_RISH;
+ }
+
+- return ArabicShaping::ST_NOSHAPE_NONE;
++ if (joiningType == 0) { // check for Mongolian range, not supported by ArabicShaping::shapingTypeTable
++ if (c >= 0x1800 && c <= 0x18af)
++ return mongolianTypes[c - 0x1800];
++ }
++
++ if (joiningType >= 0 && joiningType < JT_COUNT) {
++ return shapeTypes[joiningType];
++ }
++
++ return ST_NOSHAPE_NONE;
+ }
+
+ #define isolFeatureTag LE_ISOL_FEATURE_TAG
+ #define initFeatureTag LE_INIT_FEATURE_TAG
+ #define mediFeatureTag LE_MEDI_FEATURE_TAG
++#define med2FeatureTag LE_MED2_FEATURE_TAG
+ #define finaFeatureTag LE_FINA_FEATURE_TAG
++#define fin2FeatureTag LE_FIN2_FEATURE_TAG
++#define fin3FeatureTag LE_FIN3_FEATURE_TAG
+ #define ligaFeatureTag LE_LIGA_FEATURE_TAG
+ #define msetFeatureTag LE_MSET_FEATURE_TAG
+ #define markFeatureTag LE_MARK_FEATURE_TAG
+@@ -62,33 +102,40 @@
+ // NOTE:
+ // The isol, fina, init and medi features must be
+ // defined in the above order, and have masks that
+-// are all in the same nibble.
++// are all in the same byte.
+ #define isolFeatureMask 0x80000000UL
+ #define finaFeatureMask 0x40000000UL
+ #define initFeatureMask 0x20000000UL
+ #define mediFeatureMask 0x10000000UL
+-#define ccmpFeatureMask 0x08000000UL
+-#define rligFeatureMask 0x04000000UL
+-#define caltFeatureMask 0x02000000UL
+-#define ligaFeatureMask 0x01000000UL
+-#define dligFeatureMask 0x00800000UL
+-#define cswhFeatureMask 0x00400000UL
+-#define msetFeatureMask 0x00200000UL
+-#define cursFeatureMask 0x00100000UL
+-#define kernFeatureMask 0x00080000UL
+-#define markFeatureMask 0x00040000UL
+-#define mkmkFeatureMask 0x00020000UL
++#define fin2FeatureMask 0x08000000UL
++#define fin3FeatureMask 0x04000000UL
++#define med2FeatureMask 0x03000000UL /* two bits, from shifting either fin2 or fin3 */
++
++#define ccmpFeatureMask 0x00800000UL
++#define rligFeatureMask 0x00400000UL
++#define caltFeatureMask 0x00200000UL
++#define ligaFeatureMask 0x00100000UL
++#define dligFeatureMask 0x00080000UL
++#define cswhFeatureMask 0x00040000UL
++#define msetFeatureMask 0x00020000UL
++#define cursFeatureMask 0x00010000UL
++#define kernFeatureMask 0x00008000UL
++#define markFeatureMask 0x00004000UL
++#define mkmkFeatureMask 0x00002000UL
+
+ #define NO_FEATURES 0
+ #define ISOL_FEATURES (isolFeatureMask | ligaFeatureMask | msetFeatureMask | markFeatureMask | ccmpFeatureMask | rligFeatureMask | caltFeatureMask | dligFeatureMask | cswhFeatureMask | cursFeatureMask | kernFeatureMask | mkmkFeatureMask)
+
+-#define SHAPE_MASK 0xF0000000UL
++#define SHAPE_MASK 0xFF000000UL
+
+ static const FeatureMap featureMap[] = {
+ {ccmpFeatureTag, ccmpFeatureMask},
+ {isolFeatureTag, isolFeatureMask},
+ {finaFeatureTag, finaFeatureMask},
++ {fin2FeatureTag, fin2FeatureMask},
++ {fin3FeatureTag, fin3FeatureMask},
+ {mediFeatureTag, mediFeatureMask},
++ {med2FeatureTag, med2FeatureMask},
+ {initFeatureTag, initFeatureMask},
+ {rligFeatureTag, rligFeatureMask},
+ {caltFeatureTag, caltFeatureMask},
+@@ -138,6 +185,14 @@
+ // shaper.shape(errout, 2) (isolate to initial, or final to medial)
+ // shaper.shape(out, 1) (isolate to final)
+
++ // special cases for Syriac ALAPH:
++ // final ALAPH is fin2 when effective right char shapes but does not cause left shaping, and is not DALATH/RISH
++ // final ALAPH is fin3 when effective right char is DALATH/RISH
++ // medial ALAPH is med2 when effective right char shapes but does not cause left shaping
++ // using one of:
++ // shaper.shape(out, 4) (isolate to fin2)
++ // shaper.shape(out, 5) (isolate to fin3)
++
+ ShapeType rightType = ST_NOSHAPE_NONE, leftType = ST_NOSHAPE_NONE;
+ LEErrorCode success = LE_NO_ERROR;
+ le_int32 i;
+@@ -195,10 +250,17 @@
+ if (curShapes) {
+ adjustTags(out, 1, glyphStorage);
+ }
++ } else if (t == ST_ALAPH) {
++ if (rightType == ST_DALATH_RISH) {
++ adjustTags(out, 5, glyphStorage);
++ } else if (rightShapes && !rightCauses) {
++ adjustTags(out, 4, glyphStorage);
++ }
+ }
+
+ rightShapes = curShapes;
+ rightCauses = (t & MASK_SHAPE_LEFT) != 0;
++ rightType = t; // remember this; might need to know if it was DALATH/RISH
+ erout = out;
+ }
+
+diff -ur icu-4.2.1.orig/source/layout/ArabicShaping.h icu-4.2.1/source/layout/ArabicShaping.h
+--- icu-4.2.1.orig/source/layout/ArabicShaping.h 2009-07-01 20:51:24.000000000 +0200
++++ icu-4.2.1/source/layout/ArabicShaping.h 2009-10-23 14:00:28.000000000 +0200
+@@ -39,7 +39,10 @@
+ MASK_SHAPE_RIGHT = 1, // if this bit set, shapes to right
+ MASK_SHAPE_LEFT = 2, // if this bit set, shapes to left
+ MASK_TRANSPARENT = 4, // if this bit set, is transparent (ignore other bits)
+- MASK_NOSHAPE = 8 // if this bit set, don't shape this char, i.e. tatweel
++ MASK_NOSHAPE = 8, // if this bit set, don't shape this char, i.e. tatweel
++
++ MASK_ALAPH = 16, // if this bit set, char is Syriac ALAPH
++ MASK_DALATH_RISH = 32 // if this bit set, char is Syriac DALATH/RISH
+ };
+
+ // shaping values
+@@ -51,7 +54,9 @@
+ ST_DUAL = MASK_SHAPE_RIGHT | MASK_SHAPE_LEFT,
+ ST_TRANSPARENT = MASK_TRANSPARENT,
+ ST_NOSHAPE_DUAL = MASK_NOSHAPE | ST_DUAL,
+- ST_NOSHAPE_NONE = MASK_NOSHAPE
++ ST_NOSHAPE_NONE = MASK_NOSHAPE,
++ ST_ALAPH = MASK_ALAPH | MASK_SHAPE_RIGHT,
++ ST_DALATH_RISH = MASK_DALATH_RISH | MASK_SHAPE_RIGHT
+ };
+
+ typedef le_int32 ShapeType;
+@@ -69,6 +74,7 @@
+
+ static const le_uint8 shapingTypeTable[];
+ static const ShapeType shapeTypes[];
++ static const ShapeType mongolianTypes[];
+
+ static void adjustTags(le_int32 outIndex, le_int32 shapeOffset, LEGlyphStorage &glyphStorage);
+ };
+diff -ur icu-4.2.1.orig/source/layout/LayoutEngine.cpp icu-4.2.1/source/layout/LayoutEngine.cpp
+--- icu-4.2.1.orig/source/layout/LayoutEngine.cpp 2009-10-23 00:16:48.000000000 +0200
++++ icu-4.2.1/source/layout/LayoutEngine.cpp 2009-10-23 14:05:00.000000000 +0200
+@@ -567,6 +567,8 @@
+ break;
+
+ case arabScriptCode:
++ case syrcScriptCode:
++ case mongScriptCode:
+ result = new ArabicOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable, success);
+ break;
+
diff --git a/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-80-Indic b/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-80-Indic
new file mode 100644
index 00000000000..689679e2a7f
--- /dev/null
+++ b/Build/source/libs/icu/icu-4.2.1-PATCHES/patch-80-Indic
@@ -0,0 +1,28 @@
+diff -ur icu-4.2.1.orig/source/layout/IndicClassTables.cpp icu-4.2.1/source/layout/IndicClassTables.cpp
+--- icu-4.2.1.orig/source/layout/IndicClassTables.cpp 2009-07-01 20:51:26.000000000 +0200
++++ icu-4.2.1/source/layout/IndicClassTables.cpp 2009-10-22 23:10:23.000000000 +0200
+@@ -256,7 +256,7 @@
+ //
+ static const IndicClassTable devaClassTable = {0x0900, 0x0970, 2, DEVA_SCRIPT_FLAGS, devaCharClasses, NULL};
+
+-static const IndicClassTable bengClassTable = {0x0980, 0x09FA, 3, BENG_SCRIPT_FLAGS, bengCharClasses, bengSplitTable};
++static const IndicClassTable bengClassTable = {0x0980, 0x09FA, 4, BENG_SCRIPT_FLAGS, bengCharClasses, bengSplitTable};
+
+ static const IndicClassTable punjClassTable = {0x0A00, 0x0A74, 2, PUNJ_SCRIPT_FLAGS, punjCharClasses, NULL};
+
+@@ -264,13 +264,13 @@
+
+ static const IndicClassTable oryaClassTable = {0x0B00, 0x0B71, 3, ORYA_SCRIPT_FLAGS, oryaCharClasses, oryaSplitTable};
+
+-static const IndicClassTable tamlClassTable = {0x0B80, 0x0BF2, 3, TAML_SCRIPT_FLAGS, tamlCharClasses, tamlSplitTable};
++static const IndicClassTable tamlClassTable = {0x0B80, 0x0BF2, 4, TAML_SCRIPT_FLAGS, tamlCharClasses, tamlSplitTable};
+
+ static const IndicClassTable teluClassTable = {0x0C00, 0x0C6F, 3, TELU_SCRIPT_FLAGS, teluCharClasses, teluSplitTable};
+
+ static const IndicClassTable kndaClassTable = {0x0C80, 0x0CEF, 4, KNDA_SCRIPT_FLAGS, kndaCharClasses, kndaSplitTable};
+
+-static const IndicClassTable mlymClassTable = {0x0D00, 0x0D6F, 3, MLYM_SCRIPT_FLAGS, mlymCharClasses, mlymSplitTable};
++static const IndicClassTable mlymClassTable = {0x0D00, 0x0D6F, 4, MLYM_SCRIPT_FLAGS, mlymCharClasses, mlymSplitTable};
+
+ static const IndicClassTable sinhClassTable = {0x0D80, 0x0DF4, 4, SINH_SCRIPT_FLAGS, sinhCharClasses, sinhSplitTable};
+