summaryrefslogtreecommitdiff
path: root/Build/source/libs/icu/icu-xetex/test/letest
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/icu/icu-xetex/test/letest')
-rw-r--r--Build/source/libs/icu/icu-xetex/test/letest/FontObject.cpp240
-rw-r--r--Build/source/libs/icu/icu-xetex/test/letest/FontObject.h235
-rw-r--r--Build/source/libs/icu/icu-xetex/test/letest/FontTableCache.cpp86
-rw-r--r--Build/source/libs/icu/icu-xetex/test/letest/FontTableCache.h40
-rw-r--r--Build/source/libs/icu/icu-xetex/test/letest/Makefile.in105
-rw-r--r--Build/source/libs/icu/icu-xetex/test/letest/PortableFontInstance.cpp441
-rw-r--r--Build/source/libs/icu/icu-xetex/test/letest/PortableFontInstance.h118
-rw-r--r--Build/source/libs/icu/icu-xetex/test/letest/SimpleFontInstance.cpp132
-rw-r--r--Build/source/libs/icu/icu-xetex/test/letest/SimpleFontInstance.h71
-rw-r--r--Build/source/libs/icu/icu-xetex/test/letest/cfonts.cpp55
-rw-r--r--Build/source/libs/icu/icu-xetex/test/letest/cfonts.h28
-rw-r--r--Build/source/libs/icu/icu-xetex/test/letest/cletest.c726
-rw-r--r--Build/source/libs/icu/icu-xetex/test/letest/cletest.sln20
-rw-r--r--Build/source/libs/icu/icu-xetex/test/letest/cletest.vcproj273
-rw-r--r--Build/source/libs/icu/icu-xetex/test/letest/cmaps.cpp200
-rw-r--r--Build/source/libs/icu/icu-xetex/test/letest/cmaps.h85
-rw-r--r--Build/source/libs/icu/icu-xetex/test/letest/gendata.cpp295
-rw-r--r--Build/source/libs/icu/icu-xetex/test/letest/gendata.sln19
-rw-r--r--Build/source/libs/icu/icu-xetex/test/letest/gendata.vcproj269
-rw-r--r--Build/source/libs/icu/icu-xetex/test/letest/gendata.xml115
-rw-r--r--Build/source/libs/icu/icu-xetex/test/letest/letest.cpp1116
-rw-r--r--Build/source/libs/icu/icu-xetex/test/letest/letest.h49
-rw-r--r--Build/source/libs/icu/icu-xetex/test/letest/letest.sln30
-rw-r--r--Build/source/libs/icu/icu-xetex/test/letest/letest.vcproj290
-rw-r--r--Build/source/libs/icu/icu-xetex/test/letest/letsutil.cpp98
-rw-r--r--Build/source/libs/icu/icu-xetex/test/letest/letsutil.h36
-rw-r--r--Build/source/libs/icu/icu-xetex/test/letest/readme.html114
-rw-r--r--Build/source/libs/icu/icu-xetex/test/letest/sfnt.h449
-rw-r--r--Build/source/libs/icu/icu-xetex/test/letest/testdata.cpp638
-rw-r--r--Build/source/libs/icu/icu-xetex/test/letest/xmlreader.cpp259
-rw-r--r--Build/source/libs/icu/icu-xetex/test/letest/xmlreader.h25
31 files changed, 6657 insertions, 0 deletions
diff --git a/Build/source/libs/icu/icu-xetex/test/letest/FontObject.cpp b/Build/source/libs/icu/icu-xetex/test/letest/FontObject.cpp
new file mode 100644
index 00000000000..1f8370bdecd
--- /dev/null
+++ b/Build/source/libs/icu/icu-xetex/test/letest/FontObject.cpp
@@ -0,0 +1,240 @@
+/***************************************************************************
+*
+* Copyright (C) 1998-2002, International Business Machines
+* Corporation and others. All Rights Reserved.
+*
+************************************************************************/
+
+#include <stdio.h>
+
+#include "LETypes.h"
+#include "FontObject.h"
+#include "LESwaps.h"
+
+FontObject::FontObject(char *fileName)
+ : directory(NULL), numTables(0), searchRange(0),entrySelector(0),
+ cmapTable(NULL), cmSegCount(0), cmSearchRange(0), cmEntrySelector(0),
+ cmEndCodes(NULL), cmStartCodes(NULL), cmIdDelta(0), cmIdRangeOffset(0),
+ headTable(NULL), hmtxTable(NULL), numGlyphs(0), numOfLongHorMetrics(0), file(NULL)
+{
+ file = fopen(fileName, "rb");
+
+ if (file == NULL) {
+ printf("?? Couldn't open %s", fileName);
+ return;
+ }
+
+ SFNTDirectory tempDir;
+
+ fread(&tempDir, sizeof tempDir, 1, file);
+
+ numTables = SWAPW(tempDir.numTables);
+ searchRange = SWAPW(tempDir.searchRange) >> 4;
+ entrySelector = SWAPW(tempDir.entrySelector);
+ rangeShift = SWAPW(tempDir.rangeShift) >> 4;
+
+ int dirSize = sizeof tempDir + ((numTables - ANY_NUMBER) * sizeof(DirectoryEntry));
+
+ directory = (SFNTDirectory *) new char[dirSize];
+
+ fseek(file, 0L, SEEK_SET);
+ fread(directory, sizeof(char), dirSize, file);
+
+ initUnicodeCMAP();
+}
+
+FontObject::~FontObject()
+{
+ fclose(file);
+ delete[] directory;
+ delete[] cmapTable;
+ delete[] headTable;
+ delete[] hmtxTable;
+}
+
+void FontObject::deleteTable(void *table)
+{
+ delete[] (char *) table;
+}
+
+DirectoryEntry *FontObject::findTable(LETag tag)
+{
+ le_uint16 table = 0;
+ le_uint16 probe = 1 << entrySelector;
+
+ if (SWAPL(directory->tableDirectory[rangeShift].tag) <= tag) {
+ table = rangeShift;
+ }
+
+ while (probe > (1 << 0)) {
+ probe >>= 1;
+
+ if (SWAPL(directory->tableDirectory[table + probe].tag) <= tag) {
+ table += probe;
+ }
+ }
+
+ if (SWAPL(directory->tableDirectory[table].tag) == tag) {
+ return &directory->tableDirectory[table];
+ }
+
+ return NULL;
+}
+
+void *FontObject::readTable(LETag tag, le_uint32 *length)
+{
+ DirectoryEntry *entry = findTable(tag);
+
+ if (entry == NULL) {
+ *length = 0;
+ return NULL;
+ }
+
+ *length = SWAPL(entry->length);
+
+ void *table = new char[*length];
+
+ fseek(file, SWAPL(entry->offset), SEEK_SET);
+ fread(table, sizeof(char), *length, file);
+
+ return table;
+}
+
+CMAPEncodingSubtable *FontObject::findCMAP(le_uint16 platformID, le_uint16 platformSpecificID)
+{
+ LETag cmapTag = 0x636D6170; // 'cmap'
+
+ if (cmapTable == NULL) {
+ le_uint32 length;
+
+ cmapTable = (CMAPTable *) readTable(cmapTag, &length);
+ }
+
+ if (cmapTable != NULL) {
+ le_uint16 i;
+ le_uint16 nSubtables = SWAPW(cmapTable->numberSubtables);
+
+
+ for (i = 0; i < nSubtables; i += 1) {
+ CMAPEncodingSubtableHeader *esh = &cmapTable->encodingSubtableHeaders[i];
+
+ if (SWAPW(esh->platformID) == platformID &&
+ SWAPW(esh->platformSpecificID) == platformSpecificID) {
+ return (CMAPEncodingSubtable *) ((char *) cmapTable + SWAPL(esh->encodingOffset));
+ }
+ }
+ }
+
+ return NULL;
+}
+
+void FontObject::initUnicodeCMAP()
+{
+ CMAPEncodingSubtable *encodingSubtable = findCMAP(3, 1);
+
+ if (encodingSubtable == 0 ||
+ SWAPW(encodingSubtable->format) != 4) {
+ printf("Can't find unicode 'cmap'");
+ return;
+ }
+
+ CMAPFormat4Encoding *header = (CMAPFormat4Encoding *) encodingSubtable;
+
+ cmSegCount = SWAPW(header->segCountX2) / 2;
+ cmSearchRange = SWAPW(header->searchRange);
+ cmEntrySelector = SWAPW(header->entrySelector);
+ cmRangeShift = SWAPW(header->rangeShift) / 2;
+ cmEndCodes = &header->endCodes[0];
+ cmStartCodes = &header->endCodes[cmSegCount + 1]; // + 1 for reservedPad...
+ cmIdDelta = &cmStartCodes[cmSegCount];
+ cmIdRangeOffset = &cmIdDelta[cmSegCount];
+}
+
+LEGlyphID FontObject::unicodeToGlyph(LEUnicode32 unicode32)
+{
+ if (unicode32 >= 0x10000) {
+ return 0;
+ }
+
+ LEUnicode16 unicode = (LEUnicode16) unicode32;
+ le_uint16 index = 0;
+ le_uint16 probe = 1 << cmEntrySelector;
+ LEGlyphID result = 0;
+
+ if (SWAPW(cmStartCodes[cmRangeShift]) <= unicode) {
+ index = cmRangeShift;
+ }
+
+ while (probe > (1 << 0)) {
+ probe >>= 1;
+
+ if (SWAPW(cmStartCodes[index + probe]) <= unicode) {
+ index += probe;
+ }
+ }
+
+ if (unicode >= SWAPW(cmStartCodes[index]) && unicode <= SWAPW(cmEndCodes[index])) {
+ if (cmIdRangeOffset[index] == 0) {
+ result = (LEGlyphID) unicode;
+ } else {
+ le_uint16 offset = unicode - SWAPW(cmStartCodes[index]);
+ le_uint16 rangeOffset = SWAPW(cmIdRangeOffset[index]);
+ le_uint16 *glyphIndexTable = (le_uint16 *) ((char *) &cmIdRangeOffset[index] + rangeOffset);
+
+ result = SWAPW(glyphIndexTable[offset]);
+ }
+
+ result += SWAPW(cmIdDelta[index]);
+ } else {
+ result = 0;
+ }
+
+ return result;
+}
+
+le_uint16 FontObject::getUnitsPerEM()
+{
+ if (headTable == NULL) {
+ LETag headTag = 0x68656164; // 'head'
+ le_uint32 length;
+
+ headTable = (HEADTable *) readTable(headTag, &length);
+ }
+
+ return SWAPW(headTable->unitsPerEm);
+}
+
+le_uint16 FontObject::getGlyphAdvance(LEGlyphID glyph)
+{
+ if (hmtxTable == NULL) {
+ LETag maxpTag = 0x6D617870; // 'maxp'
+ LETag hheaTag = 0x68686561; // 'hhea'
+ LETag hmtxTag = 0x686D7478; // 'hmtx'
+ le_uint32 length;
+ HHEATable *hheaTable;
+ MAXPTable *maxpTable = (MAXPTable *) readTable(maxpTag, &length);
+
+ numGlyphs = SWAPW(maxpTable->numGlyphs);
+ deleteTable(maxpTable);
+
+ hheaTable = (HHEATable *) readTable(hheaTag, &length);
+ numOfLongHorMetrics = SWAPW(hheaTable->numOfLongHorMetrics);
+ deleteTable(hheaTable);
+
+ hmtxTable = (HMTXTable *) readTable(hmtxTag, &length);
+ }
+
+ le_uint16 index = glyph;
+
+ if (glyph >= numGlyphs) {
+ return 0;
+ }
+
+ if (glyph >= numOfLongHorMetrics) {
+ index = numOfLongHorMetrics - 1;
+ }
+
+ return SWAPW(hmtxTable->hMetrics[index].advanceWidth);
+}
+
+
diff --git a/Build/source/libs/icu/icu-xetex/test/letest/FontObject.h b/Build/source/libs/icu/icu-xetex/test/letest/FontObject.h
new file mode 100644
index 00000000000..76af46b5ee5
--- /dev/null
+++ b/Build/source/libs/icu/icu-xetex/test/letest/FontObject.h
@@ -0,0 +1,235 @@
+/***************************************************************************
+*
+* Copyright (C) 1998-2002, International Business Machines
+* Corporation and others. All Rights Reserved.
+*
+************************************************************************/
+
+
+#ifndef __FONTOBJECT_H
+#define __FONTOBJECT_H
+
+#include <stdio.h>
+
+#include "LETypes.h"
+
+
+#ifndef ANY_NUMBER
+#define ANY_NUMBER 1
+#endif
+
+struct DirectoryEntry
+{
+ le_uint32 tag;
+ le_uint32 checksum;
+ le_uint32 offset;
+ le_uint32 length;
+};
+
+struct SFNTDirectory
+{
+ le_uint32 scalerType;
+ le_uint16 numTables;
+ le_uint16 searchRange;
+ le_uint16 entrySelector;
+ le_uint16 rangeShift;
+ DirectoryEntry tableDirectory[ANY_NUMBER];
+};
+
+
+struct CMAPEncodingSubtableHeader
+{
+ le_uint16 platformID;
+ le_uint16 platformSpecificID;
+ le_uint32 encodingOffset;
+};
+
+struct CMAPTable
+{
+ le_uint16 version;
+ le_uint16 numberSubtables;
+ CMAPEncodingSubtableHeader encodingSubtableHeaders[ANY_NUMBER];
+};
+
+struct CMAPEncodingSubtable
+{
+ le_uint16 format;
+ le_uint16 length;
+ le_uint16 language;
+};
+
+struct CMAPFormat0Encoding : CMAPEncodingSubtable
+{
+ le_uint8 glyphIndexArray[256];
+};
+
+struct CMAPFormat2Subheader
+{
+ le_uint16 firstCode;
+ le_uint16 entryCount;
+ le_int16 idDelta;
+ le_uint16 idRangeOffset;
+};
+
+struct CMAPFormat2Encoding : CMAPEncodingSubtable
+{
+ le_uint16 subHeadKeys[256];
+ CMAPFormat2Subheader subheaders[ANY_NUMBER];
+};
+
+struct CMAPFormat4Encoding : CMAPEncodingSubtable
+{
+ le_uint16 segCountX2;
+ le_uint16 searchRange;
+ le_uint16 entrySelector;
+ le_uint16 rangeShift;
+ le_uint16 endCodes[ANY_NUMBER];
+// le_uint16 reservedPad;
+// le_uint16 startCodes[ANY_NUMBER];
+// le_uint16 idDelta[ANY_NUMBER];
+// le_uint16 idRangeOffset[ANY_NUMBER];
+// le_uint16 glyphIndexArray[ANY_NUMBER];
+};
+
+struct CMAPFormat6Encoding : CMAPEncodingSubtable
+{
+ le_uint16 firstCode;
+ le_uint16 entryCount;
+ le_uint16 glyphIndexArray[ANY_NUMBER];
+};
+
+typedef le_int32 fixed;
+
+struct BigDate
+{
+ le_uint32 bc;
+ le_uint32 ad;
+};
+
+struct HEADTable
+{
+ fixed version;
+ fixed fontRevision;
+ le_uint32 checksumAdjustment;
+ le_uint32 magicNumber;
+ le_uint16 flags;
+ le_uint16 unitsPerEm;
+ BigDate created;
+ BigDate modified;
+ le_int16 xMin;
+ le_int16 yMin;
+ le_int16 xMax;
+ le_int16 yMax;
+ le_int16 lowestRecPPEM;
+ le_int16 fontDirectionHint;
+ le_int16 indexToLocFormat;
+ le_int16 glyphDataFormat;
+};
+
+struct MAXPTable
+{
+ fixed version;
+ le_uint16 numGlyphs;
+ le_uint16 maxPoints;
+ le_uint16 maxContours;
+ le_uint16 maxComponentPoints;
+ le_uint16 maxComponentContours;
+ le_uint16 maxZones;
+ le_uint16 maxTwilightPoints;
+ le_uint16 maxStorage;
+ le_uint16 maxFunctionDefs;
+ le_uint16 maxInstructionDefs;
+ le_uint16 maxStackElements;
+ le_uint16 maxSizeOfInstructions;
+ le_uint16 maxComponentElements;
+ le_uint16 maxComponentDepth;
+};
+
+struct HHEATable
+{
+ fixed version;
+ le_int16 ascent;
+ le_int16 descent;
+ le_int16 lineGap;
+ le_uint16 advanceWidthMax;
+ le_int16 minLeftSideBearing;
+ le_int16 minRightSideBearing;
+ le_int16 xMaxExtent;
+ le_int16 caretSlopeRise;
+ le_int16 caretSlopeRun;
+ le_int16 caretOffset;
+ le_int16 reserved1;
+ le_int16 reserved2;
+ le_int16 reserved3;
+ le_int16 reserved4;
+ le_int16 metricDataFormat;
+ le_uint16 numOfLongHorMetrics;
+};
+
+struct LongHorMetric
+{
+ le_uint16 advanceWidth;
+ le_int16 leftSideBearing;
+};
+
+struct HMTXTable
+{
+ LongHorMetric hMetrics[ANY_NUMBER]; // ANY_NUMBER = numOfLongHorMetrics from hhea table
+// le_int16 leftSideBearing[ANY_NUMBER]; // ANY_NUMBER = numGlyphs - numOfLongHorMetrics
+};
+
+class FontObject
+{
+public:
+ FontObject(char *fontName);
+ ~FontObject();
+
+ void *readTable(LETag tag, le_uint32 *length);
+ void deleteTable(void *table);
+
+ LEGlyphID unicodeToGlyph(LEUnicode32 unicode);
+
+#if 0
+ le_uint32 unicodesToGlyphs(LEUnicode *chars, le_uint32 nChars, LEGlyphID *glyphs,
+ le_uint32 *charIndices, le_bool rightToLeft);
+#endif
+
+ le_uint16 getUnitsPerEM();
+
+ le_uint16 getGlyphAdvance(LEGlyphID glyph);
+
+private:
+ FontObject();
+
+ DirectoryEntry *findTable(LETag tag);
+ CMAPEncodingSubtable *findCMAP(le_uint16 platformID, le_uint16 platformSpecificID);
+ void initUnicodeCMAP();
+
+ SFNTDirectory *directory;
+ le_uint16 numTables;
+ le_uint16 searchRange;
+ le_uint16 entrySelector;
+ le_uint16 rangeShift;
+
+ CMAPTable *cmapTable;
+ le_uint16 cmSegCount;
+ le_uint16 cmSearchRange;
+ le_uint16 cmEntrySelector;
+ le_uint16 cmRangeShift;
+ le_uint16 *cmEndCodes;
+ le_uint16 *cmStartCodes;
+ le_uint16 *cmIdDelta;
+ le_uint16 *cmIdRangeOffset;
+
+ HEADTable *headTable;
+
+ HMTXTable *hmtxTable;
+ le_uint16 numGlyphs;
+ le_uint16 numOfLongHorMetrics;
+
+ FILE *file;
+
+};
+
+#endif
+
diff --git a/Build/source/libs/icu/icu-xetex/test/letest/FontTableCache.cpp b/Build/source/libs/icu/icu-xetex/test/letest/FontTableCache.cpp
new file mode 100644
index 00000000000..cf28de2228b
--- /dev/null
+++ b/Build/source/libs/icu/icu-xetex/test/letest/FontTableCache.cpp
@@ -0,0 +1,86 @@
+/*
+ **********************************************************************
+ * Copyright (C) 2003-2006, International Business Machines
+ * Corporation and others. All Rights Reserved.
+ **********************************************************************
+ */
+
+#include "layout/LETypes.h"
+
+#include "letest.h"
+#include "FontTableCache.h"
+
+#define TABLE_CACHE_INIT 5
+#define TABLE_CACHE_GROW 5
+
+struct FontTableCacheEntry
+{
+ LETag tag;
+ const void *table;
+};
+
+FontTableCache::FontTableCache()
+ : fTableCacheCurr(0), fTableCacheSize(TABLE_CACHE_INIT)
+{
+ fTableCache = NEW_ARRAY(FontTableCacheEntry, fTableCacheSize);
+
+ if (fTableCache == NULL) {
+ fTableCacheSize = 0;
+ return;
+ }
+
+ for (int i = 0; i < fTableCacheSize; i += 1) {
+ fTableCache[i].tag = 0;
+ fTableCache[i].table = NULL;
+ }
+}
+
+FontTableCache::~FontTableCache()
+{
+ for (int i = fTableCacheCurr - 1; i >= 0; i -= 1) {
+ DELETE_ARRAY(fTableCache[i].table);
+
+ fTableCache[i].tag = 0;
+ fTableCache[i].table = NULL;
+ }
+
+ fTableCacheCurr = 0;
+
+ DELETE_ARRAY(fTableCache);
+}
+
+const void *FontTableCache::find(LETag tableTag) const
+{
+ for (int i = 0; i < fTableCacheCurr; i += 1) {
+ if (fTableCache[i].tag == tableTag) {
+ return fTableCache[i].table;
+ }
+ }
+
+ const void *table = readFontTable(tableTag);
+
+ ((FontTableCache *) this)->add(tableTag, table);
+
+ return table;
+}
+
+void FontTableCache::add(LETag tableTag, const void *table)
+{
+ if (fTableCacheCurr >= fTableCacheSize) {
+ le_int32 newSize = fTableCacheSize + TABLE_CACHE_GROW;
+
+ fTableCache = (FontTableCacheEntry *) GROW_ARRAY(fTableCache, newSize);
+
+ for (le_int32 i = fTableCacheSize; i < newSize; i += 1) {
+ fTableCache[i].tag = 0;
+ fTableCache[i].table = NULL;
+ }
+
+ fTableCacheSize = newSize;
+ }
+
+ fTableCache[fTableCacheCurr].tag = tableTag;
+ fTableCache[fTableCacheCurr].table = table;
+
+ fTableCacheCurr += 1;
+}
diff --git a/Build/source/libs/icu/icu-xetex/test/letest/FontTableCache.h b/Build/source/libs/icu/icu-xetex/test/letest/FontTableCache.h
new file mode 100644
index 00000000000..088d7aa7948
--- /dev/null
+++ b/Build/source/libs/icu/icu-xetex/test/letest/FontTableCache.h
@@ -0,0 +1,40 @@
+/*
+ **********************************************************************
+ * Copyright (C) 2003-2007, International Business Machines
+ * Corporation and others. All Rights Reserved.
+ **********************************************************************
+ */
+
+#ifndef __FONTTABLECACHE_H
+
+#define __FONTTABLECACHE_H
+
+#include "layout/LETypes.h"
+
+U_NAMESPACE_USE
+
+struct FontTableCacheEntry;
+
+class FontTableCache
+{
+public:
+ FontTableCache();
+
+ virtual ~FontTableCache();
+
+ const void *find(LETag tableTag) const;
+
+protected:
+ virtual const void *readFontTable(LETag tableTag) const = 0;
+
+private:
+
+ void add(LETag tableTag, const void *table);
+
+ FontTableCacheEntry *fTableCache;
+ le_int32 fTableCacheCurr;
+ le_int32 fTableCacheSize;
+};
+
+#endif
+
diff --git a/Build/source/libs/icu/icu-xetex/test/letest/Makefile.in b/Build/source/libs/icu/icu-xetex/test/letest/Makefile.in
new file mode 100644
index 00000000000..62138995d6d
--- /dev/null
+++ b/Build/source/libs/icu/icu-xetex/test/letest/Makefile.in
@@ -0,0 +1,105 @@
+## Makefile.in for ICU - test/letest
+## Copyright (c) 2001-2007, International Business Machines Corporation and
+## others. All Rights Reserved.
+
+## Source directory information
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+
+top_builddir = ../..
+
+include $(top_builddir)/icudefs.mk
+
+## Platform-specific setup
+include @platform_make_fragment@
+
+## Build directory information
+subdir = test/letest
+
+## Extra files to remove for 'make clean'
+CLEANFILES = *~ $(DEPS)
+
+## Target information
+TESTTARGET = letest
+GENTARGET = gendata
+
+BUILDDIR := $(CURR_SRCCODE_FULL_DIR)/../../
+# Simplify the path for Unix
+BUILDDIR := $(BUILDDIR:test/cintltst/../../=)
+# Simplify the path for Windows
+BUILDDIR := $(BUILDDIR:test\\cintltst/../../=)
+# Simplify the path for Windows 98
+BUILDDIR := $(BUILDDIR:TEST\\CINTLTST/../../=)
+
+ifneq ($(top_builddir),$(top_srcdir))
+CPPFLAGS += -I$(top_builddir)/common
+endif
+
+CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/ctestfw -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/layout -I$(top_srcdir)/layoutex -I$(top_srcdir)
+DEFS += -D'U_TOPSRCDIR="$(top_srcdir)/"' -D'U_TOPBUILDDIR="$(BUILDDIR)"'
+LIBS = $(LIBICULX) $(LIBICULE) $(LIBICUUC) $(LIBICUI18N) $(LIBCTESTFW) $(LIBICUTOOLUTIL) @LIBS@ @LIB_M@
+
+COMMONOBJECTS = letsutil.o cmaps.o FontTableCache.o SimpleFontInstance.o PortableFontInstance.o
+TESTOBJECTS = letest.o
+CTESTOBJECTS = cfonts.o xmlreader.o cletest.o
+GENOBJECTS = gendata.o
+
+OBJECTS = $(COMMONOBJECTS) $(TESTOBJECTS) $(GENOBJECTS)
+
+DEPS = $(OBJECTS:.o=.d)
+
+## List of phony targets
+.PHONY : all all-local install install-local clean clean-local \
+distclean distclean-local dist dist-local check check-local
+
+## Clear suffix list
+.SUFFIXES :
+
+## List of standard targets
+all: all-local
+install: install-local
+clean: clean-local
+distclean : distclean-local
+dist: dist-local
+check: all check-local
+
+all-local: $(TESTTARGET)
+
+install-local:
+
+dist-local:
+
+clean-local:
+ test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
+ $(RMV) $(COMMONOBJECTS) $(TESTOBJECTS) $(CTESTOBJECTS) $(GENOBJECTS) $(TARGET)
+
+distclean-local: clean-local
+ $(RMV) Makefile
+
+check-local: all-local
+ $(INVOKE) ./$(TESTTARGET)
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+$(TESTTARGET) : $(COMMONOBJECTS) $(TESTOBJECTS) $(CTESTOBJECTS)
+ $(LINK.cc) -o $@ $^ $(LIBS)
+ $(POST_BUILD_STEP)
+
+$(GENTARGET) : $(COMMONOBJECTS) $(GENOBJECTS)
+ $(LINK.cc) -o $@ $^ $(LIBS)
+ $(POST_BUILD_STEP)
+
+invoke:
+ ICU_DATA=$${ICU_DATA:-$(top_builddir)/data/} TZ=PST8PDT $(INVOKE) $(INVOCATION)
+
+ifeq (,$(MAKECMDGOALS))
+-include $(DEPS)
+else
+ifneq ($(patsubst %clean,,$(MAKECMDGOALS)),)
+ifneq ($(patsubst %install,,$(MAKECMDGOALS)),)
+-include $(DEPS)
+endif
+endif
+endif
diff --git a/Build/source/libs/icu/icu-xetex/test/letest/PortableFontInstance.cpp b/Build/source/libs/icu/icu-xetex/test/letest/PortableFontInstance.cpp
new file mode 100644
index 00000000000..db5bf2fd16d
--- /dev/null
+++ b/Build/source/libs/icu/icu-xetex/test/letest/PortableFontInstance.cpp
@@ -0,0 +1,441 @@
+/*
+ *******************************************************************************
+ *
+ * Copyright (C) 1999-2008, International Business Machines
+ * Corporation and others. All Rights Reserved.
+ *
+ *******************************************************************************
+ * file name: PortableFontInstance.cpp
+ *
+ * created on: 11/22/1999
+ * created by: Eric R. Mader
+ */
+
+#include <stdio.h>
+
+#include "layout/LETypes.h"
+#include "layout/LEFontInstance.h"
+#include "layout/LESwaps.h"
+
+#include "PortableFontInstance.h"
+
+#include "letest.h"
+#include "sfnt.h"
+
+#include <string.h>
+
+//
+// Finds the high bit by binary searching
+// through the bits in n.
+//
+le_int8 PortableFontInstance::highBit(le_int32 value)
+{
+ if (value <= 0) {
+ return -32;
+ }
+
+ le_uint8 bit = 0;
+
+ if (value >= 1 << 16) {
+ value >>= 16;
+ bit += 16;
+ }
+
+ if (value >= 1 << 8) {
+ value >>= 8;
+ bit += 8;
+ }
+
+ if (value >= 1 << 4) {
+ value >>= 4;
+ bit += 4;
+ }
+
+ if (value >= 1 << 2) {
+ value >>= 2;
+ bit += 2;
+ }
+
+ if (value >= 1 << 1) {
+ value >>= 1;
+ bit += 1;
+ }
+
+ return bit;
+}
+
+PortableFontInstance::PortableFontInstance(const char *fileName, float pointSize, LEErrorCode &status)
+ : fFile(NULL), fPointSize(pointSize), fUnitsPerEM(0), fFontChecksum(0), fAscent(0), fDescent(0), fLeading(0),
+ fDirectory(NULL), fNAMETable(NULL), fNameCount(0), fNameStringOffset(0), fCMAPMapper(NULL), fHMTXTable(NULL), fNumGlyphs(0), fNumLongHorMetrics(0)
+{
+ if (LE_FAILURE(status)) {
+ return;
+ }
+
+ // open the font file
+ fFile = fopen(fileName, "rb");
+
+ if (fFile == NULL) {
+ status = LE_FONT_FILE_NOT_FOUND_ERROR;
+ return;
+ }
+
+ // read in the directory
+ SFNTDirectory tempDir;
+
+ fread(&tempDir, sizeof tempDir, 1, fFile);
+
+ le_int32 dirSize = sizeof tempDir + ((SWAPW(tempDir.numTables) - ANY_NUMBER) * sizeof(DirectoryEntry));
+ const LETag headTag = LE_HEAD_TABLE_TAG;
+ const LETag hheaTag = LE_HHEA_TABLE_TAG;
+ const HEADTable *headTable = NULL;
+ const HHEATable *hheaTable = NULL;
+// const NAMETable *nameTable = NULL;
+ le_uint16 numTables = 0;
+
+ fDirectory = (const SFNTDirectory *) NEW_ARRAY(char, dirSize);
+
+ if (fDirectory == NULL) {
+ status = LE_MEMORY_ALLOCATION_ERROR;
+ goto error_exit;
+ }
+
+ fseek(fFile, 0L, SEEK_SET);
+ fread((void *) fDirectory, sizeof(char), dirSize, fFile);
+
+ //
+ // We calculate these numbers 'cause some fonts
+ // have bogus values for them in the directory header.
+ //
+ numTables = SWAPW(fDirectory->numTables);
+ fDirPower = 1 << highBit(numTables);
+ fDirExtra = numTables - fDirPower;
+
+ // read unitsPerEm from 'head' table
+ headTable = (const HEADTable *) readFontTable(headTag);
+
+ if (headTable == NULL) {
+ status = LE_MISSING_FONT_TABLE_ERROR;
+ goto error_exit;
+ }
+
+ fUnitsPerEM = SWAPW(headTable->unitsPerEm);
+ fFontChecksum = SWAPL(headTable->checksumAdjustment);
+ deleteTable(headTable);
+
+ //nameTable = (NAMETable *) readFontTable(nameTag);
+
+ //if (nameTable == NULL) {
+ // status = LE_MISSING_FONT_TABLE_ERROR;
+ // goto error_exit;
+ //}
+
+ //fFontVersionString = findName(nameTable, NAME_VERSION_STRING, PLATFORM_MACINTOSH, MACINTOSH_ROMAN, MACINTOSH_ENGLISH);
+
+ //if (fFontVersionString == NULL) {
+ // status = LE_MISSING_FONT_TABLE_ERROR;
+ // goto error_exit;
+ //}
+
+ //deleteTable(nameTable);
+
+ hheaTable = (HHEATable *) readFontTable(hheaTag);
+
+ if (hheaTable == NULL) {
+ status = LE_MISSING_FONT_TABLE_ERROR;
+ goto error_exit;
+ }
+
+ fAscent = (le_int32) yUnitsToPoints((float) SWAPW(hheaTable->ascent));
+ fDescent = (le_int32) yUnitsToPoints((float) SWAPW(hheaTable->descent));
+ fLeading = (le_int32) yUnitsToPoints((float) SWAPW(hheaTable->lineGap));
+
+ fNumLongHorMetrics = SWAPW(hheaTable->numOfLongHorMetrics);
+
+ deleteTable((void *) hheaTable);
+
+ fCMAPMapper = findUnicodeMapper();
+
+ if (fCMAPMapper == NULL) {
+ status = LE_MISSING_FONT_TABLE_ERROR;
+ goto error_exit;
+ }
+
+ return;
+
+error_exit:
+ fclose(fFile);
+ fFile = NULL;
+ return;
+}
+
+PortableFontInstance::~PortableFontInstance()
+{
+ if (fFile != NULL) {
+ fclose(fFile);
+
+ deleteTable(fHMTXTable);
+ deleteTable(fNAMETable);
+
+ delete fCMAPMapper;
+
+ DELETE_ARRAY(fDirectory);
+ }
+}
+
+void PortableFontInstance::deleteTable(const void *table) const
+{
+ DELETE_ARRAY(table);
+}
+
+const DirectoryEntry *PortableFontInstance::findTable(LETag tag) const
+{
+ if (fDirectory != NULL) {
+ le_uint16 table = 0;
+ le_uint16 probe = fDirPower;
+
+ if (SWAPL(fDirectory->tableDirectory[fDirExtra].tag) <= tag) {
+ table = fDirExtra;
+ }
+
+ while (probe > (1 << 0)) {
+ probe >>= 1;
+
+ if (SWAPL(fDirectory->tableDirectory[table + probe].tag) <= tag) {
+ table += probe;
+ }
+ }
+
+ if (SWAPL(fDirectory->tableDirectory[table].tag) == tag) {
+ return &fDirectory->tableDirectory[table];
+ }
+ }
+
+ return NULL;
+}
+
+const void *PortableFontInstance::readTable(LETag tag, le_uint32 *length) const
+{
+ const DirectoryEntry *entry = findTable(tag);
+
+ if (entry == NULL) {
+ *length = 0;
+ return NULL;
+ }
+
+ *length = SWAPL(entry->length);
+
+ void *table = NEW_ARRAY(char, *length);
+
+ if (table != NULL) {
+ fseek(fFile, SWAPL(entry->offset), SEEK_SET);
+ fread(table, sizeof(char), *length, fFile);
+ }
+
+ return table;
+}
+
+const void *PortableFontInstance::getFontTable(LETag tableTag) const
+{
+ return FontTableCache::find(tableTag);
+}
+
+const void *PortableFontInstance::readFontTable(LETag tableTag) const
+{
+ le_uint32 len;
+
+ return readTable(tableTag, &len);
+}
+
+CMAPMapper *PortableFontInstance::findUnicodeMapper()
+{
+ LETag cmapTag = LE_CMAP_TABLE_TAG;
+ const CMAPTable *cmap = (CMAPTable *) readFontTable(cmapTag);
+
+ if (cmap == NULL) {
+ return NULL;
+ }
+
+ return CMAPMapper::createUnicodeMapper(cmap);
+}
+
+const char *PortableFontInstance::getNameString(le_uint16 nameID, le_uint16 platformID, le_uint16 encodingID, le_uint16 languageID) const
+{
+ if (fNAMETable == NULL) {
+ LETag nameTag = LE_NAME_TABLE_TAG;
+ PortableFontInstance *realThis = (PortableFontInstance *) this;
+
+ realThis->fNAMETable = (const NAMETable *) readFontTable(nameTag);
+
+ if (realThis->fNAMETable != NULL) {
+ realThis->fNameCount = SWAPW(realThis->fNAMETable->count);
+ realThis->fNameStringOffset = SWAPW(realThis->fNAMETable->stringOffset);
+ }
+ }
+
+ for(le_int32 i = 0; i < fNameCount; i += 1) {
+ const NameRecord *nameRecord = &fNAMETable->nameRecords[i];
+
+ if (SWAPW(nameRecord->platformID) == platformID && SWAPW(nameRecord->encodingID) == encodingID &&
+ SWAPW(nameRecord->languageID) == languageID && SWAPW(nameRecord->nameID) == nameID) {
+ char *name = ((char *) fNAMETable) + fNameStringOffset + SWAPW(nameRecord->offset);
+ le_uint16 length = SWAPW(nameRecord->length);
+ char *result = NEW_ARRAY(char, length + 2);
+
+ ARRAY_COPY(result, name, length);
+ result[length] = result[length + 1] = 0;
+
+ return result;
+ }
+ }
+
+ return NULL;
+}
+
+const LEUnicode16 *PortableFontInstance::getUnicodeNameString(le_uint16 nameID, le_uint16 platformID, le_uint16 encodingID, le_uint16 languageID) const
+{
+ if (fNAMETable == NULL) {
+ LETag nameTag = LE_NAME_TABLE_TAG;
+ PortableFontInstance *realThis = (PortableFontInstance *) this;
+
+ realThis->fNAMETable = (const NAMETable *) readFontTable(nameTag);
+
+ if (realThis->fNAMETable != NULL) {
+ realThis->fNameCount = SWAPW(realThis->fNAMETable->count);
+ realThis->fNameStringOffset = SWAPW(realThis->fNAMETable->stringOffset);
+ }
+ }
+
+ for(le_int32 i = 0; i < fNameCount; i += 1) {
+ const NameRecord *nameRecord = &fNAMETable->nameRecords[i];
+
+ if (SWAPW(nameRecord->platformID) == platformID && SWAPW(nameRecord->encodingID) == encodingID &&
+ SWAPW(nameRecord->languageID) == languageID && SWAPW(nameRecord->nameID) == nameID) {
+ LEUnicode16 *name = (LEUnicode16 *) (((char *) fNAMETable) + fNameStringOffset + SWAPW(nameRecord->offset));
+ le_uint16 length = SWAPW(nameRecord->length) / 2;
+ LEUnicode16 *result = NEW_ARRAY(LEUnicode16, length + 2);
+
+ for (le_int32 c = 0; c < length; c += 1) {
+ result[c] = SWAPW(name[c]);
+ }
+
+ result[length] = 0;
+
+ return result;
+ }
+ }
+
+ return NULL;
+}
+
+void PortableFontInstance::deleteNameString(const char *name) const
+{
+ DELETE_ARRAY(name);
+}
+
+void PortableFontInstance::deleteNameString(const LEUnicode16 *name) const
+{
+ DELETE_ARRAY(name);
+}
+
+void PortableFontInstance::getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const
+{
+ TTGlyphID ttGlyph = (TTGlyphID) LE_GET_GLYPH(glyph);
+
+ if (fHMTXTable == NULL) {
+ LETag maxpTag = LE_MAXP_TABLE_TAG;
+ LETag hmtxTag = LE_HMTX_TABLE_TAG;
+ const MAXPTable *maxpTable = (MAXPTable *) readFontTable(maxpTag);
+ PortableFontInstance *realThis = (PortableFontInstance *) this;
+
+ if (maxpTable != NULL) {
+ realThis->fNumGlyphs = SWAPW(maxpTable->numGlyphs);
+ deleteTable(maxpTable);
+ }
+
+ realThis->fHMTXTable = (const HMTXTable *) readFontTable(hmtxTag);
+ }
+
+ le_uint16 index = ttGlyph;
+
+ if (ttGlyph >= fNumGlyphs || fHMTXTable == NULL) {
+ advance.fX = advance.fY = 0;
+ return;
+ }
+
+ if (ttGlyph >= fNumLongHorMetrics) {
+ index = fNumLongHorMetrics - 1;
+ }
+
+ advance.fX = xUnitsToPoints(SWAPW(fHMTXTable->hMetrics[index].advanceWidth));
+ advance.fY = 0;
+}
+
+le_bool PortableFontInstance::getGlyphPoint(LEGlyphID /*glyph*/, le_int32 /*pointNumber*/, LEPoint &/*point*/) const
+{
+ return FALSE;
+}
+
+le_int32 PortableFontInstance::getUnitsPerEM() const
+{
+ return fUnitsPerEM;
+}
+
+le_uint32 PortableFontInstance::getFontChecksum() const
+{
+ return fFontChecksum;
+}
+
+le_int32 PortableFontInstance::getAscent() const
+{
+ return fAscent;
+}
+
+le_int32 PortableFontInstance::getDescent() const
+{
+ return fDescent;
+}
+
+le_int32 PortableFontInstance::getLeading() const
+{
+ return fLeading;
+}
+
+// We really want to inherit this method from the superclass, but some compilers
+// issue a warning if we don't implement it...
+LEGlyphID PortableFontInstance::mapCharToGlyph(LEUnicode32 ch, const LECharMapper *mapper, le_bool filterZeroWidth) const
+{
+ return LEFontInstance::mapCharToGlyph(ch, mapper, filterZeroWidth);
+}
+
+// We really want to inherit this method from the superclass, but some compilers
+// issue a warning if we don't implement it...
+LEGlyphID PortableFontInstance::mapCharToGlyph(LEUnicode32 ch, const LECharMapper *mapper) const
+{
+ return LEFontInstance::mapCharToGlyph(ch, mapper);
+}
+
+LEGlyphID PortableFontInstance::mapCharToGlyph(LEUnicode32 ch) const
+{
+ return fCMAPMapper->unicodeToGlyph(ch);
+}
+
+float PortableFontInstance::getXPixelsPerEm() const
+{
+ return fPointSize;
+}
+
+float PortableFontInstance::getYPixelsPerEm() const
+{
+ return fPointSize;
+}
+
+float PortableFontInstance::getScaleFactorX() const
+{
+ return 1.0;
+}
+
+float PortableFontInstance::getScaleFactorY() const
+{
+ return 1.0;
+}
diff --git a/Build/source/libs/icu/icu-xetex/test/letest/PortableFontInstance.h b/Build/source/libs/icu/icu-xetex/test/letest/PortableFontInstance.h
new file mode 100644
index 00000000000..e47cb65b197
--- /dev/null
+++ b/Build/source/libs/icu/icu-xetex/test/letest/PortableFontInstance.h
@@ -0,0 +1,118 @@
+
+/*
+ *******************************************************************************
+ *
+ * Copyright (C) 1999-2008, International Business Machines
+ * Corporation and others. All Rights Reserved.
+ *
+ *******************************************************************************
+ * file name: PortableFontInstance.h
+ *
+ * created on: 11/12/1999
+ * created by: Eric R. Mader
+ */
+
+#ifndef __PORTABLEFONTINSTANCE_H
+#define __PORTABLEFONTINSTANCE_H
+
+#include <stdio.h>
+
+#include "layout/LETypes.h"
+#include "layout/LEFontInstance.h"
+
+#include "FontTableCache.h"
+
+#include "sfnt.h"
+#include "cmaps.h"
+
+class PortableFontInstance : public LEFontInstance, protected FontTableCache
+{
+private:
+ FILE *fFile;
+
+ float fPointSize;
+ le_int32 fUnitsPerEM;
+ le_uint32 fFontChecksum;
+ le_int32 fAscent;
+ le_int32 fDescent;
+ le_int32 fLeading;
+
+ const SFNTDirectory *fDirectory;
+ le_uint16 fDirPower;
+ le_uint16 fDirExtra;
+
+ float fDeviceScaleX;
+ float fDeviceScaleY;
+
+ const NAMETable *fNAMETable;
+ le_uint16 fNameCount;
+ le_uint16 fNameStringOffset;
+
+ CMAPMapper *fCMAPMapper;
+
+ const HMTXTable *fHMTXTable;
+ le_uint16 fNumGlyphs;
+ le_uint16 fNumLongHorMetrics;
+
+ static le_int8 highBit(le_int32 value);
+
+ const DirectoryEntry *findTable(LETag tag) const;
+ const void *readTable(LETag tag, le_uint32 *length) const;
+ void deleteTable(const void *table) const;
+ void getMetrics();
+
+ CMAPMapper *findUnicodeMapper();
+
+protected:
+ const void *readFontTable(LETag tableTag) const;
+
+public:
+ PortableFontInstance(const char *fileName, float pointSize, LEErrorCode &status);
+
+ virtual ~PortableFontInstance();
+
+ virtual const void *getFontTable(LETag tableTag) const;
+
+ virtual const char *getNameString(le_uint16 nameID, le_uint16 platform, le_uint16 encoding, le_uint16 language) const;
+
+ virtual const LEUnicode16 *getUnicodeNameString(le_uint16 nameID, le_uint16 platform, le_uint16 encoding, le_uint16 language) const;
+
+ virtual void deleteNameString(const char *name) const;
+
+ virtual void deleteNameString(const LEUnicode16 *name) const;
+
+ virtual le_int32 getUnitsPerEM() const;
+
+ virtual le_uint32 getFontChecksum() const;
+
+ virtual le_int32 getAscent() const;
+
+ virtual le_int32 getDescent() const;
+
+ virtual le_int32 getLeading() const;
+
+ // We really want to inherit this method from the superclass, but some compilers
+ // issue a warning if we don't implement it...
+ virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch, const LECharMapper *mapper, le_bool filterZeroWidth) const;
+
+ // We really want to inherit this method from the superclass, but some compilers
+ // issue a warning if we don't implement it...
+ virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch, const LECharMapper *mapper) const;
+
+ virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch) const;
+
+ virtual void getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const;
+
+ virtual le_bool getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &point) const;
+
+ float getXPixelsPerEm() const;
+
+ float getYPixelsPerEm() const;
+
+ float getScaleFactorX() const;
+
+ float getScaleFactorY() const;
+
+};
+
+#endif
diff --git a/Build/source/libs/icu/icu-xetex/test/letest/SimpleFontInstance.cpp b/Build/source/libs/icu/icu-xetex/test/letest/SimpleFontInstance.cpp
new file mode 100644
index 00000000000..fa5aaedda0a
--- /dev/null
+++ b/Build/source/libs/icu/icu-xetex/test/letest/SimpleFontInstance.cpp
@@ -0,0 +1,132 @@
+/*
+ *******************************************************************************
+ *
+ * Copyright (C) 1999-2007, International Business Machines
+ * Corporation and others. All Rights Reserved.
+ *
+ *******************************************************************************
+ * file name: SimpleFontInstance.cpp
+ *
+ * created on: 03/30/2006
+ * created by: Eric R. Mader
+ */
+
+#include "unicode/utypes.h"
+#include "unicode/uchar.h"
+
+#include "layout/LETypes.h"
+#include "layout/LEFontInstance.h"
+
+#include "CanonShaping.h"
+#include "SimpleFontInstance.h"
+
+SimpleFontInstance::SimpleFontInstance(float pointSize, LEErrorCode &status)
+ : fPointSize(pointSize), fAscent(0), fDescent(0)
+{
+ if (LE_FAILURE(status)) {
+ return;
+ }
+
+ fAscent = (le_int32) yUnitsToPoints(2000.0);
+ fDescent = (le_int32) yUnitsToPoints(600.0);
+
+ return;
+}
+
+SimpleFontInstance::~SimpleFontInstance()
+{
+ // nothing to do...
+}
+
+const void *SimpleFontInstance::getFontTable(LETag tableTag) const
+{
+ if (tableTag == LE_GSUB_TABLE_TAG) {
+ return CanonShaping::glyphSubstitutionTable;
+ }
+
+ if (tableTag == LE_GDEF_TABLE_TAG) {
+ return CanonShaping::glyphDefinitionTable;
+ }
+
+ return NULL;
+}
+
+void SimpleFontInstance::getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const
+{
+#if 0
+ if (u_getCombiningClass((UChar32) glyph) == 0) {
+ advance.fX = xUnitsToPoints(2048);
+ } else {
+ advance.fX = 0;
+ }
+#else
+ advance.fX = xUnitsToPoints(2048);
+#endif
+
+ advance.fY = 0;
+}
+
+le_int32 SimpleFontInstance::getUnitsPerEM() const
+{
+ return 2048;
+}
+
+le_int32 SimpleFontInstance::getAscent() const
+{
+ return fAscent;
+}
+
+le_int32 SimpleFontInstance::getDescent() const
+{
+ return fDescent;
+}
+
+le_int32 SimpleFontInstance::getLeading() const
+{
+ return 0;
+}
+
+// We really want to inherit this method from the superclass, but some compilers
+// issue a warning if we don't implement it...
+LEGlyphID SimpleFontInstance::mapCharToGlyph(LEUnicode32 ch, const LECharMapper *mapper, le_bool filterZeroWidth) const
+{
+ return LEFontInstance::mapCharToGlyph(ch, mapper, filterZeroWidth);
+}
+
+// We really want to inherit this method from the superclass, but some compilers
+// issue a warning if we don't implement it...
+LEGlyphID SimpleFontInstance::mapCharToGlyph(LEUnicode32 ch, const LECharMapper *mapper) const
+{
+ return LEFontInstance::mapCharToGlyph(ch, mapper);
+}
+
+LEGlyphID SimpleFontInstance::mapCharToGlyph(LEUnicode32 ch) const
+{
+ return (LEGlyphID) ch;
+}
+
+float SimpleFontInstance::getXPixelsPerEm() const
+{
+ return fPointSize;
+}
+
+float SimpleFontInstance::getYPixelsPerEm() const
+{
+ return fPointSize;
+}
+
+float SimpleFontInstance::getScaleFactorX() const
+{
+ return 1.0;
+}
+
+float SimpleFontInstance::getScaleFactorY() const
+{
+ return 1.0;
+}
+
+le_bool SimpleFontInstance::getGlyphPoint(LEGlyphID /*glyph*/, le_int32 /*pointNumber*/, LEPoint &/*point*/) const
+{
+ return FALSE;
+}
+
diff --git a/Build/source/libs/icu/icu-xetex/test/letest/SimpleFontInstance.h b/Build/source/libs/icu/icu-xetex/test/letest/SimpleFontInstance.h
new file mode 100644
index 00000000000..9c13659dc29
--- /dev/null
+++ b/Build/source/libs/icu/icu-xetex/test/letest/SimpleFontInstance.h
@@ -0,0 +1,71 @@
+/*
+ *******************************************************************************
+ *
+ * Copyright (C) 1999-2007, International Business Machines
+ * Corporation and others. All Rights Reserved.
+ *
+ *******************************************************************************
+ * file name: SimpleFontInstance.h
+ *
+ * created on: 03/30/2006
+ * created by: Eric R. Mader
+ */
+
+#ifndef __SIMPLEFONTINSTANCE_H
+#define __SIMPLEFONTINSTANCE_H
+
+#include "layout/LETypes.h"
+#include "layout/LEFontInstance.h"
+
+U_NAMESPACE_USE
+
+class SimpleFontInstance : public LEFontInstance
+{
+private:
+ float fPointSize;
+ le_int32 fAscent;
+ le_int32 fDescent;
+
+protected:
+ const void *readFontTable(LETag tableTag) const;
+
+public:
+ SimpleFontInstance(float pointSize, LEErrorCode &status);
+
+ virtual ~SimpleFontInstance();
+
+ virtual const void *getFontTable(LETag tableTag) const;
+
+ virtual le_int32 getUnitsPerEM() const;
+
+ virtual le_int32 getAscent() const;
+
+ virtual le_int32 getDescent() const;
+
+ virtual le_int32 getLeading() const;
+
+ // We really want to inherit this method from the superclass, but some compilers
+ // issue a warning if we don't implement it...
+ virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch, const LECharMapper *mapper, le_bool filterZeroWidth) const;
+
+ // We really want to inherit this method from the superclass, but some compilers
+ // issue a warning if we don't implement it...
+ virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch, const LECharMapper *mapper) const;
+
+ virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch) const;
+
+ virtual void getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const;
+
+ virtual le_bool getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &point) const;
+
+ float getXPixelsPerEm() const;
+
+ float getYPixelsPerEm() const;
+
+ float getScaleFactorX() const;
+
+ float getScaleFactorY() const;
+
+};
+
+#endif
diff --git a/Build/source/libs/icu/icu-xetex/test/letest/cfonts.cpp b/Build/source/libs/icu/icu-xetex/test/letest/cfonts.cpp
new file mode 100644
index 00000000000..a06ec08d5fd
--- /dev/null
+++ b/Build/source/libs/icu/icu-xetex/test/letest/cfonts.cpp
@@ -0,0 +1,55 @@
+/*
+ *
+ * (C) Copyright IBM Corp. 1998-2007 - All Rights Reserved
+ *
+ */
+
+#include "LETypes.h"
+#include "loengine.h"
+#include "PortableFontInstance.h"
+#include "SimpleFontInstance.h"
+
+U_CDECL_BEGIN
+
+le_font *le_portableFontOpen(const char *fileName,
+ float pointSize,
+ LEErrorCode *status)
+{
+ return (le_font *) new PortableFontInstance(fileName, pointSize, *status);
+}
+
+le_font *le_simpleFontOpen(float pointSize,
+ LEErrorCode *status)
+{
+ return (le_font *) new SimpleFontInstance(pointSize, *status);
+}
+
+void le_fontClose(le_font *font)
+{
+ LEFontInstance *fontInstance = (LEFontInstance *) font;
+
+ delete fontInstance;
+}
+
+const char *le_getNameString(le_font *font, le_uint16 nameID, le_uint16 platform, le_uint16 encoding, le_uint16 language)
+{
+ PortableFontInstance *pfi = (PortableFontInstance *) font;
+
+ return pfi->getNameString(nameID, platform, encoding, language);
+}
+
+void le_deleteNameString(le_font *font, const char *name)
+{
+ PortableFontInstance *pfi = (PortableFontInstance *) font;
+
+ pfi->deleteNameString(name);
+}
+
+le_uint32 le_getFontChecksum(le_font *font)
+{
+ PortableFontInstance *pfi = (PortableFontInstance *) font;
+
+ return pfi->getFontChecksum();
+}
+
+U_CDECL_END
diff --git a/Build/source/libs/icu/icu-xetex/test/letest/cfonts.h b/Build/source/libs/icu/icu-xetex/test/letest/cfonts.h
new file mode 100644
index 00000000000..2dda8a2a283
--- /dev/null
+++ b/Build/source/libs/icu/icu-xetex/test/letest/cfonts.h
@@ -0,0 +1,28 @@
+/*
+ *
+ * (C) Copyright IBM Corp. 1998-2007 - All Rights Reserved
+ *
+ */
+
+#ifndef __CFONTS_H
+#define __CFONTS_H
+
+#include "LETypes.h"
+#include "loengine.h"
+
+le_font *le_portableFontOpen(const char *fileName,
+ float pointSize,
+ LEErrorCode *status);
+
+le_font *le_simpleFontOpen(float pointSize,
+ LEErrorCode *status);
+
+void le_fontClose(le_font *font);
+
+const char *le_getNameString(le_font *font, le_uint16 nameID, le_uint16 platform, le_uint16 encoding, le_uint16 language);
+
+void le_deleteNameString(le_font *font, const char *name);
+
+le_uint32 le_getFontChecksum(le_font *font);
+
+#endif
diff --git a/Build/source/libs/icu/icu-xetex/test/letest/cletest.c b/Build/source/libs/icu/icu-xetex/test/letest/cletest.c
new file mode 100644
index 00000000000..fdd5a5f0e1e
--- /dev/null
+++ b/Build/source/libs/icu/icu-xetex/test/letest/cletest.c
@@ -0,0 +1,726 @@
+/*
+ *******************************************************************************
+ *
+ * Copyright (C) 1999-2007, International Business Machines
+ * Corporation and others. All Rights Reserved.
+ *
+ *******************************************************************************
+ */
+
+#include "unicode/utypes.h"
+#include "unicode/ubidi.h"
+#include "unicode/uscript.h"
+#include "unicode/ctest.h"
+
+#include "layout/LETypes.h"
+#include "layout/LEScripts.h"
+#include "layout/loengine.h"
+
+#include "layout/playout.h"
+#include "layout/plruns.h"
+
+#include "cfonts.h"
+
+#include "letest.h"
+
+#include "sfnt.h"
+#include "xmlreader.h"
+#include "putilimp.h" /* for U_FILE_SEP_STRING */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#define CH_COMMA 0x002C
+
+U_CDECL_BEGIN
+static void U_CALLCONV ParamTest(void)
+{
+ LEErrorCode status = LE_NO_ERROR;
+ le_font *font = le_simpleFontOpen(12, &status);
+ le_engine *engine = le_create(font, arabScriptCode, -1, 0, &status);
+ LEGlyphID *glyphs = NULL;
+ le_int32 *indices = NULL;
+ float *positions = NULL;
+ le_int32 glyphCount = 0;
+
+ float x = 0.0, y = 0.0;
+ LEUnicode chars[] = {
+ 0x0045, 0x006E, 0x0067, 0x006C, 0x0069, 0x0073, 0x0068, 0x0020, /* "English " */
+ 0x0645, 0x0627, 0x0646, 0x062A, 0x0648, 0x0634, /* MEM ALIF KAF NOON TEH WAW SHEEN */
+ 0x0020, 0x0074, 0x0065, 0x0078, 0x0074, 0x02E /* " text." */
+ };
+
+
+ glyphCount = le_getGlyphCount(engine, &status);
+ if (glyphCount != 0) {
+ log_err("Calling getGlyphCount() on an empty layout returned %d.\n", glyphCount);
+ }
+
+ glyphs = NEW_ARRAY(LEGlyphID, glyphCount + 10);
+ indices = NEW_ARRAY(le_int32, glyphCount + 10);
+ positions = NEW_ARRAY(float, glyphCount + 10);
+
+ le_getGlyphs(engine, NULL, &status);
+
+ if (status != LE_ILLEGAL_ARGUMENT_ERROR) {
+ log_err("Calling getGlyphs(NULL, status) did not return LE_ILLEGAL_ARGUMENT_ERROR.\n");
+ }
+
+ status = LE_NO_ERROR;
+ le_getGlyphs(engine, glyphs, &status);
+
+ if (status != LE_NO_LAYOUT_ERROR) {
+ log_err("Calling getGlyphs(glyphs, status) on an empty layout did not return LE_NO_LAYOUT_ERROR.\n");
+ }
+
+ status = LE_NO_ERROR;
+ le_getCharIndices(engine, NULL, &status);
+
+ if (status != LE_ILLEGAL_ARGUMENT_ERROR) {
+ log_err("Calling getCharIndices(NULL, status) did not return LE_ILLEGAL_ARGUMENT_ERROR.\n");
+ }
+
+ status = LE_NO_ERROR;
+ le_getCharIndices(engine, indices, &status);
+
+ if (status != LE_NO_LAYOUT_ERROR) {
+ log_err("Calling getCharIndices(indices, status) on an empty layout did not return LE_NO_LAYOUT_ERROR.\n");
+ }
+
+ status = LE_NO_ERROR;
+ le_getCharIndicesWithBase(engine, NULL, 1024, &status);
+
+ if (status != LE_ILLEGAL_ARGUMENT_ERROR) {
+ log_err("Calling getCharIndices(NULL, 1024, status) did not return LE_ILLEGAL_ARGUMENT_ERROR.\n");
+ }
+
+ status = LE_NO_ERROR;
+ le_getCharIndicesWithBase(engine, indices, 1024, &status);
+
+ if (status != LE_NO_LAYOUT_ERROR) {
+ log_err("Calling getCharIndices(indices, 1024, status) on an empty layout did not return LE_NO_LAYOUT_ERROR.\n");
+ }
+
+ status = LE_NO_ERROR;
+ le_getGlyphPositions(engine, NULL, &status);
+
+ if (status != LE_ILLEGAL_ARGUMENT_ERROR) {
+ log_err("Calling getGlyphPositions(NULL, status) did not return LE_ILLEGAL_ARGUMENT_ERROR.\n");
+ }
+
+ status = LE_NO_ERROR;
+ le_getGlyphPositions(engine, positions, &status);
+
+ if (status != LE_NO_LAYOUT_ERROR) {
+ log_err("Calling getGlyphPositions(positions, status) on an empty layout did not return LE_NO_LAYOUT_ERROR.\n");
+ }
+
+ DELETE_ARRAY(positions);
+ DELETE_ARRAY(indices);
+ DELETE_ARRAY(glyphs);
+
+ status = LE_NO_ERROR;
+ glyphCount = le_layoutChars(engine, NULL, 0, 0, 0, FALSE, 0.0, 0.0, &status);
+
+ if (status != LE_ILLEGAL_ARGUMENT_ERROR) {
+ log_err("Calling layoutChars(NULL, 0, 0, 0, FALSE, 0.0, 0.0, status) did not fail w/ LE_ILLEGAL_ARGUMENT_ERROR.\n");
+ }
+
+ status = LE_NO_ERROR;
+ glyphCount = le_layoutChars(engine, chars, -1, 6, 20, TRUE, 0.0, 0.0, &status);
+
+ if (status != LE_ILLEGAL_ARGUMENT_ERROR) {
+ log_err("Calling layoutChars(chars, -1, 6, 20, TRUE, 0.0, 0.0, status) did not fail w/ LE_ILLEGAL_ARGUMENT_ERROR.\n");
+ }
+
+ status = LE_NO_ERROR;
+ glyphCount = le_layoutChars(engine, chars, 8, -1, 20, TRUE, 0.0, 0.0, &status);
+
+ if (status != LE_ILLEGAL_ARGUMENT_ERROR) {
+ log_err("Calling layoutChars(chars, 8, -1, 20, TRUE, 0.0, 0.0, status) did not fail w/ LE_ILLEGAL_ARGUMENT_ERROR.\n");
+ }
+
+ status = LE_NO_ERROR;
+ glyphCount = le_layoutChars(engine, chars, 8, 6, -1, TRUE, 0.0, 0.0, &status);
+
+ if (status != LE_ILLEGAL_ARGUMENT_ERROR) {
+ log_err("Calling layoutChars((chars, 8, 6, -1, TRUE, 0.0, 0.0, status) did not fail w/ LE_ILLEGAL_ARGUMENT_ERROR.\n");
+ }
+
+ status = LE_NO_ERROR;
+ glyphCount = le_layoutChars(engine, chars, 8, 6, 10, TRUE, 0.0, 0.0, &status);
+
+ if (status != LE_ILLEGAL_ARGUMENT_ERROR) {
+ log_err("Calling layoutChars(chars, 8, 6, 10, TRUE, 0.0, 0.0, status) did not fail w/ LE_ILLEGAL_ARGUMENT_ERROR.\n");
+ }
+
+ status = LE_NO_ERROR;
+ glyphCount = le_layoutChars(engine, chars, 8, 6, 20, TRUE, 0.0, 0.0, &status);
+
+ if (LE_FAILURE(status)) {
+ log_err("Calling layoutChars(chars, 8, 6, 20, TRUE, 0.0, 0.0, status) failed.\n");
+ goto bail;
+ }
+
+ le_getGlyphPosition(engine, -1, &x, &y, &status);
+
+ if (status != LE_INDEX_OUT_OF_BOUNDS_ERROR) {
+ log_err("Calling getGlyphPosition(-1, x, y, status) did not fail w/ LE_INDEX_OUT_OF_BOUNDS_ERROR.\n");
+ }
+
+ status = LE_NO_ERROR;
+ le_getGlyphPosition(engine, glyphCount + 1, &x, &y, &status);
+
+ if (status != LE_INDEX_OUT_OF_BOUNDS_ERROR) {
+ log_err("Calling getGlyphPosition(glyphCount + 1, x, y, status) did not fail w/ LE_INDEX_OUT_OF_BOUNDS_ERROR.\n");
+ }
+
+bail:
+ le_close(engine);
+ le_fontClose(font);
+}
+U_CDECL_END
+
+U_CDECL_BEGIN
+static void U_CALLCONV FactoryTest(void)
+{
+ LEErrorCode status = LE_NO_ERROR;
+ le_font *font = le_simpleFontOpen(12, &status);
+ le_engine *engine = NULL;
+ le_int32 scriptCode;
+
+ for(scriptCode = 0; scriptCode < scriptCodeCount; scriptCode += 1) {
+ status = LE_NO_ERROR;
+ engine = le_create(font, scriptCode, -1, 0, &status);
+
+ if (LE_FAILURE(status)) {
+ log_err("Could not create a LayoutEngine for script \'%s\'.\n", uscript_getShortName((UScriptCode)scriptCode));
+ }
+
+ le_close(engine);
+ }
+
+ le_fontClose(font);
+}
+U_CDECL_END
+
+U_CDECL_BEGIN
+static void U_CALLCONV AccessTest(void)
+{
+ LEErrorCode status = LE_NO_ERROR;
+ le_font *font = le_simpleFontOpen(12, &status);
+ le_engine *engine =le_create(font, arabScriptCode, -1, 0, &status);
+ le_int32 glyphCount;
+ LEGlyphID glyphs[6];
+ le_int32 biasedIndices[6], indices[6], glyph;
+ float positions[6 * 2 + 2];
+ LEUnicode chars[] = {
+ 0x0045, 0x006E, 0x0067, 0x006C, 0x0069, 0x0073, 0x0068, 0x0020, /* "English " */
+ 0x0645, 0x0627, 0x0646, 0x062A, 0x0648, 0x0634, /* MEM ALIF KAF NOON TEH WAW SHEEN */
+ 0x0020, 0x0074, 0x0065, 0x0078, 0x0074, 0x02E /* " text." */
+ };
+
+ if (LE_FAILURE(status)) {
+ log_err("Could not create LayoutEngine.\n");
+ goto bail;
+ }
+
+ glyphCount = le_layoutChars(engine, chars, 8, 6, 20, TRUE, 0.0, 0.0, &status);
+
+ if (LE_FAILURE(status) || glyphCount != 6) {
+ log_err("layoutChars(chars, 8, 6, 20, TRUE, 0.0, 0.0, status) failed.\n");
+ goto bail;
+ }
+
+ le_getGlyphs(engine, glyphs, &status);
+ le_getCharIndices(engine, indices, &status);
+ le_getGlyphPositions(engine, positions, &status);
+
+ if (LE_FAILURE(status)) {
+ log_err("Could not get glyph, indices and position arrays.\n");
+ goto bail;
+ }
+
+ status = LE_NO_ERROR;
+ le_getCharIndicesWithBase(engine, biasedIndices, 1024, &status);
+
+ if (LE_FAILURE(status)) {
+ log_err("getCharIndices(biasedIndices, 1024, status) failed.\n");
+ } else {
+ for (glyph = 0; glyph < glyphCount; glyph += 1) {
+ if (biasedIndices[glyph] != (indices[glyph] + 1024)) {
+ log_err("biasedIndices[%d] != indices[%d] + 1024: %8X, %8X\n",
+ glyph, glyph, biasedIndices[glyph], indices[glyph]);
+ break;
+ }
+ }
+ }
+
+ status = LE_NO_ERROR;
+ for (glyph = 0; glyph <= glyphCount; glyph += 1) {
+ float x = 0.0, y = 0.0;
+
+ le_getGlyphPosition(engine, glyph, &x, &y, &status);
+
+ if (LE_FAILURE(status)) {
+ log_err("getGlyphPosition(%d, x, y, status) failed.\n", glyph);
+ break;
+ }
+
+ if (x != positions[glyph*2] || y != positions[glyph*2 + 1]) {
+ log_err("getGlyphPosition(%d, x, y, status) returned bad position: (%f, %f) != (%f, %f)\n",
+ glyph, x, y, positions[glyph*2], positions[glyph*2 + 1]);
+ break;
+ }
+ }
+
+bail:
+ le_close(engine);
+ le_fontClose(font);
+}
+U_CDECL_END
+
+static le_bool compareResults(const char *testID, TestResult *expected, TestResult *actual)
+{
+ le_int32 i;
+
+ /* NOTE: we'll stop on the first failure 'cause once there's one error, it may cascade... */
+ if (actual->glyphCount != expected->glyphCount) {
+ log_err("Test %s: incorrect glyph count: exptected %d, got %d\n",
+ testID, expected->glyphCount, actual->glyphCount);
+ return FALSE;
+ }
+
+ for (i = 0; i < actual->glyphCount; i += 1) {
+ if (actual->glyphs[i] != expected->glyphs[i]) {
+ log_err("Test %s: incorrect id for glyph %d: expected %4X, got %4X\n",
+ testID, i, expected->glyphs[i], actual->glyphs[i]);
+ return FALSE;
+ }
+ }
+
+ for (i = 0; i < actual->glyphCount; i += 1) {
+ if (actual->indices[i] != expected->indices[i]) {
+ log_err("Test %s: incorrect index for glyph %d: expected %8X, got %8X\n",
+ testID, i, expected->indices[i], actual->indices[i]);
+ return FALSE;
+ }
+ }
+
+ for (i = 0; i <= actual->glyphCount; i += 1) {
+ double xError = uprv_fabs(actual->positions[i * 2] - expected->positions[i * 2]);
+ double yError = uprv_fabs(actual->positions[i * 2 + 1] - expected->positions[i * 2 + 1]);
+
+ if (xError > 0.0001) {
+ log_err("Test %s: incorrect x position for glyph %d: expected %f, got %f\n",
+ testID, i, expected->positions[i * 2], actual->positions[i * 2]);
+ return FALSE;
+ }
+
+ if (yError < 0) {
+ yError = -yError;
+ }
+
+ if (yError > 0.0001) {
+ log_err("Test %s: incorrect y position for glyph %d: expected %f, got %f\n",
+ testID, i, expected->positions[i * 2 + 1], actual->positions[i * 2 + 1]);
+ return FALSE;
+ }
+ }
+
+ return TRUE;
+}
+
+static void checkFontVersion(le_font *font, const char *testVersionString,
+ le_uint32 testChecksum, const char *testID)
+{
+ le_uint32 fontChecksum = le_getFontChecksum(font);
+
+ if (fontChecksum != testChecksum) {
+ const char *fontVersionString = le_getNameString(font, NAME_VERSION_STRING,
+ PLATFORM_MACINTOSH, MACINTOSH_ROMAN, MACINTOSH_ENGLISH);
+
+ log_info("Test %s: this may not be the same font used to generate the test data.\n", testID);
+ log_info("Your font's version string is \"%s\"\n", fontVersionString);
+ log_info("The expected version string is \"%s\"\n", testVersionString);
+ log_info("If you see errors, they may be due to the version of the font you're using.\n");
+
+ le_deleteNameString(font, fontVersionString);
+ }
+}
+
+/* Returns the path to icu/source/test/testdata/ */
+static const char *getSourceTestData() {
+#ifdef U_TOPSRCDIR
+ const char *srcDataDir = U_TOPSRCDIR U_FILE_SEP_STRING"test"U_FILE_SEP_STRING"testdata"U_FILE_SEP_STRING;
+#else
+ const char *srcDataDir = ".."U_FILE_SEP_STRING".."U_FILE_SEP_STRING"test"U_FILE_SEP_STRING"testdata"U_FILE_SEP_STRING;
+ FILE *f = fopen(".."U_FILE_SEP_STRING".."U_FILE_SEP_STRING"test"U_FILE_SEP_STRING"testdata"U_FILE_SEP_STRING"rbbitst.txt", "r");
+
+ if (f != NULL) {
+ /* We're in icu/source/test/letest/ */
+ fclose(f);
+ } else {
+ /* We're in icu/source/test/letest/(Debug|Release) */
+ srcDataDir = ".."U_FILE_SEP_STRING".."U_FILE_SEP_STRING".."U_FILE_SEP_STRING"test"U_FILE_SEP_STRING"testdata"U_FILE_SEP_STRING;
+ }
+#endif
+
+ return srcDataDir;
+}
+
+static const char *getPath(char buffer[2048], const char *filename) {
+ const char *testDataDirectory = getSourceTestData();
+
+ strcpy(buffer, testDataDirectory);
+ strcat(buffer, filename);
+
+ return buffer;
+}
+
+static le_font *openFont(const char *fontName, const char *checksum, const char *version, const char *testID)
+{
+ char path[2048];
+ le_font *font;
+ LEErrorCode fontStatus = LE_NO_ERROR;
+
+ if (fontName != NULL) {
+ font = le_portableFontOpen(getPath(path, fontName), 12, &fontStatus);
+
+ if (LE_FAILURE(fontStatus)) {
+ log_info("Test %s: can't open font %s - test skipped.\n", testID, fontName);
+ le_fontClose(font);
+ return NULL;
+ } else {
+ le_uint32 cksum = 0;
+
+ sscanf(checksum, "%x", &cksum);
+
+ checkFontVersion(font, version, cksum, testID);
+ }
+ } else {
+ font = le_simpleFontOpen(12, &fontStatus);
+ }
+
+ return font;
+}
+
+static le_bool getRTL(const LEUnicode *text, le_int32 charCount)
+{
+ UBiDiLevel paraLevel;
+ UErrorCode status = U_ZERO_ERROR;
+ UBiDi *ubidi = ubidi_openSized(charCount, 0, &status);
+
+ ubidi_setPara(ubidi, text, charCount, UBIDI_DEFAULT_LTR, NULL, &status);
+ paraLevel = ubidi_getParaLevel(ubidi);
+ ubidi_close(ubidi);
+
+ return paraLevel & 1;
+}
+
+static void doTestCase (const char *testID,
+ const char *fontName,
+ const char *fontVersion,
+ const char *fontChecksum,
+ le_int32 scriptCode,
+ le_int32 languageCode,
+ const LEUnicode *text,
+ le_int32 charCount,
+ TestResult *expected)
+{
+ LEErrorCode status = LE_NO_ERROR;
+ le_engine *engine;
+ le_font *font = openFont(fontName, fontChecksum, fontVersion, testID);
+ le_int32 typoFlags = 3; /* kerning + ligatures */
+ TestResult actual;
+
+ if (font == NULL) {
+ /* error message already printed. */
+ return;
+ }
+
+ if (fontName == NULL) {
+ typoFlags |= 0x80000000L; /* use CharSubstitutionFilter... */
+ }
+
+ engine = le_create(font, scriptCode, languageCode, typoFlags, &status);
+
+ if (LE_FAILURE(status)) {
+ log_err("Test %s: could not create a LayoutEngine.\n", testID);
+ goto free_expected;
+ }
+
+ actual.glyphCount = le_layoutChars(engine, text, 0, charCount, charCount, getRTL(text, charCount), 0, 0, &status);
+
+ actual.glyphs = NEW_ARRAY(LEGlyphID, actual.glyphCount);
+ actual.indices = NEW_ARRAY(le_int32, actual.glyphCount);
+ actual.positions = NEW_ARRAY(float, actual.glyphCount * 2 + 2);
+
+ le_getGlyphs(engine, actual.glyphs, &status);
+ le_getCharIndices(engine, actual.indices, &status);
+ le_getGlyphPositions(engine, actual.positions, &status);
+
+ compareResults(testID, expected, &actual);
+
+ DELETE_ARRAY(actual.positions);
+ DELETE_ARRAY(actual.indices);
+ DELETE_ARRAY(actual.glyphs);
+
+ le_close(engine);
+
+free_expected:
+ le_fontClose(font);
+}
+
+static void U_CALLCONV DataDrivenTest(void)
+{
+ char path[2048];
+ const char *testFilePath = getPath(path, "letest.xml");
+
+ readTestFile(testFilePath, doTestCase);
+}
+
+/*
+ * From ticket:5923:
+ *
+ * Build a paragraph that contains a mixture of left to right and right to left text.
+ * Break it into multiple lines and make sure that the glyphToCharMap for run in each
+ * line is correct.
+ *
+ * Note: it might be a good idea to also check the glyphs and positions for each run,
+ * that we get the expected number of runs per line and that the line breaks are where
+ * we expect them to be. Really, it would be a good idea to make a whole test suite
+ * for pl_paragraph.
+ */
+static void U_CALLCONV GlyphToCharTest(void)
+{
+ LEErrorCode status = LE_NO_ERROR;
+ le_font *font;
+ pl_fontRuns *fontRuns;
+ pl_paragraph *paragraph;
+ const pl_line *line;
+ /*
+ * This is the same text that's in <icu>/source/samples/layout/Sample.txt
+ */
+ LEUnicode chars[] = {
+ /*BOM*/ 0x0054, 0x0068, 0x0065, 0x0020, 0x004c, 0x0061, 0x0079,
+ 0x006f, 0x0075, 0x0074, 0x0045, 0x006e, 0x0067, 0x0069, 0x006e,
+ 0x0065, 0x0020, 0x0064, 0x006f, 0x0065, 0x0073, 0x0020, 0x0061,
+ 0x006c, 0x006c, 0x0020, 0x0074, 0x0068, 0x0065, 0x0020, 0x0077,
+ 0x006f, 0x0072, 0x006b, 0x0020, 0x006e, 0x0065, 0x0063, 0x0065,
+ 0x0073, 0x0073, 0x0061, 0x0072, 0x0079, 0x0020, 0x0074, 0x006f,
+ 0x0020, 0x0064, 0x0069, 0x0073, 0x0070, 0x006c, 0x0061, 0x0079,
+ 0x0020, 0x0055, 0x006e, 0x0069, 0x0063, 0x006f, 0x0064, 0x0065,
+ 0x0020, 0x0074, 0x0065, 0x0078, 0x0074, 0x0020, 0x0077, 0x0072,
+ 0x0069, 0x0074, 0x0074, 0x0065, 0x006e, 0x0020, 0x0069, 0x006e,
+ 0x0020, 0x006c, 0x0061, 0x006e, 0x0067, 0x0075, 0x0061, 0x0067,
+ 0x0065, 0x0073, 0x0020, 0x0077, 0x0069, 0x0074, 0x0068, 0x0020,
+ 0x0063, 0x006f, 0x006d, 0x0070, 0x006c, 0x0065, 0x0078, 0x0020,
+ 0x0077, 0x0072, 0x0069, 0x0074, 0x0069, 0x006e, 0x0067, 0x0020,
+ 0x0073, 0x0079, 0x0073, 0x0074, 0x0065, 0x006d, 0x0073, 0x0020,
+ 0x0073, 0x0075, 0x0063, 0x0068, 0x0020, 0x0061, 0x0073, 0x0020,
+ 0x0048, 0x0069, 0x006e, 0x0064, 0x0069, 0x0020, 0x0028, 0x0939,
+ 0x093f, 0x0928, 0x094d, 0x0926, 0x0940, 0x0029, 0x0020, 0x0054,
+ 0x0068, 0x0061, 0x0069, 0x0020, 0x0028, 0x0e44, 0x0e17, 0x0e22,
+ 0x0029, 0x0020, 0x0061, 0x006e, 0x0064, 0x0020, 0x0041, 0x0072,
+ 0x0061, 0x0062, 0x0069, 0x0063, 0x0020, 0x0028, 0x0627, 0x0644,
+ 0x0639, 0x0631, 0x0628, 0x064a, 0x0629, 0x0029, 0x002e, 0x0020,
+ 0x0048, 0x0065, 0x0072, 0x0065, 0x0027, 0x0073, 0x0020, 0x0061,
+ 0x0020, 0x0073, 0x0061, 0x006d, 0x0070, 0x006c, 0x0065, 0x0020,
+ 0x006f, 0x0066, 0x0020, 0x0073, 0x006f, 0x006d, 0x0065, 0x0020,
+ 0x0074, 0x0065, 0x0078, 0x0074, 0x0020, 0x0077, 0x0072, 0x0069,
+ 0x0074, 0x0074, 0x0065, 0x006e, 0x0020, 0x0069, 0x006e, 0x0020,
+ 0x0053, 0x0061, 0x006e, 0x0073, 0x006b, 0x0072, 0x0069, 0x0074,
+ 0x003a, 0x0020, 0x0936, 0x094d, 0x0930, 0x0940, 0x092e, 0x0926,
+ 0x094d, 0x0020, 0x092d, 0x0917, 0x0935, 0x0926, 0x094d, 0x0917,
+ 0x0940, 0x0924, 0x093e, 0x0020, 0x0905, 0x0927, 0x094d, 0x092f,
+ 0x093e, 0x092f, 0x0020, 0x0905, 0x0930, 0x094d, 0x091c, 0x0941,
+ 0x0928, 0x0020, 0x0935, 0x093f, 0x0937, 0x093e, 0x0926, 0x0020,
+ 0x092f, 0x094b, 0x0917, 0x0020, 0x0927, 0x0943, 0x0924, 0x0930,
+ 0x093e, 0x0937, 0x094d, 0x091f, 0x094d, 0x0930, 0x0020, 0x0909,
+ 0x0935, 0x093e, 0x091a, 0x0964, 0x0020, 0x0927, 0x0930, 0x094d,
+ 0x092e, 0x0915, 0x094d, 0x0937, 0x0947, 0x0924, 0x094d, 0x0930,
+ 0x0947, 0x0020, 0x0915, 0x0941, 0x0930, 0x0941, 0x0915, 0x094d,
+ 0x0937, 0x0947, 0x0924, 0x094d, 0x0930, 0x0947, 0x0020, 0x0938,
+ 0x092e, 0x0935, 0x0947, 0x0924, 0x093e, 0x0020, 0x092f, 0x0941,
+ 0x092f, 0x0941, 0x0924, 0x094d, 0x0938, 0x0935, 0x0903, 0x0020,
+ 0x092e, 0x093e, 0x092e, 0x0915, 0x093e, 0x0903, 0x0020, 0x092a,
+ 0x093e, 0x0923, 0x094d, 0x0921, 0x0935, 0x093e, 0x0936, 0x094d,
+ 0x091a, 0x0948, 0x0935, 0x0020, 0x0915, 0x093f, 0x092e, 0x0915,
+ 0x0941, 0x0930, 0x094d, 0x0935, 0x0924, 0x0020, 0x0938, 0x0902,
+ 0x091c, 0x092f, 0x0020, 0x0048, 0x0065, 0x0072, 0x0065, 0x0027,
+ 0x0073, 0x0020, 0x0061, 0x0020, 0x0073, 0x0061, 0x006d, 0x0070,
+ 0x006c, 0x0065, 0x0020, 0x006f, 0x0066, 0x0020, 0x0073, 0x006f,
+ 0x006d, 0x0065, 0x0020, 0x0074, 0x0065, 0x0078, 0x0074, 0x0020,
+ 0x0077, 0x0072, 0x0069, 0x0074, 0x0074, 0x0065, 0x006e, 0x0020,
+ 0x0069, 0x006e, 0x0020, 0x0041, 0x0072, 0x0061, 0x0062, 0x0069,
+ 0x0063, 0x003a, 0x0020, 0x0623, 0x0633, 0x0627, 0x0633, 0x064b,
+ 0x0627, 0x060c, 0x0020, 0x062a, 0x062a, 0x0639, 0x0627, 0x0645,
+ 0x0644, 0x0020, 0x0627, 0x0644, 0x062d, 0x0648, 0x0627, 0x0633,
+ 0x064a, 0x0628, 0x0020, 0x0641, 0x0642, 0x0637, 0x0020, 0x0645,
+ 0x0639, 0x0020, 0x0627, 0x0644, 0x0623, 0x0631, 0x0642, 0x0627,
+ 0x0645, 0x060c, 0x0020, 0x0648, 0x062a, 0x0642, 0x0648, 0x0645,
+ 0x0020, 0x0628, 0x062a, 0x062e, 0x0632, 0x064a, 0x0646, 0x0020,
+ 0x0627, 0x0644, 0x0623, 0x062d, 0x0631, 0x0641, 0x0020, 0x0648,
+ 0x0627, 0x0644, 0x0645, 0x062d, 0x0627, 0x0631, 0x0641, 0x0020,
+ 0x0627, 0x0644, 0x0623, 0x062e, 0x0631, 0x0649, 0x0020, 0x0628,
+ 0x0639, 0x062f, 0x0020, 0x0623, 0x0646, 0x0020, 0x062a, 0x064f,
+ 0x0639, 0x0637, 0x064a, 0x0020, 0x0631, 0x0642, 0x0645, 0x0627,
+ 0x0020, 0x0645, 0x0639, 0x064a, 0x0646, 0x0627, 0x0020, 0x0644,
+ 0x0643, 0x0644, 0x0020, 0x0648, 0x0627, 0x062d, 0x062f, 0x0020,
+ 0x0645, 0x0646, 0x0647, 0x0627, 0x002e, 0x0020, 0x0648, 0x0642,
+ 0x0628, 0x0644, 0x0020, 0x0627, 0x062e, 0x062a, 0x0631, 0x0627,
+ 0x0639, 0x0020, 0x0022, 0x064a, 0x0648, 0x0646, 0x0650, 0x0643,
+ 0x0648, 0x062f, 0x0022, 0x060c, 0x0020, 0x0643, 0x0627, 0x0646,
+ 0x0020, 0x0647, 0x0646, 0x0627, 0x0643, 0x0020, 0x0645, 0x0626,
+ 0x0627, 0x062a, 0x0020, 0x0627, 0x0644, 0x0623, 0x0646, 0x0638,
+ 0x0645, 0x0629, 0x0020, 0x0644, 0x0644, 0x062a, 0x0634, 0x0641,
+ 0x064a, 0x0631, 0x0020, 0x0648, 0x062a, 0x062e, 0x0635, 0x064a,
+ 0x0635, 0x0020, 0x0647, 0x0630, 0x0647, 0x0020, 0x0627, 0x0644,
+ 0x0623, 0x0631, 0x0642, 0x0627, 0x0645, 0x0020, 0x0644, 0x0644,
+ 0x0645, 0x062d, 0x0627, 0x0631, 0x0641, 0x060c, 0x0020, 0x0648,
+ 0x0644, 0x0645, 0x0020, 0x064a, 0x0648, 0x062c, 0x062f, 0x0020,
+ 0x0646, 0x0638, 0x0627, 0x0645, 0x0020, 0x062a, 0x0634, 0x0641,
+ 0x064a, 0x0631, 0x0020, 0x0648, 0x0627, 0x062d, 0x062f, 0x0020,
+ 0x064a, 0x062d, 0x062a, 0x0648, 0x064a, 0x0020, 0x0639, 0x0644,
+ 0x0649, 0x0020, 0x062c, 0x0645, 0x064a, 0x0639, 0x0020, 0x0627,
+ 0x0644, 0x0645, 0x062d, 0x0627, 0x0631, 0x0641, 0x0020, 0x0627,
+ 0x0644, 0x0636, 0x0631, 0x0648, 0x0631, 0x064a, 0x0629, 0x0020,
+ 0x0061, 0x006e, 0x0064, 0x0020, 0x0068, 0x0065, 0x0072, 0x0065,
+ 0x0027, 0x0073, 0x0020, 0x0061, 0x0020, 0x0073, 0x0061, 0x006d,
+ 0x0070, 0x006c, 0x0065, 0x0020, 0x006f, 0x0066, 0x0020, 0x0073,
+ 0x006f, 0x006d, 0x0065, 0x0020, 0x0074, 0x0065, 0x0078, 0x0074,
+ 0x0020, 0x0077, 0x0072, 0x0069, 0x0074, 0x0074, 0x0065, 0x006e,
+ 0x0020, 0x0069, 0x006e, 0x0020, 0x0054, 0x0068, 0x0061, 0x0069,
+ 0x003a, 0x0020, 0x0e1a, 0x0e17, 0x0e17, 0x0e35, 0x0e48, 0x0e51,
+ 0x0e1e, 0x0e32, 0x0e22, 0x0e38, 0x0e44, 0x0e0b, 0x0e42, 0x0e04,
+ 0x0e25, 0x0e19, 0x0e42, 0x0e14, 0x0e42, 0x0e23, 0x0e18, 0x0e35,
+ 0x0e2d, 0x0e32, 0x0e28, 0x0e31, 0x0e22, 0x0e2d, 0x0e22, 0x0e39,
+ 0x0e48, 0x0e17, 0x0e48, 0x0e32, 0x0e21, 0x0e01, 0x0e25, 0x0e32,
+ 0x0e07, 0x0e17, 0x0e38, 0x0e48, 0x0e07, 0x0e43, 0x0e2b, 0x0e0d,
+ 0x0e48, 0x0e43, 0x0e19, 0x0e41, 0x0e04, 0x0e19, 0x0e0b, 0x0e31,
+ 0x0e2a, 0x0e01, 0x0e31, 0x0e1a, 0x0e25, 0x0e38, 0x0e07, 0x0e40,
+ 0x0e2e, 0x0e19, 0x0e23, 0x0e35, 0x0e0a, 0x0e32, 0x0e27, 0x0e44,
+ 0x0e23, 0x0e48, 0x0e41, 0x0e25, 0x0e30, 0x0e1b, 0x0e49, 0x0e32,
+ 0x0e40, 0x0e2d, 0x0e47, 0x0e21, 0x0e20, 0x0e23, 0x0e23, 0x0e22,
+ 0x0e32, 0x0e0a, 0x0e32, 0x0e27, 0x0e44, 0x0e23, 0x0e48, 0x0e1a,
+ 0x0e49, 0x0e32, 0x0e19, 0x0e02, 0x0e2d, 0x0e07, 0x0e1e, 0x0e27,
+ 0x0e01, 0x0e40, 0x0e02, 0x0e32, 0x0e2b, 0x0e25, 0x0e31, 0x0e07,
+ 0x0e40, 0x0e25, 0x0e47, 0x0e01, 0x0e40, 0x0e1e, 0x0e23, 0x0e32,
+ 0x0e30, 0x0e44, 0x0e21, 0x0e49, 0x0e2a, 0x0e23, 0x0e49, 0x0e32,
+ 0x0e07, 0x0e1a, 0x0e49, 0x0e32, 0x0e19, 0x0e15, 0x0e49, 0x0e2d,
+ 0x0e07, 0x0e02, 0x0e19, 0x0e21, 0x0e32, 0x0e14, 0x0e49, 0x0e27,
+ 0x0e22, 0x0e40, 0x0e01, 0x0e27, 0x0e35, 0x0e22, 0x0e19, 0x0e40,
+ 0x0e1b, 0x0e47, 0x0e19, 0x0e23, 0x0e30, 0x0e22, 0x0e30, 0x0e17,
+ 0x0e32, 0x0e07, 0x0e2b, 0x0e25, 0x0e32, 0x0e22, 0x0e44, 0x0e21,
+ 0x0e25, 0x0e4c
+ };
+ le_int32 charCount = LE_ARRAY_SIZE(chars);
+ le_int32 charIndex = 0, lineNumber = 1;
+ le_int32 run, i;
+ const float lineWidth = 600;
+
+ font = le_simpleFontOpen(12, &status);
+
+ if (LE_FAILURE(status)) {
+ log_err("le_simpleFontOpen(12, &status) failed");
+ goto finish;
+ }
+
+ fontRuns = pl_openEmptyFontRuns(0);
+ pl_addFontRun(fontRuns, font, charCount);
+
+ paragraph = pl_create(chars, charCount, fontRuns, NULL, NULL, NULL, 0, FALSE, &status);
+
+ pl_closeFontRuns(fontRuns);
+
+ if (LE_FAILURE(status)) {
+ log_err("pl_create failed.");
+ goto close_font;
+ }
+
+ pl_reflow(paragraph);
+ while ((line = pl_nextLine(paragraph, lineWidth)) != NULL) {
+ le_int32 runCount = pl_countLineRuns(line);
+
+ for(run = 0; run < runCount; run += 1) {
+ const pl_visualRun *visualRun = pl_getLineVisualRun(line, run);
+ const le_int32 glyphCount = pl_getVisualRunGlyphCount(visualRun);
+ const le_int32 *glyphToCharMap = pl_getVisualRunGlyphToCharMap(visualRun);
+
+ if (pl_getVisualRunDirection(visualRun) == UBIDI_RTL) {
+ /*
+ * For a right to left run, make sure that the character indices
+ * increase from the right most glyph to the left most glyph. If
+ * there are any one to many glyph substitutions, we might get several
+ * glyphs in a row with the same character index.
+ */
+ for(i = glyphCount - 1; i >= 0; i -= 1) {
+ le_int32 ix = glyphToCharMap[i];
+
+ if (ix != charIndex) {
+ if (ix != charIndex - 1) {
+ log_err("Bad glyph to char index for glyph %d on line %d: expected %d, got %d\n",
+ i, lineNumber, charIndex, ix);
+ goto close_paragraph; /* once there's one error, we can't count on anything else... */
+ }
+ } else {
+ charIndex += 1;
+ }
+ }
+ } else {
+ /*
+ * We can't just check the order of the character indices
+ * for left to right runs because Indic text might have been
+ * reordered. What we can do is find the minimum and maximum
+ * character indices in the run and make sure that the minimum
+ * is equal to charIndex and then advance charIndex to the maximum.
+ */
+ le_int32 minIndex = 0x7FFFFFFF, maxIndex = -1;
+
+ for(i = 0; i < glyphCount; i += 1) {
+ le_int32 ix = glyphToCharMap[i];
+
+ if (ix > maxIndex) {
+ maxIndex = ix;
+ }
+
+ if (ix < minIndex) {
+ minIndex = ix;
+ }
+ }
+
+ if (minIndex != charIndex) {
+ log_err("Bad minIndex for run %d on line %d: expected %d, got %d\n",
+ run, lineNumber, charIndex, minIndex);
+ goto close_paragraph; /* once there's one error, we can't count on anything else... */
+ }
+
+ charIndex = maxIndex + 1;
+ }
+ }
+
+ lineNumber += 1;
+ }
+
+close_paragraph:
+ pl_close(paragraph);
+
+close_font:
+ le_fontClose(font);
+
+finish:
+ return;
+}
+
+U_CFUNC void addCTests(TestNode **root)
+{
+ addTest(root, &ParamTest, "c_api/ParameterTest");
+ addTest(root, &FactoryTest, "c_api/FactoryTest");
+ addTest(root, &AccessTest, "c_layout/AccessTest");
+ addTest(root, &DataDrivenTest, "c_layout/DataDrivenTest");
+ addTest(root, &GlyphToCharTest, "c_paragraph/GlyphToCharTest");
+}
+
+
diff --git a/Build/source/libs/icu/icu-xetex/test/letest/cletest.sln b/Build/source/libs/icu/icu-xetex/test/letest/cletest.sln
new file mode 100644
index 00000000000..1ac75a272b2
--- /dev/null
+++ b/Build/source/libs/icu/icu-xetex/test/letest/cletest.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cletest", "cletest.vcproj", "{798E3AE4-A984-43FF-8928-EACFF43F56AE}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {798E3AE4-A984-43FF-8928-EACFF43F56AE}.Debug|Win32.ActiveCfg = Debug|Win32
+ {798E3AE4-A984-43FF-8928-EACFF43F56AE}.Debug|Win32.Build.0 = Debug|Win32
+ {798E3AE4-A984-43FF-8928-EACFF43F56AE}.Release|Win32.ActiveCfg = Release|Win32
+ {798E3AE4-A984-43FF-8928-EACFF43F56AE}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/Build/source/libs/icu/icu-xetex/test/letest/cletest.vcproj b/Build/source/libs/icu/icu-xetex/test/letest/cletest.vcproj
new file mode 100644
index 00000000000..ed9685ab355
--- /dev/null
+++ b/Build/source/libs/icu/icu-xetex/test/letest/cletest.vcproj
@@ -0,0 +1,273 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="cletest"
+ ProjectGUID="{798E3AE4-A984-43FF-8928-EACFF43F56AE}"
+ RootNamespace="cletest"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\include\layout;..\..\..\include;..\..\common;..\..\tools\ctestfw;..\..\tools\toolutil;..\..\layout"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="..\..\..\lib\icuucd.lib ..\..\..\lib\icuind.lib ..\..\..\lib\icutestd.lib ..\..\..\lib\icutud.lib ..\..\..\lib\iculed.lib"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\..\include\layout;..\..\..\include;..\..\common;..\..\tools\ctestfw;..\..\tools\toolutil;..\..\layout"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="..\..\..\lib\icuuc.lib ..\..\..\lib\icuin.lib ..\..\..\lib\icutest.lib ..\..\..\lib\icutu.lib ..\..\..\lib\icule.lib"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\cfonts.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\cletest.c"
+ >
+ </File>
+ <File
+ RelativePath=".\cmaps.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\FontObject.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\FontTableCache.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\letsutil.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\PortableFontInstance.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\SimpleFontInstance.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\xmlreader.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath=".\cfonts.h"
+ >
+ </File>
+ <File
+ RelativePath=".\cmaps.h"
+ >
+ </File>
+ <File
+ RelativePath=".\FontObject.h"
+ >
+ </File>
+ <File
+ RelativePath=".\FontTableCache.h"
+ >
+ </File>
+ <File
+ RelativePath=".\letest.h"
+ >
+ </File>
+ <File
+ RelativePath=".\letsutil.h"
+ >
+ </File>
+ <File
+ RelativePath=".\PortableFontInstance.h"
+ >
+ </File>
+ <File
+ RelativePath=".\sfnt.h"
+ >
+ </File>
+ <File
+ RelativePath=".\SimpleFontInstance.h"
+ >
+ </File>
+ <File
+ RelativePath=".\xmlreader.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/Build/source/libs/icu/icu-xetex/test/letest/cmaps.cpp b/Build/source/libs/icu/icu-xetex/test/letest/cmaps.cpp
new file mode 100644
index 00000000000..3b8501b4cec
--- /dev/null
+++ b/Build/source/libs/icu/icu-xetex/test/letest/cmaps.cpp
@@ -0,0 +1,200 @@
+/***************************************************************************
+*
+* Copyright (C) 1998-2003, International Business Machines
+* Corporation and others. All Rights Reserved.
+*
+************************************************************************/
+
+#include "LETypes.h"
+#include "LESwaps.h"
+
+#include "sfnt.h"
+#include "cmaps.h"
+
+#define SWAPU16(code) ((LEUnicode16) SWAPW(code))
+#define SWAPU32(code) ((LEUnicode32) SWAPL(code))
+
+//
+// Finds the high bit by binary searching
+// through the bits in value.
+//
+le_int8 highBit(le_uint32 value)
+{
+ le_uint8 bit = 0;
+
+ if (value >= 1 << 16) {
+ value >>= 16;
+ bit += 16;
+ }
+
+ if (value >= 1 << 8) {
+ value >>= 8;
+ bit += 8;
+ }
+
+ if (value >= 1 << 4) {
+ value >>= 4;
+ bit += 4;
+ }
+
+ if (value >= 1 << 2) {
+ value >>= 2;
+ bit += 2;
+ }
+
+ if (value >= 1 << 1) {
+ value >>= 1;
+ bit += 1;
+ }
+
+ return bit;
+}
+
+CMAPMapper *CMAPMapper::createUnicodeMapper(const CMAPTable *cmap)
+{
+ le_uint16 i;
+ le_uint16 nSubtables = SWAPW(cmap->numberSubtables);
+ const CMAPEncodingSubtable *subtable = NULL;
+ le_uint32 offset1 = 0, offset10 = 0;
+
+ for (i = 0; i < nSubtables; i += 1) {
+ const CMAPEncodingSubtableHeader *esh = &cmap->encodingSubtableHeaders[i];
+
+ if (SWAPW(esh->platformID) == 3) {
+ switch (SWAPW(esh->platformSpecificID)) {
+ case 1:
+ offset1 = SWAPL(esh->encodingOffset);
+ break;
+
+ case 10:
+ offset10 = SWAPL(esh->encodingOffset);
+ break;
+ }
+ }
+ }
+
+
+ if (offset10 != 0)
+ {
+ subtable = (const CMAPEncodingSubtable *) ((const char *) cmap + offset10);
+ } else if (offset1 != 0) {
+ subtable = (const CMAPEncodingSubtable *) ((const char *) cmap + offset1);
+ } else {
+ return NULL;
+ }
+
+ switch (SWAPW(subtable->format)) {
+ case 4:
+ return new CMAPFormat4Mapper(cmap, (const CMAPFormat4Encoding *) subtable);
+
+ case 12:
+ {
+ const CMAPFormat12Encoding *encoding = (const CMAPFormat12Encoding *) subtable;
+
+ return new CMAPGroupMapper(cmap, encoding->groups, SWAPL(encoding->nGroups));
+ }
+
+ default:
+ break;
+ }
+
+ return NULL;
+}
+
+CMAPFormat4Mapper::CMAPFormat4Mapper(const CMAPTable *cmap, const CMAPFormat4Encoding *header)
+ : CMAPMapper(cmap)
+{
+ le_uint16 segCount = SWAPW(header->segCountX2) / 2;
+
+ fEntrySelector = SWAPW(header->entrySelector);
+ fRangeShift = SWAPW(header->rangeShift) / 2;
+ fEndCodes = &header->endCodes[0];
+ fStartCodes = &header->endCodes[segCount + 1]; // + 1 for reservedPad...
+ fIdDelta = &fStartCodes[segCount];
+ fIdRangeOffset = &fIdDelta[segCount];
+}
+
+LEGlyphID CMAPFormat4Mapper::unicodeToGlyph(LEUnicode32 unicode32) const
+{
+ if (unicode32 >= 0x10000) {
+ return 0;
+ }
+
+ LEUnicode16 unicode = (LEUnicode16) unicode32;
+ le_uint16 index = 0;
+ le_uint16 probe = 1 << fEntrySelector;
+ TTGlyphID result = 0;
+
+ if (SWAPU16(fStartCodes[fRangeShift]) <= unicode) {
+ index = fRangeShift;
+ }
+
+ while (probe > (1 << 0)) {
+ probe >>= 1;
+
+ if (SWAPU16(fStartCodes[index + probe]) <= unicode) {
+ index += probe;
+ }
+ }
+
+ if (unicode >= SWAPU16(fStartCodes[index]) && unicode <= SWAPU16(fEndCodes[index])) {
+ if (fIdRangeOffset[index] == 0) {
+ result = (TTGlyphID) unicode;
+ } else {
+ le_uint16 offset = unicode - SWAPU16(fStartCodes[index]);
+ le_uint16 rangeOffset = SWAPW(fIdRangeOffset[index]);
+ le_uint16 *glyphIndexTable = (le_uint16 *) ((char *) &fIdRangeOffset[index] + rangeOffset);
+
+ result = SWAPW(glyphIndexTable[offset]);
+ }
+
+ result += SWAPW(fIdDelta[index]);
+ } else {
+ result = 0;
+ }
+
+ return LE_SET_GLYPH(0, result);
+}
+
+CMAPFormat4Mapper::~CMAPFormat4Mapper()
+{
+ // parent destructor does it all
+}
+
+CMAPGroupMapper::CMAPGroupMapper(const CMAPTable *cmap, const CMAPGroup *groups, le_uint32 nGroups)
+ : CMAPMapper(cmap), fGroups(groups)
+{
+ le_uint8 bit = highBit(nGroups);
+ fPower = 1 << bit;
+ fRangeOffset = nGroups - fPower;
+}
+
+LEGlyphID CMAPGroupMapper::unicodeToGlyph(LEUnicode32 unicode32) const
+{
+ le_int32 probe = fPower;
+ le_int32 range = 0;
+
+ if (SWAPU32(fGroups[fRangeOffset].startCharCode) <= unicode32) {
+ range = fRangeOffset;
+ }
+
+ while (probe > (1 << 0)) {
+ probe >>= 1;
+
+ if (SWAPU32(fGroups[range + probe].startCharCode) <= unicode32) {
+ range += probe;
+ }
+ }
+
+ if (SWAPU32(fGroups[range].startCharCode) <= unicode32 && SWAPU32(fGroups[range].endCharCode) >= unicode32) {
+ return (LEGlyphID) (SWAPU32(fGroups[range].startGlyphCode) + unicode32 - SWAPU32(fGroups[range].startCharCode));
+ }
+
+ return 0;
+}
+
+CMAPGroupMapper::~CMAPGroupMapper()
+{
+ // parent destructor does it all
+}
+
diff --git a/Build/source/libs/icu/icu-xetex/test/letest/cmaps.h b/Build/source/libs/icu/icu-xetex/test/letest/cmaps.h
new file mode 100644
index 00000000000..df0bb116ba5
--- /dev/null
+++ b/Build/source/libs/icu/icu-xetex/test/letest/cmaps.h
@@ -0,0 +1,85 @@
+/***************************************************************************
+*
+* Copyright (C) 1998-2006, International Business Machines
+* Corporation and others. All Rights Reserved.
+*
+************************************************************************/
+
+
+#ifndef __CMAPS_H
+#define __CMAPS_H
+
+#include "layout/LETypes.h"
+#include "letest.h"
+#include "sfnt.h"
+
+class CMAPMapper
+{
+public:
+ virtual LEGlyphID unicodeToGlyph(LEUnicode32 unicode32) const = 0;
+
+ virtual ~CMAPMapper();
+
+ static CMAPMapper *createUnicodeMapper(const CMAPTable *cmap);
+
+protected:
+ CMAPMapper(const CMAPTable *cmap);
+
+ CMAPMapper() {};
+
+private:
+ const CMAPTable *fcmap;
+};
+
+class CMAPFormat4Mapper : public CMAPMapper
+{
+public:
+ CMAPFormat4Mapper(const CMAPTable *cmap, const CMAPFormat4Encoding *header);
+
+ virtual ~CMAPFormat4Mapper();
+
+ virtual LEGlyphID unicodeToGlyph(LEUnicode32 unicode32) const;
+
+protected:
+ CMAPFormat4Mapper() {};
+
+private:
+ le_uint16 fEntrySelector;
+ le_uint16 fRangeShift;
+ const le_uint16 *fEndCodes;
+ const le_uint16 *fStartCodes;
+ const le_uint16 *fIdDelta;
+ const le_uint16 *fIdRangeOffset;
+};
+
+class CMAPGroupMapper : public CMAPMapper
+{
+public:
+ CMAPGroupMapper(const CMAPTable *cmap, const CMAPGroup *groups, le_uint32 nGroups);
+
+ virtual ~CMAPGroupMapper();
+
+ virtual LEGlyphID unicodeToGlyph(LEUnicode32 unicode32) const;
+
+protected:
+ CMAPGroupMapper() {};
+
+private:
+ le_int32 fPower;
+ le_int32 fRangeOffset;
+ const CMAPGroup *fGroups;
+};
+
+inline CMAPMapper::CMAPMapper(const CMAPTable *cmap)
+ : fcmap(cmap)
+{
+ // nothing else to do
+}
+
+inline CMAPMapper::~CMAPMapper()
+{
+ DELETE_ARRAY(fcmap);
+}
+
+#endif
+
diff --git a/Build/source/libs/icu/icu-xetex/test/letest/gendata.cpp b/Build/source/libs/icu/icu-xetex/test/letest/gendata.cpp
new file mode 100644
index 00000000000..103fb4b6fdd
--- /dev/null
+++ b/Build/source/libs/icu/icu-xetex/test/letest/gendata.cpp
@@ -0,0 +1,295 @@
+/*
+ *******************************************************************************
+ *
+ * Copyright (C) 1999-2008, International Business Machines
+ * Corporation and others. All Rights Reserved.
+ *
+ *******************************************************************************
+ * file name: gendata.cpp
+ *
+ * created on: 11/03/2000
+ * created by: Eric R. Mader
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <time.h>
+
+#include "unicode/utypes.h"
+#include "unicode/unistr.h"
+#include "unicode/uscript.h"
+#include "unicode/ubidi.h"
+
+#include "layout/LETypes.h"
+#include "layout/LEScripts.h"
+#include "layout/LayoutEngine.h"
+
+#include "PortableFontInstance.h"
+#include "SimpleFontInstance.h"
+
+#include "xmlparser.h"
+
+#include "letsutil.h"
+#include "letest.h"
+
+U_NAMESPACE_USE
+
+struct TestInput
+{
+ const char *fontName;
+ LEUnicode *text;
+ le_int32 textLength;
+ le_int32 scriptCode;
+ le_bool rightToLeft;
+};
+
+/*
+ * FIXME: should use the output file name and the current date.
+ */
+const char *header =
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ "\n"
+ "<!--\n"
+ " Copyright (c) 1999-%4.4d International Business Machines\n"
+ " Corporation and others. All rights reserved.\n"
+ "\n"
+ " WARNING: THIS FILE IS MACHINE GENERATED. DO NOT HAND EDIT IT\n"
+ " UNLESS YOU REALLY KNOW WHAT YOU'RE DOING.\n"
+ "\n"
+ " file name: letest.xml\n"
+ " generated on: %s\n"
+ " generated by: gendata.cpp\n"
+ "-->\n"
+ "\n"
+ "<layout-tests>\n";
+
+void dumpLongs(FILE *file, const char *tag, le_int32 *longs, le_int32 count) {
+ char lineBuffer[8 * 12 + 2];
+ le_int32 bufp = 0;
+
+ fprintf(file, " <%s>\n", tag);
+
+ for (int i = 0; i < count; i += 1) {
+ if (i % 8 == 0 && bufp != 0) {
+ fprintf(file, " %s\n", lineBuffer);
+ bufp = 0;
+ }
+
+ bufp += sprintf(&lineBuffer[bufp], "0x%8.8X, ", longs[i]);
+ }
+
+ if (bufp != 0) {
+ lineBuffer[bufp - 2] = '\0';
+ fprintf(file, " %s\n", lineBuffer);
+ }
+
+ fprintf(file, " </%s>\n\n", tag);
+}
+
+void dumpFloats(FILE *file, const char *tag, float *floats, le_int32 count) {
+ char lineBuffer[8 * 16 + 2];
+ le_int32 bufp = 0;
+
+ fprintf(file, " <%s>\n", tag);
+
+ for (int i = 0; i < count; i += 1) {
+ if (i % 8 == 0 && bufp != 0) {
+ fprintf(file, " %s\n", lineBuffer);
+ bufp = 0;
+ }
+
+ bufp += sprintf(&lineBuffer[bufp], "%f, ", floats[i]);
+ }
+
+ if (bufp != 0) {
+ lineBuffer[bufp - 2] = '\0';
+ fprintf(file, " %s\n", lineBuffer);
+ }
+
+ fprintf(file, " </%s>\n", tag);
+}
+
+int main(int /*argc*/, char *argv[])
+{
+ UErrorCode status = U_ZERO_ERROR;
+ FILE *outputFile = fopen(argv[1], "w");
+ time_t now = time(NULL);
+ struct tm *local = localtime(&now);
+ const char *tmFormat = "%m/%d/%Y %I:%M:%S %p %Z";
+ char tmString[64];
+
+ strftime(tmString, 64, tmFormat, local);
+ fprintf(outputFile, header, local->tm_year + 1900, tmString);
+
+ UXMLParser *parser = UXMLParser::createParser(status);
+ UXMLElement *root = parser->parseFile("gendata.xml", status);
+
+ if (root == NULL) {
+ printf("Error: Could not open gendata.xml\n");
+ delete parser;
+ return -1;
+ }
+
+ UnicodeString test_case = UNICODE_STRING_SIMPLE("test-case");
+ UnicodeString test_text = UNICODE_STRING_SIMPLE("test-text");
+ UnicodeString test_font = UNICODE_STRING_SIMPLE("test-font");
+
+ // test-case attributes
+ UnicodeString id_attr = UNICODE_STRING_SIMPLE("id");
+ UnicodeString script_attr = UNICODE_STRING_SIMPLE("script");
+ UnicodeString lang_attr = UNICODE_STRING_SIMPLE("lang");
+
+ // test-font attributes
+ UnicodeString name_attr = UNICODE_STRING_SIMPLE("name");
+
+ const UXMLElement *testCase;
+ int32_t tc = 0;
+
+ while((testCase = root->nextChildElement(tc)) != NULL) {
+ if (testCase->getTagName().compare(test_case) == 0) {
+ char *id = getCString(testCase->getAttribute(id_attr));
+ char *script = getCString(testCase->getAttribute(script_attr));
+ char *lang = getCString(testCase->getAttribute(lang_attr));
+ LEFontInstance *font = NULL;
+ const UXMLElement *element;
+ int32_t ec = 0;
+ int32_t charCount = 0;
+ int32_t typoFlags = 3; // kerning + ligatures...
+ UScriptCode scriptCode;
+ le_int32 languageCode = -1;
+ UnicodeString text;
+ int32_t glyphCount = 0;
+ LEErrorCode leStatus = LE_NO_ERROR;
+ LayoutEngine *engine = NULL;
+ LEGlyphID *glyphs = NULL;
+ le_int32 *indices = NULL;
+ float *positions = NULL;
+
+ uscript_getCode(script, &scriptCode, 1, &status);
+ if (LE_FAILURE(status)) {
+ printf("Error: invalid script name: %s.\n", script);
+ goto free_c_strings;
+ }
+
+ if (lang != NULL) {
+ languageCode = getLanguageCode(lang);
+
+ if (languageCode < 0) {
+ printf("Error: invalid language name: %s.\n", lang);
+ goto free_c_strings;
+ }
+
+ fprintf(outputFile, " <test-case id=\"%s\" script=\"%s\" lang=\"%s\">\n", id, script, lang);
+ } else {
+ fprintf(outputFile, " <test-case id=\"%s\" script=\"%s\">\n", id, script);
+ }
+
+ while((element = testCase->nextChildElement(ec)) != NULL) {
+ UnicodeString tag = element->getTagName();
+
+ // TODO: make sure that each element is only used once.
+ if (tag.compare(test_font) == 0) {
+ char *fontName = getCString(element->getAttribute(name_attr));
+ const char *version = NULL;
+ PortableFontInstance *pfi = new PortableFontInstance(fontName, 12, leStatus);
+
+ if (LE_FAILURE(leStatus)) {
+ printf("Error: could not open font: %s\n", fontName);
+ freeCString(fontName);
+ goto free_c_strings;
+ }
+
+ version = pfi->getNameString(NAME_VERSION_STRING, PLATFORM_MACINTOSH, MACINTOSH_ROMAN, MACINTOSH_ENGLISH);
+
+ // The standard recommends that the Macintosh Roman/English name string be present, but
+ // if it's not, try the Microsoft Unicode/English string.
+ if (version == NULL) {
+ const LEUnicode16 *uversion = pfi->getUnicodeNameString(NAME_VERSION_STRING, PLATFORM_MICROSOFT, MICROSOFT_UNICODE_BMP, MICROSOFT_ENGLISH);
+
+ if (uversion != NULL) {
+ const UnicodeString usversion((const UChar *)uversion);
+
+ version = getCString(&usversion);
+ pfi->deleteNameString(uversion);
+ }
+ }
+
+ fprintf(outputFile, " <test-font name=\"%s\" version=\"%s\" checksum=\"0x%8.8X\"/>\n\n",
+ fontName, version, pfi->getFontChecksum());
+
+ pfi->deleteNameString(version);
+ freeCString(fontName);
+ font = pfi;
+ } else if (tag.compare(test_text) == 0) {
+ char *utf8 = NULL;
+
+ text = element->getText(TRUE);
+ charCount = text.length();
+
+ utf8 = getUTF8String(&text);
+ fprintf(outputFile, " <test-text>%s</test-text>\n\n", utf8);
+ freeCString(utf8);
+ } else {
+ // an unknown tag...
+ char *cTag = getCString(&tag);
+
+ printf("Test %s: unknown element with tag \"%s\"\n", id, cTag);
+ freeCString(cTag);
+ }
+ }
+
+ if (font == NULL) {
+ LEErrorCode fontStatus = LE_NO_ERROR;
+
+ font = new SimpleFontInstance(12, fontStatus);
+ typoFlags |= 0x80000000L; // use CharSubstitutionFilter...
+ }
+
+ engine = LayoutEngine::layoutEngineFactory(font, scriptCode, languageCode, typoFlags, leStatus);
+
+ if (LE_FAILURE(leStatus)) {
+ printf("Error for test %s: could not create a LayoutEngine.\n", id);
+ goto delete_font;
+ }
+
+ glyphCount = engine->layoutChars(text.getBuffer(), 0, charCount, charCount, getRTL(text), 0, 0, leStatus);
+
+ glyphs = NEW_ARRAY(LEGlyphID, glyphCount);
+ indices = NEW_ARRAY(le_int32, glyphCount);
+ positions = NEW_ARRAY(float, glyphCount * 2 + 2);
+
+ engine->getGlyphs(glyphs, leStatus);
+ engine->getCharIndices(indices, leStatus);
+ engine->getGlyphPositions(positions, leStatus);
+
+ dumpLongs(outputFile, "result-glyphs", (le_int32 *) glyphs, glyphCount);
+
+ dumpLongs(outputFile, "result-indices", indices, glyphCount);
+
+ dumpFloats(outputFile, "result-positions", positions, glyphCount * 2 + 2);
+
+ fprintf(outputFile, " </test-case>\n\n");
+
+ DELETE_ARRAY(positions);
+ DELETE_ARRAY(indices);
+ DELETE_ARRAY(glyphs);
+
+ delete engine;
+
+delete_font:
+ delete font;
+
+free_c_strings:
+ freeCString(lang);
+ freeCString(script);
+ freeCString(id);
+ }
+ }
+
+ delete root;
+ delete parser;
+
+ fprintf(outputFile, "</layout-tests>\n");
+
+ fclose(outputFile);
+}
diff --git a/Build/source/libs/icu/icu-xetex/test/letest/gendata.sln b/Build/source/libs/icu/icu-xetex/test/letest/gendata.sln
new file mode 100644
index 00000000000..8f46c1c2f1d
--- /dev/null
+++ b/Build/source/libs/icu/icu-xetex/test/letest/gendata.sln
@@ -0,0 +1,19 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gendata", "gendata.vcproj", "{DA322426-C37C-4909-A99D-16B05E7FA498}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {DA322426-C37C-4909-A99D-16B05E7FA498}.Debug|Win32.ActiveCfg = Debug|Win32
+ {DA322426-C37C-4909-A99D-16B05E7FA498}.Debug|Win32.Build.0 = Debug|Win32
+ {DA322426-C37C-4909-A99D-16B05E7FA498}.Release|Win32.ActiveCfg = Release|Win32
+ {DA322426-C37C-4909-A99D-16B05E7FA498}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/Build/source/libs/icu/icu-xetex/test/letest/gendata.vcproj b/Build/source/libs/icu/icu-xetex/test/letest/gendata.vcproj
new file mode 100644
index 00000000000..e76679d334d
--- /dev/null
+++ b/Build/source/libs/icu/icu-xetex/test/letest/gendata.vcproj
@@ -0,0 +1,269 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="gendata"
+ ProjectGUID="{DA322426-C37C-4909-A99D-16B05E7FA498}"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\Debug"
+ IntermediateDirectory=".\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\Debug/gendata.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\include\layout;..\..\..\include;..\..\common;..\..\layout;..\..\tools\ctestfw;..\..\tools\toolutil"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;LE_USE_CMEMORY;_CRT_SECURE_NO_DEPRECATE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ TreatWChar_tAsBuiltInType="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Debug/gendata.pch"
+ AssemblerListingLocation=".\Debug/"
+ ObjectFile=".\Debug/"
+ ProgramDataBaseFileName=".\Debug/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="..\..\..\lib\iculed.lib ..\..\..\lib\icuucd.lib ..\..\..\lib\icutud.lib odbc32.lib odbccp32.lib"
+ OutputFile=".\Debug/gendata.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\Debug/gendata.pdb"
+ SubSystem="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\Release"
+ IntermediateDirectory=".\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\Release/gendata.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..\include\layout;..\..\..\include;..\..\common;..\..\layout;..\..\tools\ctestfw;..\..\tools\toolutil"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;LE_USE_CMEMORY;_CRT_SECURE_NO_DEPRECATE"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ TreatWChar_tAsBuiltInType="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Release/gendata.pch"
+ AssemblerListingLocation=".\Release/"
+ ObjectFile=".\Release/"
+ ProgramDataBaseFileName=".\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="..\..\..\lib\icule.lib ..\..\..\lib\icuuc.lib ..\..\..\lib\icutu.lib odbc32.lib odbccp32.lib"
+ OutputFile=".\Release/gendata.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\Release/gendata.pdb"
+ SubSystem="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath=".\cmaps.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\FontTableCache.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\gendata.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\letsutil.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\PortableFontInstance.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\SimpleFontInstance.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath=".\cmaps.h"
+ >
+ </File>
+ <File
+ RelativePath=".\FontTableCache.h"
+ >
+ </File>
+ <File
+ RelativePath=".\letest.h"
+ >
+ </File>
+ <File
+ RelativePath=".\letsutil.h"
+ >
+ </File>
+ <File
+ RelativePath=".\PortableFontInstance.h"
+ >
+ </File>
+ <File
+ RelativePath=".\sfnt.h"
+ >
+ </File>
+ <File
+ RelativePath=".\SimpleFontInstance.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/Build/source/libs/icu/icu-xetex/test/letest/gendata.xml b/Build/source/libs/icu/icu-xetex/test/letest/gendata.xml
new file mode 100644
index 00000000000..a672644bc4c
--- /dev/null
+++ b/Build/source/libs/icu/icu-xetex/test/letest/gendata.xml
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Copyright (c) 1999-2008 International Business Machines
+ Corporation and others. All rights reserved.
+-->
+
+<layout-tests>
+ <test-case id="Ghita" script="deva">
+ <test-font name="raghu.ttf"/>
+ <test-text>श्रीमद् भगवद्गीता अध्याय अर्जुन विषाद योग धृतराष्ट्र उवाचृ धर्मक्षेत्रे कुरुक्षेत्रे समवेता युयुत्सवः मामकाः पाण्डवाश्चैव किमकुर्वत संजव</test-text>
+ </test-case>
+
+ <test-case id="Arabic" script="arab">
+ <test-font name="CODE2000.TTF"/>
+ <test-text>أساسًا، تتعامل الحواسيب فقط مع الأرقام، وتقوم بتخزين الأحرف والمحارف الأخرى بعد أن تُعطي رقما معينا لكل واحد منها. وقبل اختراع "يونِكود"، كان هناك مئات الأنظمة للتشفير وتخصيص هذه الأرقام للمحارف، ولم يوجد نظام تشفير واحد يحتوي على جميع المحارف الضرورية</test-text>
+ </test-case>
+
+ <test-case id="Unicode Arabic" script="arab">
+ <test-font name="LucidaSansRegular.ttf"/>
+ <test-text>أساسًا، تتعامل الحواسيب فقط مع الأرقام، وتقوم بتخزين الأحرف والمحارف الأخرى بعد أن تُعطي رقما معينا لكل واحد منها. وقبل اختراع "يونِكود"، كان هناك مئات الأنظمة للتشفير وتخصيص هذه الأرقام للمحارف، ولم يوجد نظام تشفير واحد يحتوي على جميع المحارف الضرورية</test-text>
+ </test-case>
+
+ <test-case id="Thai" script="thai">
+ <test-font name="angsd___.ttf"/>
+ <test-text>บทที่๑พายุไซโคลนโดโรธีอาศัยอยู่ท่ามกลางทุ่งใหญ่ในแคนซัสกับลุงเฮนรีชาวไร่และป้าเอ็มภรรยาชาวไร่บ้านของพวกเขาหลังเล็กเพราะไม้สร้างบ้านต้องขนมาด้วยเกวียนเป็นระยะทางหลายไมล์</test-text>
+ </test-case>
+
+ <test-case id="Arabic Simple" script="arab">
+ <test-text>أساسًا، تتعامل الحواسيب فقط مع الأرقام، وتقوم بتخزين الأحرف والمحارف الأخرى بعد أن تُعطي رقما معينا لكل واحد منها. وقبل اختراع "يونِكود"، كان هناك مئات الأنظمة للتشفير وتخصيص هذه الأرقام للمحارف، ولم يوجد نظام تشفير واحد يحتوي على جميع المحارف الضرورية</test-text>
+ </test-case>
+
+ <test-case id="Matra Test" script="deva">
+ <test-font name="Devamt.ttf"/>
+ <test-text>ुं ं॑</test-text>
+ </test-case>
+
+ <test-case id="Deva Stress Test" script="deva">
+ <test-font name="Devamt.ttf"/>
+ <test-text>कँ कं कः क॑ क॒ कँ॑ कं॒ कँंः क॒॑</test-text>
+ </test-case>
+
+ <test-case id="Deva Test" script="deva">
+ <test-font name="Devamt.ttf"/>
+ <test-text>रू क़् क्ष क्कि क्रि ट्रि हिन्दी र्क्रिं क्षत्रज्ञत्रक्ष श्र थ्र श्र कके र्कें केूकूेकेृ र्कू क़ क क् क्ष क्ष् क्ष्क ज़ ज ज् ज्ञ ज्ञ् ज्ञ्क र्क र्क्क ड्र क्क क़्क क़्क क़् क्ष्क क्ष् त्र्क द्द कि हि रू रु र्के र्कं क् कु के द्द्द क़्ष क्ष र्क्षे द्दत्र्क ज्ञ क्त्व ज्ञ्क र्कँ र्किँ र्केँ र्क्रिँ हिंदी ह्मिह्यिखि ङ्क ङ्म ङ्क्त ङ्ख ङ्ग ङ्घ ङ्क्ष ङ्क्ष्व ङ्क्ष्य र्क्त्वि र्र्र्र कै के कु कू कृ कॅ कॆ हु हू हॆ है हे</test-text>
+ </test-case>
+
+ <test-case id="Japanese Han" script="hani" lang="JAN">
+ <test-font name="ARIALUNI.TTF"/>
+ <test-text>中华人民共和国 台湾 中華人民共和國 臺灣</test-text>
+ </test-case>
+
+ <test-case id="Korean Han" script="hani" lang="KOR">
+ <test-font name="ARIALUNI.TTF"/>
+ <test-text>中华人民共和国 台湾 中華人民共和國 臺灣</test-text>
+ </test-case>
+
+ <test-case id="Traditional Han" script="hani" lang="ZHT">
+ <test-font name="ARIALUNI.TTF"/>
+ <test-text>中华人民共和国 台湾 中華人民共和國 臺灣</test-text>
+ </test-case>
+
+ <test-case id="Simplified Han" script="hani" lang="ZHS">
+ <test-font name="ARIALUNI.TTF"/>
+ <test-text>中华人民共和国 台湾 中華人民共和國 臺灣</test-text>
+ </test-case>
+
+ <test-case id="Deva locl Hindi" script="deva" lang="HIN">
+ <test-font name="TestFont1.otf"/>
+ <test-text>शङ़ु</test-text>
+ </test-case>
+
+ <test-case id="Deva locl Marathi" script="deva" lang="MAR">
+ <test-font name="TestFont1.otf"/>
+ <test-text>शङ़ु</test-text>
+ </test-case>
+
+ <test-case id="Deva ZWJ" script="deva">
+ <test-font name="raghu.ttf"/>
+ <test-text>क्ष र्क क्‍ष र्‍क</test-text>
+ </test-case>
+
+ <test-case id="Hangul" script="hang">
+ <test-text>마만만</test-text>
+ </test-case>
+
+ <test-case id="Hebrew Mark Test" script="hebr">
+ <test-font name="SBL_Hbrw.ttf"/>
+ <test-text>מָשְׁכֵנִיאַחֲרֶיךָנָּרוּצָההֱבִיאַנִיהַמֶּלֶךְחֲדָרָיונָגִילָהוְנִשְׂמְחָהבָּךְנַזְכִּירָהדֹדֶיךָמִיַּיִןמֵישָׁרִיםאֲהֵבוּךָ</test-text>
+ </test-case>
+
+ <test-case id="Broken Font Test" script="hani" lang="ZHT">
+ <test-font name="BMIN00M.TTF"/>
+ <test-text>中華人民共和國 臺灣</test-text>
+ </test-case>
+
+ <test-case id="Sinhala Al-Lakuna Test" script="sinh">
+ <test-font name="lklug.hj.ttf"/>
+ <test-text>ක්‍රෙ ක්‍යෙ ක්‍ෂෙ ක්‍ෂ්‍යෙ ක්ෂෙ කර්‍මෙ ස්ට්‍රේ ස‍්සෙ ස්ස</test-text>
+ </test-case>
+</layout-tests>
+ <test-case id="Not Language Specific" script="latn">
+ <test-font name="fp9r8a.otf"/>
+ <test-text>Ţhiş iş a ţeşţ.</test-text>
+ </test-case>
+
+ <test-case id="Romanian Language Specific" script="latn" lang="ROM">
+ <test-font name="fp9r8a.otf"/>
+ <test-text>Ţhiş iş a ţeşţ.</test-text>
+ </test-case>
+
+ <test-case id="Malayalam Samvruthokaram Test" script="mlym">
+ <test-font name="lohit_ml.ttf"/>
+ <test-text>ണു്</test-text>
+ </test-case>
diff --git a/Build/source/libs/icu/icu-xetex/test/letest/letest.cpp b/Build/source/libs/icu/icu-xetex/test/letest/letest.cpp
new file mode 100644
index 00000000000..df9bf8da932
--- /dev/null
+++ b/Build/source/libs/icu/icu-xetex/test/letest/letest.cpp
@@ -0,0 +1,1116 @@
+/*
+ *******************************************************************************
+ *
+ * Copyright (C) 1999-2008, International Business Machines
+ * Corporation and others. All Rights Reserved.
+ *
+ *******************************************************************************
+ * file name: letest.cpp
+ *
+ * created on: 11/06/2000
+ * created by: Eric R. Mader
+ */
+
+#include "unicode/utypes.h"
+#include "unicode/uclean.h"
+#include "unicode/uchar.h"
+#include "unicode/unistr.h"
+#include "unicode/uscript.h"
+#include "unicode/putil.h"
+#include "unicode/ctest.h"
+
+#include "layout/LETypes.h"
+#include "layout/LEScripts.h"
+#include "layout/LayoutEngine.h"
+
+#include "layout/ParagraphLayout.h"
+#include "layout/RunArrays.h"
+
+#include "PortableFontInstance.h"
+#include "SimpleFontInstance.h"
+
+#include "letsutil.h"
+#include "letest.h"
+
+#include "xmlparser.h"
+#include "putilimp.h" // for uprv_getUTCtime()
+
+#include <stdlib.h>
+#include <string.h>
+
+U_NAMESPACE_USE
+
+#define CH_COMMA 0x002C
+
+U_CDECL_BEGIN
+
+static void U_CALLCONV ScriptTest(void)
+{
+ if (scriptCodeCount != USCRIPT_CODE_LIMIT) {
+ log_err("ScriptCodes::scriptCodeCount = %n, but UScriptCode::USCRIPT_CODE_LIMIT = %n\n", scriptCodeCount, USCRIPT_CODE_LIMIT);
+ }
+}
+
+static void U_CALLCONV ParamTest(void)
+{
+ LEErrorCode status = LE_NO_ERROR;
+ SimpleFontInstance *font = new SimpleFontInstance(12, status);
+ LayoutEngine *engine = LayoutEngine::layoutEngineFactory(font, arabScriptCode, -1, status);
+ LEGlyphID *glyphs = NULL;
+ le_int32 *indices = NULL;
+ float *positions = NULL;
+ le_int32 glyphCount = 0;
+
+ glyphCount = engine->getGlyphCount();
+ if (glyphCount != 0) {
+ log_err("Calling getGlyphCount() on an empty layout returned %d.\n", glyphCount);
+ }
+
+ glyphs = NEW_ARRAY(LEGlyphID, glyphCount + 10);
+ indices = NEW_ARRAY(le_int32, glyphCount + 10);
+ positions = NEW_ARRAY(float, glyphCount + 10);
+
+ engine->getGlyphs(NULL, status);
+
+ if (status != LE_ILLEGAL_ARGUMENT_ERROR) {
+ log_err("Calling getGlyphs(NULL, status) did not return LE_ILLEGAL_ARGUMENT_ERROR.\n");
+ }
+
+ status = LE_NO_ERROR;
+ engine->getGlyphs(glyphs, status);
+
+ if (status != LE_NO_LAYOUT_ERROR) {
+ log_err("Calling getGlyphs(glyphs, status) on an empty layout did not return LE_NO_LAYOUT_ERROR.\n");
+ }
+
+ status = LE_NO_ERROR;
+ engine->getGlyphs(NULL, 0xFF000000L, status);
+
+ if (status != LE_ILLEGAL_ARGUMENT_ERROR) {
+ log_err("Calling getGlyphs(NULL, 0xFF000000L, status) did not return LE_ILLEGAL_ARGUMENT_ERROR.\n");
+ }
+
+ status = LE_NO_ERROR;
+ engine->getGlyphs(glyphs, 0xFF000000L, status);
+
+ if (status != LE_NO_LAYOUT_ERROR) {
+ log_err("Calling getGlyphs(glyphs, 0xFF000000L, status) on an empty layout did not return LE_NO_LAYOUT_ERROR.\n");
+ }
+
+ status = LE_NO_ERROR;
+ engine->getCharIndices(NULL, status);
+
+ if (status != LE_ILLEGAL_ARGUMENT_ERROR) {
+ log_err("Calling getCharIndices(NULL, status) did not return LE_ILLEGAL_ARGUMENT_ERROR.\n");
+ }
+
+ status = LE_NO_ERROR;
+ engine->getCharIndices(indices, status);
+
+ if (status != LE_NO_LAYOUT_ERROR) {
+ log_err("Calling getCharIndices(indices, status) on an empty layout did not return LE_NO_LAYOUT_ERROR.\n");
+ }
+
+ status = LE_NO_ERROR;
+ engine->getCharIndices(NULL, 1024, status);
+
+ if (status != LE_ILLEGAL_ARGUMENT_ERROR) {
+ log_err("Calling getCharIndices(NULL, 1024, status) did not return LE_ILLEGAL_ARGUMENT_ERROR.\n");
+ }
+
+ status = LE_NO_ERROR;
+ engine->getCharIndices(indices, 1024, status);
+
+ if (status != LE_NO_LAYOUT_ERROR) {
+ log_err("Calling getCharIndices(indices, 1024, status) on an empty layout did not return LE_NO_LAYOUT_ERROR.\n");
+ }
+
+ status = LE_NO_ERROR;
+ engine->getGlyphPositions(NULL, status);
+
+ if (status != LE_ILLEGAL_ARGUMENT_ERROR) {
+ log_err("Calling getGlyphPositions(NULL, status) did not return LE_ILLEGAL_ARGUMENT_ERROR.\n");
+ }
+
+ status = LE_NO_ERROR;
+ engine->getGlyphPositions(positions, status);
+
+ if (status != LE_NO_LAYOUT_ERROR) {
+ log_err("Calling getGlyphPositions(positions, status) on an empty layout did not return LE_NO_LAYOUT_ERROR.\n");
+ }
+
+ DELETE_ARRAY(positions);
+ DELETE_ARRAY(indices);
+ DELETE_ARRAY(glyphs);
+
+ status = LE_NO_ERROR;
+ glyphCount = engine->layoutChars(NULL, 0, 0, 0, FALSE, 0.0, 0.0, status);
+
+ if (status != LE_ILLEGAL_ARGUMENT_ERROR) {
+ log_err("Calling layoutChars(NULL, 0, 0, 0, FALSE, 0.0, 0.0, status) did not fail w/ LE_ILLEGAL_ARGUMENT_ERROR.\n");
+ }
+
+ LEUnicode chars[] = {
+ 0x0045, 0x006E, 0x0067, 0x006C, 0x0069, 0x0073, 0x0068, 0x0020, // "English "
+ 0x0645, 0x0627, 0x0646, 0x062A, 0x0648, 0x0634, // MEM ALIF KAF NOON TEH WAW SHEEN
+ 0x0020, 0x0074, 0x0065, 0x0078, 0x0074, 0x02E // " text."
+ };
+
+ status = LE_NO_ERROR;
+ glyphCount = engine->layoutChars(chars, -1, 6, 20, TRUE, 0.0, 0.0, status);
+
+ if (status != LE_ILLEGAL_ARGUMENT_ERROR) {
+ log_err("Calling layoutChars(chars, -1, 6, 20, TRUE, 0.0, 0.0, status) did not fail w/ LE_ILLEGAL_ARGUMENT_ERROR.\n");
+ }
+
+ status = LE_NO_ERROR;
+ glyphCount = engine->layoutChars(chars, 8, -1, 20, TRUE, 0.0, 0.0, status);
+
+ if (status != LE_ILLEGAL_ARGUMENT_ERROR) {
+ log_err("Calling layoutChars(chars, 8, -1, 20, TRUE, 0.0, 0.0, status) did not fail w/ LE_ILLEGAL_ARGUMENT_ERROR.\n");
+ }
+
+ status = LE_NO_ERROR;
+ glyphCount = engine->layoutChars(chars, 8, 6, -1, TRUE, 0.0, 0.0, status);
+
+ if (status != LE_ILLEGAL_ARGUMENT_ERROR) {
+ log_err("Calling layoutChars((chars, 8, 6, -1, TRUE, 0.0, 0.0, status) did not fail w/ LE_ILLEGAL_ARGUMENT_ERROR.\n");
+ }
+
+ status = LE_NO_ERROR;
+ glyphCount = engine->layoutChars(chars, 8, 6, 10, TRUE, 0.0, 0.0, status);
+
+ if (status != LE_ILLEGAL_ARGUMENT_ERROR) {
+ log_err("Calling layoutChars(chars, 8, 6, 10, TRUE, 0.0, 0.0, status) did not fail w/ LE_ILLEGAL_ARGUMENT_ERROR.\n");
+ }
+
+ float x = 0.0, y = 0.0;
+
+ status = LE_NO_ERROR;
+ glyphCount = engine->layoutChars(chars, 8, 6, 20, TRUE, 0.0, 0.0, status);
+
+ if (LE_FAILURE(status)) {
+ log_err("Calling layoutChars(chars, 8, 6, 20, TRUE, 0.0, 0.0, status) failed.\n");
+ goto bail;
+ }
+
+ engine->getGlyphPosition(-1, x, y, status);
+
+ if (status != LE_INDEX_OUT_OF_BOUNDS_ERROR) {
+ log_err("Calling getGlyphPosition(-1, x, y, status) did not fail w/ LE_INDEX_OUT_OF_BOUNDS_ERROR.\n");
+ }
+
+ status = LE_NO_ERROR;
+ engine->getGlyphPosition(glyphCount + 1, x, y, status);
+
+ if (status != LE_INDEX_OUT_OF_BOUNDS_ERROR) {
+ log_err("Calling getGlyphPosition(glyphCount + 1, x, y, status) did not fail w/ LE_INDEX_OUT_OF_BOUNDS_ERROR.\n");
+ }
+
+bail:
+ delete engine;
+ delete font;
+}
+U_CDECL_END
+
+U_CDECL_BEGIN
+static void U_CALLCONV FactoryTest(void)
+{
+ LEErrorCode status = LE_NO_ERROR;
+ SimpleFontInstance *font = new SimpleFontInstance(12, status);
+ LayoutEngine *engine = NULL;
+
+ for(le_int32 scriptCode = 0; scriptCode < scriptCodeCount; scriptCode += 1) {
+ status = LE_NO_ERROR;
+ engine = LayoutEngine::layoutEngineFactory(font, scriptCode, -1, status);
+
+ if (LE_FAILURE(status)) {
+ log_err("Could not create a LayoutEngine for script \'%s\'.\n", uscript_getShortName((UScriptCode)scriptCode));
+ }
+
+ delete engine;
+ }
+
+ delete font;
+}
+U_CDECL_END
+
+U_CDECL_BEGIN
+static void U_CALLCONV AccessTest(void)
+{
+ LEErrorCode status = LE_NO_ERROR;
+ SimpleFontInstance *font = new SimpleFontInstance(12, status);
+ LayoutEngine *engine = LayoutEngine::layoutEngineFactory(font, arabScriptCode, -1, status);
+ le_int32 glyphCount;
+ LEGlyphID glyphs[6], extraBitGlyphs[6];;
+ le_int32 biasedIndices[6], indices[6], glyph;
+ float positions[6 * 2 + 2];
+ LEUnicode chars[] = {
+ 0x0045, 0x006E, 0x0067, 0x006C, 0x0069, 0x0073, 0x0068, 0x0020, // "English "
+ 0x0645, 0x0627, 0x0646, 0x062A, 0x0648, 0x0634, // MEM ALIF KAF NOON TEH WAW SHEEN
+ 0x0020, 0x0074, 0x0065, 0x0078, 0x0074, 0x02E // " text."
+ };
+
+ if (LE_FAILURE(status)) {
+ log_err("Could not create LayoutEngine.\n");
+ goto bail;
+ }
+
+ glyphCount = engine->layoutChars(chars, 8, 6, 20, TRUE, 0.0, 0.0, status);
+
+ if (LE_FAILURE(status) || glyphCount != 6) {
+ log_err("layoutChars(chars, 8, 6, 20, TRUE, 0.0, 0.0, status) failed.\n");
+ goto bail;
+ }
+
+ engine->getGlyphs(glyphs, status);
+ engine->getCharIndices(indices, status);
+ engine->getGlyphPositions(positions, status);
+
+ if (LE_FAILURE(status)) {
+ log_err("Could not get glyph, indices and position arrays.\n");
+ goto bail;
+ }
+
+ engine->getGlyphs(extraBitGlyphs, 0xFF000000L, status);
+
+ if (LE_FAILURE(status)) {
+ log_err("getGlyphs(extraBitGlyphs, 0xFF000000L, status); failed.\n");
+ } else {
+ for(glyph = 0; glyph < glyphCount; glyph += 1) {
+ if (extraBitGlyphs[glyph] != (glyphs[glyph] | 0xFF000000L)) {
+ log_err("extraBigGlyphs[%d] != glyphs[%d] | 0xFF000000L: %8X, %8X\n",
+ glyph, glyph, extraBitGlyphs[glyph], glyphs[glyph]);
+ break;
+ }
+ }
+ }
+
+ status = LE_NO_ERROR;
+ engine->getCharIndices(biasedIndices, 1024, status);
+
+ if (LE_FAILURE(status)) {
+ log_err("getCharIndices(biasedIndices, 1024, status) failed.\n");
+ } else {
+ for (glyph = 0; glyph < glyphCount; glyph += 1) {
+ if (biasedIndices[glyph] != (indices[glyph] + 1024)) {
+ log_err("biasedIndices[%d] != indices[%d] + 1024: %8X, %8X\n",
+ glyph, glyph, biasedIndices[glyph], indices[glyph]);
+ break;
+ }
+ }
+ }
+
+ status = LE_NO_ERROR;
+ for (glyph = 0; glyph <= glyphCount; glyph += 1) {
+ float x = 0.0, y = 0.0;
+
+ engine->getGlyphPosition(glyph, x, y, status);
+
+ if (LE_FAILURE(status)) {
+ log_err("getGlyphPosition(%d, x, y, status) failed.\n", glyph);
+ break;
+ }
+
+ if (x != positions[glyph*2] || y != positions[glyph*2 + 1]) {
+ log_err("getGlyphPosition(%d, x, y, status) returned bad position: (%f, %f) != (%f, %f)\n",
+ glyph, x, y, positions[glyph*2], positions[glyph*2 + 1]);
+ break;
+ }
+ }
+
+bail:
+ delete engine;
+ delete font;
+}
+U_CDECL_END
+
+le_bool compareResults(const char *testID, TestResult *expected, TestResult *actual)
+{
+ /* NOTE: we'll stop on the first failure 'cause once there's one error, it may cascade... */
+ if (actual->glyphCount != expected->glyphCount) {
+ log_err("Test %s: incorrect glyph count: exptected %d, got %d\n",
+ testID, expected->glyphCount, actual->glyphCount);
+ return FALSE;
+ }
+
+ le_int32 i;
+
+ for (i = 0; i < actual->glyphCount; i += 1) {
+ if (actual->glyphs[i] != expected->glyphs[i]) {
+ log_err("Test %s: incorrect id for glyph %d: expected %4X, got %4X\n",
+ testID, i, expected->glyphs[i], actual->glyphs[i]);
+ return FALSE;
+ }
+ }
+
+ for (i = 0; i < actual->glyphCount; i += 1) {
+ if (actual->indices[i] != expected->indices[i]) {
+ log_err("Test %s: incorrect index for glyph %d: expected %8X, got %8X\n",
+ testID, i, expected->indices[i], actual->indices[i]);
+ return FALSE;
+ }
+ }
+
+ for (i = 0; i <= actual->glyphCount; i += 1) {
+ double xError = uprv_fabs(actual->positions[i * 2] - expected->positions[i * 2]);
+
+ if (xError > 0.0001) {
+ log_err("Test %s: incorrect x position for glyph %d: expected %f, got %f\n",
+ testID, i, expected->positions[i * 2], actual->positions[i * 2]);
+ return FALSE;
+ }
+
+ double yError = uprv_fabs(actual->positions[i * 2 + 1] - expected->positions[i * 2 + 1]);
+
+ if (yError < 0) {
+ yError = -yError;
+ }
+
+ if (yError > 0.0001) {
+ log_err("Test %s: incorrect y position for glyph %d: expected %f, got %f\n",
+ testID, i, expected->positions[i * 2 + 1], actual->positions[i * 2 + 1]);
+ return FALSE;
+ }
+ }
+
+ return TRUE;
+}
+
+static void checkFontVersion(PortableFontInstance *fontInstance, const char *testVersionString,
+ le_uint32 testChecksum, const char *testID)
+{
+ le_uint32 fontChecksum = fontInstance->getFontChecksum();
+
+ if (fontChecksum != testChecksum) {
+ const char *fontVersionString = fontInstance->getNameString(NAME_VERSION_STRING,
+ PLATFORM_MACINTOSH, MACINTOSH_ROMAN, MACINTOSH_ENGLISH);
+
+ // The standard recommends that the Macintosh Roman/English name string be present, but
+ // if it's not, try the Microsoft Unicode/English string.
+ if (fontVersionString == NULL) {
+ const LEUnicode16 *uversion = fontInstance->getUnicodeNameString(NAME_VERSION_STRING, PLATFORM_MICROSOFT, MICROSOFT_UNICODE_BMP, MICROSOFT_ENGLISH);
+
+ if (uversion != NULL) {
+ const UnicodeString usversion((const UChar *)uversion);
+
+ fontVersionString = getCString(&usversion);
+ fontInstance->deleteNameString(uversion);
+ }
+ }
+
+ log_info("Test %s: this may not be the same font used to generate the test data.\n", testID);
+ log_info("Your font's version string is \"%s\"\n", fontVersionString);
+ log_info("The expected version string is \"%s\"\n", testVersionString);
+ log_info("If you see errors, they may be due to the version of the font you're using.\n");
+
+ fontInstance->deleteNameString(fontVersionString);
+ }
+}
+
+/* Returns the path to icu/source/test/testdata/ */
+const char *getSourceTestData() {
+ const char *srcDataDir = NULL;
+#ifdef U_TOPSRCDIR
+ srcDataDir = U_TOPSRCDIR U_FILE_SEP_STRING"test"U_FILE_SEP_STRING"testdata"U_FILE_SEP_STRING;
+#else
+ srcDataDir = ".."U_FILE_SEP_STRING".."U_FILE_SEP_STRING"test"U_FILE_SEP_STRING"testdata"U_FILE_SEP_STRING;
+ FILE *f = fopen(".."U_FILE_SEP_STRING".."U_FILE_SEP_STRING"test"U_FILE_SEP_STRING"testdata"U_FILE_SEP_STRING"rbbitst.txt", "r");
+
+ if (f != NULL) {
+ /* We're in icu/source/test/letest/ */
+ fclose(f);
+ } else {
+ /* We're in icu/source/test/letest/(Debug|Release) */
+ srcDataDir = ".."U_FILE_SEP_STRING".."U_FILE_SEP_STRING".."U_FILE_SEP_STRING"test"U_FILE_SEP_STRING"testdata"U_FILE_SEP_STRING;
+ }
+#endif
+
+ return srcDataDir;
+}
+
+const char *getPath(char buffer[2048], const char *filename) {
+ const char *testDataDirectory = getSourceTestData();
+
+ strcpy(buffer, testDataDirectory);
+ strcat(buffer, filename);
+
+ return buffer;
+}
+
+le_uint32 *getHexArray(const UnicodeString &numbers, int32_t &arraySize)
+{
+ int32_t offset = -1;
+
+ arraySize = 1;
+ while((offset = numbers.indexOf(CH_COMMA, offset + 1)) >= 0) {
+ arraySize += 1;
+ }
+
+ le_uint32 *array = NEW_ARRAY(le_uint32, arraySize);
+ char number[16];
+ le_int32 count = 0;
+ le_int32 start = 0, end = 0;
+ le_int32 len = 0;
+
+ // trim leading whitespace
+ while(u_isUWhiteSpace(numbers[start])) {
+ start += 1;
+ }
+
+ while((end = numbers.indexOf(CH_COMMA, start)) >= 0) {
+ len = numbers.extract(start, end - start, number, ARRAY_SIZE(number), US_INV);
+ number[len] = '\0';
+ start = end + 1;
+
+ sscanf(number, "%x", &array[count++]);
+
+ // trim whitespace following the comma
+ while(u_isUWhiteSpace(numbers[start])) {
+ start += 1;
+ }
+ }
+
+ // trim trailing whitespace
+ end = numbers.length();
+ while(u_isUWhiteSpace(numbers[end - 1])) {
+ end -= 1;
+ }
+
+ len = numbers.extract(start, end - start, number, ARRAY_SIZE(number), US_INV);
+ number[len] = '\0';
+ sscanf(number, "%x", &array[count]);
+
+ return array;
+}
+
+float *getFloatArray(const UnicodeString &numbers, int32_t &arraySize)
+{
+ int32_t offset = -1;
+
+ arraySize = 1;
+ while((offset = numbers.indexOf(CH_COMMA, offset + 1)) >= 0) {
+ arraySize += 1;
+ }
+
+ float *array = NEW_ARRAY(float, arraySize);
+ char number[32];
+ le_int32 count = 0;
+ le_int32 start = 0, end = 0;
+ le_int32 len = 0;
+
+ // trim leading whitespace
+ while(u_isUWhiteSpace(numbers[start])) {
+ start += 1;
+ }
+
+ while((end = numbers.indexOf(CH_COMMA, start)) >= 0) {
+ len = numbers.extract(start, end - start, number, ARRAY_SIZE(number), US_INV);
+ number[len] = '\0';
+ start = end + 1;
+
+ sscanf(number, "%f", &array[count++]);
+
+ // trim whiteapce following the comma
+ while(u_isUWhiteSpace(numbers[start])) {
+ start += 1;
+ }
+ }
+
+ while(u_isUWhiteSpace(numbers[start])) {
+ start += 1;
+ }
+
+ // trim trailing whitespace
+ end = numbers.length();
+ while(u_isUWhiteSpace(numbers[end - 1])) {
+ end -= 1;
+ }
+
+ len = numbers.extract(start, end - start, number, ARRAY_SIZE(number), US_INV);
+ number[len] = '\0';
+ sscanf(number, "%f", &array[count]);
+
+ return array;
+}
+
+LEFontInstance *openFont(const char *fontName, const char *checksum, const char *version, const char *testID)
+{
+ char path[2048];
+ PortableFontInstance *font;
+ LEErrorCode fontStatus = LE_NO_ERROR;
+
+
+ font = new PortableFontInstance(getPath(path, fontName), 12, fontStatus);
+
+ if (LE_FAILURE(fontStatus)) {
+ log_info("Test %s: can't open font %s - test skipped.\n", testID, fontName);
+ delete font;
+ return NULL;
+ } else {
+ le_uint32 cksum = 0;
+
+ sscanf(checksum, "%x", &cksum);
+
+ checkFontVersion(font, version, cksum, testID);
+ }
+
+ return font;
+}
+
+U_CDECL_BEGIN
+static void U_CALLCONV DataDrivenTest(void)
+{
+#if !UCONFIG_NO_REGULAR_EXPRESSIONS
+ UErrorCode status = U_ZERO_ERROR;
+ char path[2048];
+ const char *testFilePath = getPath(path, "letest.xml");
+
+ UXMLParser *parser = UXMLParser::createParser(status);
+ UXMLElement *root = parser->parseFile(testFilePath, status);
+
+ if (root == NULL) {
+ log_err("Could not open the test data file: %s\n", testFilePath);
+ delete parser;
+ return;
+ }
+
+ UnicodeString test_case = UNICODE_STRING_SIMPLE("test-case");
+ UnicodeString test_text = UNICODE_STRING_SIMPLE("test-text");
+ UnicodeString test_font = UNICODE_STRING_SIMPLE("test-font");
+ UnicodeString result_glyphs = UNICODE_STRING_SIMPLE("result-glyphs");
+ UnicodeString result_indices = UNICODE_STRING_SIMPLE("result-indices");
+ UnicodeString result_positions = UNICODE_STRING_SIMPLE("result-positions");
+
+ // test-case attributes
+ UnicodeString id_attr = UNICODE_STRING_SIMPLE("id");
+ UnicodeString script_attr = UNICODE_STRING_SIMPLE("script");
+ UnicodeString lang_attr = UNICODE_STRING_SIMPLE("lang");
+
+ // test-font attributes
+ UnicodeString name_attr = UNICODE_STRING_SIMPLE("name");
+ UnicodeString ver_attr = UNICODE_STRING_SIMPLE("version");
+ UnicodeString cksum_attr = UNICODE_STRING_SIMPLE("checksum");
+
+ const UXMLElement *testCase;
+ int32_t tc = 0;
+
+ while((testCase = root->nextChildElement(tc)) != NULL) {
+ if (testCase->getTagName().compare(test_case) == 0) {
+ char *id = getCString(testCase->getAttribute(id_attr));
+ char *script = getCString(testCase->getAttribute(script_attr));
+ char *lang = getCString(testCase->getAttribute(lang_attr));
+ LEFontInstance *font = NULL;
+ const UXMLElement *element;
+ int32_t ec = 0;
+ int32_t charCount = 0;
+ int32_t typoFlags = 3; // kerning + ligatures...
+ UScriptCode scriptCode;
+ le_int32 languageCode = -1;
+ UnicodeString text, glyphs, indices, positions;
+ int32_t glyphCount = 0, indexCount = 0, positionCount = 0;
+ TestResult expected = {0, NULL, NULL, NULL};
+ TestResult actual = {0, NULL, NULL, NULL};
+ LEErrorCode success = LE_NO_ERROR;
+ LayoutEngine *engine = NULL;
+
+ uscript_getCode(script, &scriptCode, 1, &status);
+ if (LE_FAILURE(status)) {
+ log_err("invalid script name: %s.\n", script);
+ goto free_c_strings;
+ }
+
+ if (lang != NULL) {
+ languageCode = getLanguageCode(lang);
+
+ if (languageCode < 0) {
+ log_err("invalid language name: %s.\n", lang);
+ goto free_c_strings;
+ }
+ }
+
+ while((element = testCase->nextChildElement(ec)) != NULL) {
+ UnicodeString tag = element->getTagName();
+
+ // TODO: make sure that each element is only used once.
+ if (tag.compare(test_font) == 0) {
+ char *fontName = getCString(element->getAttribute(name_attr));
+ char *fontVer = getCString(element->getAttribute(ver_attr));
+ char *fontCksum = getCString(element->getAttribute(cksum_attr));
+
+ font = openFont(fontName, fontCksum, fontVer, id);
+ freeCString(fontCksum);
+ freeCString(fontVer);
+ freeCString(fontName);
+
+ if (font == NULL) {
+ // warning message already displayed...
+ goto free_c_strings;
+ }
+ } else if (tag.compare(test_text) == 0) {
+ text = element->getText(TRUE);
+ charCount = text.length();
+ } else if (tag.compare(result_glyphs) == 0) {
+ glyphs = element->getText(TRUE);
+ } else if (tag.compare(result_indices) == 0) {
+ indices = element->getText(TRUE);
+ } else if (tag.compare(result_positions) == 0) {
+ positions = element->getText(TRUE);
+ } else {
+ // an unknown tag...
+ char *cTag = getCString(&tag);
+
+ log_info("Test %s: unknown element with tag \"%s\"\n", id, cTag);
+ freeCString(cTag);
+ }
+ }
+
+ // TODO: make sure that the font, test-text, result-glyphs, result-indices and result-positions
+ // have all been provided
+ if (font == NULL) {
+ LEErrorCode fontStatus = LE_NO_ERROR;
+
+ font = new SimpleFontInstance(12, fontStatus);
+ typoFlags |= 0x80000000L; // use CharSubstitutionFilter...
+ }
+
+ expected.glyphs = (LEGlyphID *) getHexArray(glyphs, glyphCount);
+ expected.indices = (le_int32 *) getHexArray(indices, indexCount);
+ expected.positions = getFloatArray(positions, positionCount);
+
+ expected.glyphCount = glyphCount;
+
+ if (glyphCount < charCount || indexCount != glyphCount || positionCount < glyphCount * 2 + 2) {
+ log_err("Test %s: inconsistent input data: charCount = %d, glyphCount = %d, indexCount = %d, positionCount = %d\n",
+ id, charCount, glyphCount, indexCount, positionCount);
+ goto free_expected;
+ };
+
+ engine = LayoutEngine::layoutEngineFactory(font, scriptCode, languageCode, typoFlags, success);
+
+ if (LE_FAILURE(success)) {
+ log_err("Test %s: could not create a LayoutEngine.\n", id);
+ goto free_expected;
+ }
+
+ actual.glyphCount = engine->layoutChars(text.getBuffer(), 0, charCount, charCount, getRTL(text), 0, 0, success);
+
+ actual.glyphs = NEW_ARRAY(LEGlyphID, actual.glyphCount);
+ actual.indices = NEW_ARRAY(le_int32, actual.glyphCount);
+ actual.positions = NEW_ARRAY(float, actual.glyphCount * 2 + 2);
+
+ engine->getGlyphs(actual.glyphs, success);
+ engine->getCharIndices(actual.indices, success);
+ engine->getGlyphPositions(actual.positions, success);
+
+ compareResults(id, &expected, &actual);
+
+ DELETE_ARRAY(actual.positions);
+ DELETE_ARRAY(actual.indices);
+ DELETE_ARRAY(actual.glyphs);
+
+ delete engine;
+
+free_expected:
+ DELETE_ARRAY(expected.positions);
+ DELETE_ARRAY(expected.indices);
+ DELETE_ARRAY(expected.glyphs);
+
+ delete font;
+
+free_c_strings:
+ freeCString(lang);
+ freeCString(script);
+ freeCString(id);
+ }
+ }
+
+ delete root;
+ delete parser;
+#endif
+}
+U_CDECL_END
+
+U_CDECL_BEGIN
+/*
+ * From ticket:5923:
+ *
+ * Build a paragraph that contains a mixture of left to right and right to left text.
+ * Break it into multiple lines and make sure that the glyphToCharMap for run in each
+ * line is correct.
+ *
+ * Note: it might be a good idea to also check the glyphs and positions for each run,
+ * that we get the expected number of runs per line and that the line breaks are where
+ * we expect them to be. Really, it would be a good idea to make a whole test suite
+ * for ParagraphLayout.
+ */
+static void U_CALLCONV GlyphToCharTest(void)
+{
+ LEErrorCode status = LE_NO_ERROR;
+ LEFontInstance *font;
+ FontRuns fontRuns(0);
+ ParagraphLayout *paragraphLayout;
+ const ParagraphLayout::Line *line;
+ /*
+ * This is the same text that's in <icu>/source/samples/layout/Sample.txt
+ */
+ LEUnicode chars[] = {
+ /*BOM*/ 0x0054, 0x0068, 0x0065, 0x0020, 0x004c, 0x0061, 0x0079,
+ 0x006f, 0x0075, 0x0074, 0x0045, 0x006e, 0x0067, 0x0069, 0x006e,
+ 0x0065, 0x0020, 0x0064, 0x006f, 0x0065, 0x0073, 0x0020, 0x0061,
+ 0x006c, 0x006c, 0x0020, 0x0074, 0x0068, 0x0065, 0x0020, 0x0077,
+ 0x006f, 0x0072, 0x006b, 0x0020, 0x006e, 0x0065, 0x0063, 0x0065,
+ 0x0073, 0x0073, 0x0061, 0x0072, 0x0079, 0x0020, 0x0074, 0x006f,
+ 0x0020, 0x0064, 0x0069, 0x0073, 0x0070, 0x006c, 0x0061, 0x0079,
+ 0x0020, 0x0055, 0x006e, 0x0069, 0x0063, 0x006f, 0x0064, 0x0065,
+ 0x0020, 0x0074, 0x0065, 0x0078, 0x0074, 0x0020, 0x0077, 0x0072,
+ 0x0069, 0x0074, 0x0074, 0x0065, 0x006e, 0x0020, 0x0069, 0x006e,
+ 0x0020, 0x006c, 0x0061, 0x006e, 0x0067, 0x0075, 0x0061, 0x0067,
+ 0x0065, 0x0073, 0x0020, 0x0077, 0x0069, 0x0074, 0x0068, 0x0020,
+ 0x0063, 0x006f, 0x006d, 0x0070, 0x006c, 0x0065, 0x0078, 0x0020,
+ 0x0077, 0x0072, 0x0069, 0x0074, 0x0069, 0x006e, 0x0067, 0x0020,
+ 0x0073, 0x0079, 0x0073, 0x0074, 0x0065, 0x006d, 0x0073, 0x0020,
+ 0x0073, 0x0075, 0x0063, 0x0068, 0x0020, 0x0061, 0x0073, 0x0020,
+ 0x0048, 0x0069, 0x006e, 0x0064, 0x0069, 0x0020, 0x0028, 0x0939,
+ 0x093f, 0x0928, 0x094d, 0x0926, 0x0940, 0x0029, 0x0020, 0x0054,
+ 0x0068, 0x0061, 0x0069, 0x0020, 0x0028, 0x0e44, 0x0e17, 0x0e22,
+ 0x0029, 0x0020, 0x0061, 0x006e, 0x0064, 0x0020, 0x0041, 0x0072,
+ 0x0061, 0x0062, 0x0069, 0x0063, 0x0020, 0x0028, 0x0627, 0x0644,
+ 0x0639, 0x0631, 0x0628, 0x064a, 0x0629, 0x0029, 0x002e, 0x0020,
+ 0x0048, 0x0065, 0x0072, 0x0065, 0x0027, 0x0073, 0x0020, 0x0061,
+ 0x0020, 0x0073, 0x0061, 0x006d, 0x0070, 0x006c, 0x0065, 0x0020,
+ 0x006f, 0x0066, 0x0020, 0x0073, 0x006f, 0x006d, 0x0065, 0x0020,
+ 0x0074, 0x0065, 0x0078, 0x0074, 0x0020, 0x0077, 0x0072, 0x0069,
+ 0x0074, 0x0074, 0x0065, 0x006e, 0x0020, 0x0069, 0x006e, 0x0020,
+ 0x0053, 0x0061, 0x006e, 0x0073, 0x006b, 0x0072, 0x0069, 0x0074,
+ 0x003a, 0x0020, 0x0936, 0x094d, 0x0930, 0x0940, 0x092e, 0x0926,
+ 0x094d, 0x0020, 0x092d, 0x0917, 0x0935, 0x0926, 0x094d, 0x0917,
+ 0x0940, 0x0924, 0x093e, 0x0020, 0x0905, 0x0927, 0x094d, 0x092f,
+ 0x093e, 0x092f, 0x0020, 0x0905, 0x0930, 0x094d, 0x091c, 0x0941,
+ 0x0928, 0x0020, 0x0935, 0x093f, 0x0937, 0x093e, 0x0926, 0x0020,
+ 0x092f, 0x094b, 0x0917, 0x0020, 0x0927, 0x0943, 0x0924, 0x0930,
+ 0x093e, 0x0937, 0x094d, 0x091f, 0x094d, 0x0930, 0x0020, 0x0909,
+ 0x0935, 0x093e, 0x091a, 0x0964, 0x0020, 0x0927, 0x0930, 0x094d,
+ 0x092e, 0x0915, 0x094d, 0x0937, 0x0947, 0x0924, 0x094d, 0x0930,
+ 0x0947, 0x0020, 0x0915, 0x0941, 0x0930, 0x0941, 0x0915, 0x094d,
+ 0x0937, 0x0947, 0x0924, 0x094d, 0x0930, 0x0947, 0x0020, 0x0938,
+ 0x092e, 0x0935, 0x0947, 0x0924, 0x093e, 0x0020, 0x092f, 0x0941,
+ 0x092f, 0x0941, 0x0924, 0x094d, 0x0938, 0x0935, 0x0903, 0x0020,
+ 0x092e, 0x093e, 0x092e, 0x0915, 0x093e, 0x0903, 0x0020, 0x092a,
+ 0x093e, 0x0923, 0x094d, 0x0921, 0x0935, 0x093e, 0x0936, 0x094d,
+ 0x091a, 0x0948, 0x0935, 0x0020, 0x0915, 0x093f, 0x092e, 0x0915,
+ 0x0941, 0x0930, 0x094d, 0x0935, 0x0924, 0x0020, 0x0938, 0x0902,
+ 0x091c, 0x092f, 0x0020, 0x0048, 0x0065, 0x0072, 0x0065, 0x0027,
+ 0x0073, 0x0020, 0x0061, 0x0020, 0x0073, 0x0061, 0x006d, 0x0070,
+ 0x006c, 0x0065, 0x0020, 0x006f, 0x0066, 0x0020, 0x0073, 0x006f,
+ 0x006d, 0x0065, 0x0020, 0x0074, 0x0065, 0x0078, 0x0074, 0x0020,
+ 0x0077, 0x0072, 0x0069, 0x0074, 0x0074, 0x0065, 0x006e, 0x0020,
+ 0x0069, 0x006e, 0x0020, 0x0041, 0x0072, 0x0061, 0x0062, 0x0069,
+ 0x0063, 0x003a, 0x0020, 0x0623, 0x0633, 0x0627, 0x0633, 0x064b,
+ 0x0627, 0x060c, 0x0020, 0x062a, 0x062a, 0x0639, 0x0627, 0x0645,
+ 0x0644, 0x0020, 0x0627, 0x0644, 0x062d, 0x0648, 0x0627, 0x0633,
+ 0x064a, 0x0628, 0x0020, 0x0641, 0x0642, 0x0637, 0x0020, 0x0645,
+ 0x0639, 0x0020, 0x0627, 0x0644, 0x0623, 0x0631, 0x0642, 0x0627,
+ 0x0645, 0x060c, 0x0020, 0x0648, 0x062a, 0x0642, 0x0648, 0x0645,
+ 0x0020, 0x0628, 0x062a, 0x062e, 0x0632, 0x064a, 0x0646, 0x0020,
+ 0x0627, 0x0644, 0x0623, 0x062d, 0x0631, 0x0641, 0x0020, 0x0648,
+ 0x0627, 0x0644, 0x0645, 0x062d, 0x0627, 0x0631, 0x0641, 0x0020,
+ 0x0627, 0x0644, 0x0623, 0x062e, 0x0631, 0x0649, 0x0020, 0x0628,
+ 0x0639, 0x062f, 0x0020, 0x0623, 0x0646, 0x0020, 0x062a, 0x064f,
+ 0x0639, 0x0637, 0x064a, 0x0020, 0x0631, 0x0642, 0x0645, 0x0627,
+ 0x0020, 0x0645, 0x0639, 0x064a, 0x0646, 0x0627, 0x0020, 0x0644,
+ 0x0643, 0x0644, 0x0020, 0x0648, 0x0627, 0x062d, 0x062f, 0x0020,
+ 0x0645, 0x0646, 0x0647, 0x0627, 0x002e, 0x0020, 0x0648, 0x0642,
+ 0x0628, 0x0644, 0x0020, 0x0627, 0x062e, 0x062a, 0x0631, 0x0627,
+ 0x0639, 0x0020, 0x0022, 0x064a, 0x0648, 0x0646, 0x0650, 0x0643,
+ 0x0648, 0x062f, 0x0022, 0x060c, 0x0020, 0x0643, 0x0627, 0x0646,
+ 0x0020, 0x0647, 0x0646, 0x0627, 0x0643, 0x0020, 0x0645, 0x0626,
+ 0x0627, 0x062a, 0x0020, 0x0627, 0x0644, 0x0623, 0x0646, 0x0638,
+ 0x0645, 0x0629, 0x0020, 0x0644, 0x0644, 0x062a, 0x0634, 0x0641,
+ 0x064a, 0x0631, 0x0020, 0x0648, 0x062a, 0x062e, 0x0635, 0x064a,
+ 0x0635, 0x0020, 0x0647, 0x0630, 0x0647, 0x0020, 0x0627, 0x0644,
+ 0x0623, 0x0631, 0x0642, 0x0627, 0x0645, 0x0020, 0x0644, 0x0644,
+ 0x0645, 0x062d, 0x0627, 0x0631, 0x0641, 0x060c, 0x0020, 0x0648,
+ 0x0644, 0x0645, 0x0020, 0x064a, 0x0648, 0x062c, 0x062f, 0x0020,
+ 0x0646, 0x0638, 0x0627, 0x0645, 0x0020, 0x062a, 0x0634, 0x0641,
+ 0x064a, 0x0631, 0x0020, 0x0648, 0x0627, 0x062d, 0x062f, 0x0020,
+ 0x064a, 0x062d, 0x062a, 0x0648, 0x064a, 0x0020, 0x0639, 0x0644,
+ 0x0649, 0x0020, 0x062c, 0x0645, 0x064a, 0x0639, 0x0020, 0x0627,
+ 0x0644, 0x0645, 0x062d, 0x0627, 0x0631, 0x0641, 0x0020, 0x0627,
+ 0x0644, 0x0636, 0x0631, 0x0648, 0x0631, 0x064a, 0x0629, 0x0020,
+ 0x0061, 0x006e, 0x0064, 0x0020, 0x0068, 0x0065, 0x0072, 0x0065,
+ 0x0027, 0x0073, 0x0020, 0x0061, 0x0020, 0x0073, 0x0061, 0x006d,
+ 0x0070, 0x006c, 0x0065, 0x0020, 0x006f, 0x0066, 0x0020, 0x0073,
+ 0x006f, 0x006d, 0x0065, 0x0020, 0x0074, 0x0065, 0x0078, 0x0074,
+ 0x0020, 0x0077, 0x0072, 0x0069, 0x0074, 0x0074, 0x0065, 0x006e,
+ 0x0020, 0x0069, 0x006e, 0x0020, 0x0054, 0x0068, 0x0061, 0x0069,
+ 0x003a, 0x0020, 0x0e1a, 0x0e17, 0x0e17, 0x0e35, 0x0e48, 0x0e51,
+ 0x0e1e, 0x0e32, 0x0e22, 0x0e38, 0x0e44, 0x0e0b, 0x0e42, 0x0e04,
+ 0x0e25, 0x0e19, 0x0e42, 0x0e14, 0x0e42, 0x0e23, 0x0e18, 0x0e35,
+ 0x0e2d, 0x0e32, 0x0e28, 0x0e31, 0x0e22, 0x0e2d, 0x0e22, 0x0e39,
+ 0x0e48, 0x0e17, 0x0e48, 0x0e32, 0x0e21, 0x0e01, 0x0e25, 0x0e32,
+ 0x0e07, 0x0e17, 0x0e38, 0x0e48, 0x0e07, 0x0e43, 0x0e2b, 0x0e0d,
+ 0x0e48, 0x0e43, 0x0e19, 0x0e41, 0x0e04, 0x0e19, 0x0e0b, 0x0e31,
+ 0x0e2a, 0x0e01, 0x0e31, 0x0e1a, 0x0e25, 0x0e38, 0x0e07, 0x0e40,
+ 0x0e2e, 0x0e19, 0x0e23, 0x0e35, 0x0e0a, 0x0e32, 0x0e27, 0x0e44,
+ 0x0e23, 0x0e48, 0x0e41, 0x0e25, 0x0e30, 0x0e1b, 0x0e49, 0x0e32,
+ 0x0e40, 0x0e2d, 0x0e47, 0x0e21, 0x0e20, 0x0e23, 0x0e23, 0x0e22,
+ 0x0e32, 0x0e0a, 0x0e32, 0x0e27, 0x0e44, 0x0e23, 0x0e48, 0x0e1a,
+ 0x0e49, 0x0e32, 0x0e19, 0x0e02, 0x0e2d, 0x0e07, 0x0e1e, 0x0e27,
+ 0x0e01, 0x0e40, 0x0e02, 0x0e32, 0x0e2b, 0x0e25, 0x0e31, 0x0e07,
+ 0x0e40, 0x0e25, 0x0e47, 0x0e01, 0x0e40, 0x0e1e, 0x0e23, 0x0e32,
+ 0x0e30, 0x0e44, 0x0e21, 0x0e49, 0x0e2a, 0x0e23, 0x0e49, 0x0e32,
+ 0x0e07, 0x0e1a, 0x0e49, 0x0e32, 0x0e19, 0x0e15, 0x0e49, 0x0e2d,
+ 0x0e07, 0x0e02, 0x0e19, 0x0e21, 0x0e32, 0x0e14, 0x0e49, 0x0e27,
+ 0x0e22, 0x0e40, 0x0e01, 0x0e27, 0x0e35, 0x0e22, 0x0e19, 0x0e40,
+ 0x0e1b, 0x0e47, 0x0e19, 0x0e23, 0x0e30, 0x0e22, 0x0e30, 0x0e17,
+ 0x0e32, 0x0e07, 0x0e2b, 0x0e25, 0x0e32, 0x0e22, 0x0e44, 0x0e21,
+ 0x0e25, 0x0e4c
+ };
+ le_int32 charCount = LE_ARRAY_SIZE(chars);
+ le_int32 charIndex = 0, lineNumber = 1;
+ const float lineWidth = 600;
+
+ font = new SimpleFontInstance(12, status);
+
+ if (LE_FAILURE(status)) {
+ goto finish;
+ }
+
+ fontRuns.add(font, charCount);
+
+ paragraphLayout = new ParagraphLayout(chars, charCount, &fontRuns, NULL, NULL, NULL, 0, FALSE, status);
+
+ if (LE_FAILURE(status)) {
+ goto close_font;
+ }
+
+ paragraphLayout->reflow();
+ while ((line = paragraphLayout->nextLine(lineWidth)) != NULL) {
+ le_int32 runCount = line->countRuns();
+
+ for(le_int32 run = 0; run < runCount; run += 1) {
+ const ParagraphLayout::VisualRun *visualRun = line->getVisualRun(run);
+ le_int32 glyphCount = visualRun->getGlyphCount();
+ const le_int32 *glyphToCharMap = visualRun->getGlyphToCharMap();
+
+ if (visualRun->getDirection() == UBIDI_RTL) {
+ /*
+ * For a right to left run, make sure that the character indices
+ * increase from the right most glyph to the left most glyph. If
+ * there are any one to many glyph substitutions, we might get several
+ * glyphs in a row with the same character index.
+ */
+ for(le_int32 i = glyphCount - 1; i >= 0; i -= 1) {
+ le_int32 ix = glyphToCharMap[i];
+
+ if (ix != charIndex) {
+ if (ix != charIndex - 1) {
+ log_err("Bad glyph to char index for glyph %d on line %d: expected %d, got %d\n",
+ i, lineNumber, charIndex, ix);
+ goto close_paragraph; // once there's one error, we can't count on anything else...
+ }
+ } else {
+ charIndex += 1;
+ }
+ }
+ } else {
+ /*
+ * We can't just check the order of the character indices
+ * for left to right runs because Indic text might have been
+ * reordered. What we can do is find the minimum and maximum
+ * character indices in the run and make sure that the minimum
+ * is equal to charIndex and then advance charIndex to the maximum.
+ */
+ le_int32 minIndex = 0x7FFFFFFF, maxIndex = -1;
+
+ for(le_int32 i = 0; i < glyphCount; i += 1) {
+ le_int32 ix = glyphToCharMap[i];
+
+ if (ix > maxIndex) {
+ maxIndex = ix;
+ }
+
+ if (ix < minIndex) {
+ minIndex = ix;
+ }
+ }
+
+ if (minIndex != charIndex) {
+ log_err("Bad minIndex for run %d on line %d: expected %d, got %d\n",
+ run, lineNumber, charIndex, minIndex);
+ goto close_paragraph; // once there's one error, we can't count on anything else...
+ }
+
+ charIndex = maxIndex + 1;
+ }
+ }
+
+ lineNumber += 1;
+ }
+close_paragraph:
+ delete paragraphLayout;
+
+close_font:
+ delete font;
+
+finish:
+ return;
+}
+U_CDECL_END
+
+static void addAllTests(TestNode **root)
+{
+ addTest(root, &ScriptTest, "api/ScriptTest");
+ addTest(root, &ParamTest, "api/ParameterTest");
+ addTest(root, &FactoryTest, "api/FactoryTest");
+ addTest(root, &AccessTest, "layout/AccessTest");
+ addTest(root, &DataDrivenTest, "layout/DataDrivenTest");
+ addTest(root, &GlyphToCharTest, "paragraph/GlyphToCharTest");
+
+ addCTests(root);
+}
+
+/* returns the path to icu/source/data/out */
+static const char *ctest_dataOutDir()
+{
+ static const char *dataOutDir = NULL;
+
+ if(dataOutDir) {
+ return dataOutDir;
+ }
+
+ /* U_TOPBUILDDIR is set by the makefiles on UNIXes when building cintltst and intltst
+ // to point to the top of the build hierarchy, which may or
+ // may not be the same as the source directory, depending on
+ // the configure options used. At any rate,
+ // set the data path to the built data from this directory.
+ // The value is complete with quotes, so it can be used
+ // as-is as a string constant.
+ */
+#if defined (U_TOPBUILDDIR)
+ {
+ dataOutDir = U_TOPBUILDDIR "data"U_FILE_SEP_STRING"out"U_FILE_SEP_STRING;
+ }
+#else
+
+ /* On Windows, the file name obtained from __FILE__ includes a full path.
+ * This file is "wherever\icu\source\test\cintltst\cintltst.c"
+ * Change to "wherever\icu\source\data"
+ */
+ {
+ static char p[sizeof(__FILE__) + 20];
+ char *pBackSlash;
+ int i;
+
+ strcpy(p, __FILE__);
+ /* We want to back over three '\' chars. */
+ /* Only Windows should end up here, so looking for '\' is safe. */
+ for (i=1; i<=3; i++) {
+ pBackSlash = strrchr(p, U_FILE_SEP_CHAR);
+ if (pBackSlash != NULL) {
+ *pBackSlash = 0; /* Truncate the string at the '\' */
+ }
+ }
+
+ if (pBackSlash != NULL) {
+ /* We found and truncated three names from the path.
+ * Now append "source\data" and set the environment
+ */
+ strcpy(pBackSlash, U_FILE_SEP_STRING "data" U_FILE_SEP_STRING "out" U_FILE_SEP_STRING);
+ dataOutDir = p;
+ }
+ else {
+ /* __FILE__ on MSVC7 does not contain the directory */
+ FILE *file = fopen(".."U_FILE_SEP_STRING".."U_FILE_SEP_STRING "data" U_FILE_SEP_STRING "Makefile.in", "r");
+ if (file) {
+ fclose(file);
+ dataOutDir = ".."U_FILE_SEP_STRING".."U_FILE_SEP_STRING "data" U_FILE_SEP_STRING "out" U_FILE_SEP_STRING;
+ }
+ else {
+ dataOutDir = ".."U_FILE_SEP_STRING".."U_FILE_SEP_STRING".."U_FILE_SEP_STRING "data" U_FILE_SEP_STRING "out" U_FILE_SEP_STRING;
+ }
+ }
+ }
+#endif
+
+ return dataOutDir;
+}
+
+/* ctest_setICU_DATA - if the ICU_DATA environment variable is not already
+ * set, try to deduce the directory in which ICU was built,
+ * and set ICU_DATA to "icu/source/data" in that location.
+ * The intent is to allow the tests to have a good chance
+ * of running without requiring that the user manually set
+ * ICU_DATA. Common data isn't a problem, since it is
+ * picked up via a static (build time) reference, but the
+ * tests dynamically load some data.
+ */
+static void ctest_setICU_DATA() {
+
+ /* No location for the data dir was identifiable.
+ * Add other fallbacks for the test data location here if the need arises
+ */
+ if (getenv("ICU_DATA") == NULL) {
+ /* If ICU_DATA isn't set, set it to the usual location */
+ u_setDataDirectory(ctest_dataOutDir());
+ }
+}
+
+int main(int argc, char* argv[])
+{
+ int32_t nerrors = 0;
+ TestNode *root = NULL;
+ UErrorCode errorCode = U_ZERO_ERROR;
+ UDate startTime, endTime;
+ int32_t diffTime;
+
+ startTime = uprv_getUTCtime();
+
+ /* Check whether ICU will initialize without forcing the build data directory into
+ * the ICU_DATA path. Success here means either the data dll contains data, or that
+ * this test program was run with ICU_DATA set externally. Failure of this check
+ * is normal when ICU data is not packaged into a shared library.
+ *
+ * Whether or not this test succeeds, we want to cleanup and reinitialize
+ * with a data path so that data loading from individual files can be tested.
+ */
+ u_init(&errorCode);
+
+ if (U_FAILURE(errorCode)) {
+ fprintf(stderr,
+ "#### Note: ICU Init without build-specific setDataDirectory() failed.\n");
+ }
+
+ u_cleanup();
+ errorCode = U_ZERO_ERROR;
+
+ /* Initialize ICU */
+ ctest_setICU_DATA(); /* u_setDataDirectory() must happen Before u_init() */
+ u_init(&errorCode);
+
+ if (U_FAILURE(errorCode)) {
+ fprintf(stderr,
+ "#### ERROR! %s: u_init() failed with status = \"%s\".\n"
+ "*** Check the ICU_DATA environment variable and \n"
+ "*** check that the data files are present.\n", argv[0], u_errorName(errorCode));
+ return 1;
+ }
+
+ addAllTests(&root);
+ nerrors = processArgs(root, argc, argv);
+
+ cleanUpTestTree(root);
+ u_cleanup();
+
+ endTime = uprv_getUTCtime();
+ diffTime = (int32_t)(endTime - startTime);
+ printf("Elapsed Time: %02d:%02d:%02d.%03d\n",
+ (int)((diffTime%U_MILLIS_PER_DAY)/U_MILLIS_PER_HOUR),
+ (int)((diffTime%U_MILLIS_PER_HOUR)/U_MILLIS_PER_MINUTE),
+ (int)((diffTime%U_MILLIS_PER_MINUTE)/U_MILLIS_PER_SECOND),
+ (int)(diffTime%U_MILLIS_PER_SECOND));
+
+ return nerrors;
+}
+
diff --git a/Build/source/libs/icu/icu-xetex/test/letest/letest.h b/Build/source/libs/icu/icu-xetex/test/letest/letest.h
new file mode 100644
index 00000000000..9f066ca8c99
--- /dev/null
+++ b/Build/source/libs/icu/icu-xetex/test/letest/letest.h
@@ -0,0 +1,49 @@
+/*
+ *******************************************************************************
+ *
+ * Copyright (C) 1999-2007, International Business Machines
+ * Corporation and others. All Rights Reserved.
+ *
+ *******************************************************************************
+ * file name: letest.h
+ *
+ * created on: 11/06/2000
+ * created by: Eric R. Mader
+ */
+
+#ifndef __LETEST_H
+#define __LETEST_H
+
+#include "LETypes.h"
+#include "unicode/ctest.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+U_NAMESPACE_USE
+
+#define ARRAY_SIZE(array) (sizeof array / sizeof array[0])
+
+#define ARRAY_COPY(dst, src, count) memcpy((void *) (dst), (void *) (src), (count) * sizeof (src)[0])
+
+#define NEW_ARRAY(type,count) (type *) malloc((count) * sizeof(type))
+
+#define DELETE_ARRAY(array) free((void *) (array))
+
+#define GROW_ARRAY(array,newSize) realloc((void *) (array), (newSize) * sizeof (array)[0])
+
+struct TestResult
+{
+ le_int32 glyphCount;
+ LEGlyphID *glyphs;
+ le_int32 *indices;
+ float *positions;
+};
+
+#ifndef XP_CPLUSPLUS
+typedef struct TestResult TestResult;
+#endif
+
+U_CFUNC void addCTests(TestNode **root);
+
+#endif
diff --git a/Build/source/libs/icu/icu-xetex/test/letest/letest.sln b/Build/source/libs/icu/icu-xetex/test/letest/letest.sln
new file mode 100644
index 00000000000..de181d150ee
--- /dev/null
+++ b/Build/source/libs/icu/icu-xetex/test/letest/letest.sln
@@ -0,0 +1,30 @@
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "letest", "letest.vcproj", "{88CD8CC8-2CD7-40D1-8B31-672AF434468B}"
+ ProjectSection(ProjectDependencies) = postProject
+ {E7D9BA19-6ED3-4325-8D0D-D724F6D29C65} = {E7D9BA19-6ED3-4325-8D0D-D724F6D29C65}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ctestfw", "..\..\tools\ctestfw\ctestfw.vcproj", "{E7D9BA19-6ED3-4325-8D0D-D724F6D29C65}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfiguration) = preSolution
+ Debug = Debug
+ Release = Release
+ EndGlobalSection
+ GlobalSection(ProjectConfiguration) = postSolution
+ {88CD8CC8-2CD7-40D1-8B31-672AF434468B}.Debug.ActiveCfg = Debug|Win32
+ {88CD8CC8-2CD7-40D1-8B31-672AF434468B}.Debug.Build.0 = Debug|Win32
+ {88CD8CC8-2CD7-40D1-8B31-672AF434468B}.Release.ActiveCfg = Release|Win32
+ {88CD8CC8-2CD7-40D1-8B31-672AF434468B}.Release.Build.0 = Release|Win32
+ {E7D9BA19-6ED3-4325-8D0D-D724F6D29C65}.Debug.ActiveCfg = Debug|Win32
+ {E7D9BA19-6ED3-4325-8D0D-D724F6D29C65}.Debug.Build.0 = Debug|Win32
+ {E7D9BA19-6ED3-4325-8D0D-D724F6D29C65}.Release.ActiveCfg = Release|Win32
+ {E7D9BA19-6ED3-4325-8D0D-D724F6D29C65}.Release.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ EndGlobalSection
+ GlobalSection(ExtensibilityAddIns) = postSolution
+ EndGlobalSection
+EndGlobal
diff --git a/Build/source/libs/icu/icu-xetex/test/letest/letest.vcproj b/Build/source/libs/icu/icu-xetex/test/letest/letest.vcproj
new file mode 100644
index 00000000000..a028ac97a8e
--- /dev/null
+++ b/Build/source/libs/icu/icu-xetex/test/letest/letest.vcproj
@@ -0,0 +1,290 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="letest"
+ ProjectGUID="{67351485-4D18-4245-BE39-A7EF0675ACD2}"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\Release"
+ IntermediateDirectory=".\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\Release/letest.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..\include\layout;..\..\..\include;..\..\common;..\..\tools\ctestfw;..\..\tools\toolutil;..\..\layout"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ TreatWChar_tAsBuiltInType="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Release/letest.pch"
+ AssemblerListingLocation=".\Release/"
+ ObjectFile=".\Release/"
+ ProgramDataBaseFileName=".\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="../../../lib/icule.lib ../../../lib/icuuc.lib"
+ OutputFile=".\Release/letest.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\Release/letest.pdb"
+ SubSystem="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\Debug"
+ IntermediateDirectory=".\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\Debug/letest.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\include\layout;..\..\..\include;..\..\common;..\..\tools\ctestfw;..\..\tools\toolutil;..\..\layout"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ TreatWChar_tAsBuiltInType="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Debug/letest.pch"
+ AssemblerListingLocation=".\Debug/"
+ ObjectFile=".\Debug/"
+ ProgramDataBaseFileName=".\Debug/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\Debug/letest.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories=""
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\Debug/letest.pdb"
+ SubSystem="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseFAT32Workaround="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath=".\cfonts.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\cletest.c"
+ >
+ </File>
+ <File
+ RelativePath=".\cmaps.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\FontTableCache.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\letest.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\letsutil.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\PortableFontInstance.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\SimpleFontInstance.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\xmlreader.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath=".\cfonts.h"
+ >
+ </File>
+ <File
+ RelativePath=".\cmaps.h"
+ >
+ </File>
+ <File
+ RelativePath=".\FontTableCache.h"
+ >
+ </File>
+ <File
+ RelativePath=".\letest.h"
+ >
+ </File>
+ <File
+ RelativePath=".\letsutil.h"
+ >
+ </File>
+ <File
+ RelativePath=".\PortableFontInstance.h"
+ >
+ </File>
+ <File
+ RelativePath=".\sfnt.h"
+ >
+ </File>
+ <File
+ RelativePath=".\SimpleFontInstance.h"
+ >
+ </File>
+ <File
+ RelativePath=".\xmlreader.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/Build/source/libs/icu/icu-xetex/test/letest/letsutil.cpp b/Build/source/libs/icu/icu-xetex/test/letest/letsutil.cpp
new file mode 100644
index 00000000000..edac65ac9a2
--- /dev/null
+++ b/Build/source/libs/icu/icu-xetex/test/letest/letsutil.cpp
@@ -0,0 +1,98 @@
+/*
+ *******************************************************************************
+ *
+ * Copyright (C) 1999-2006, International Business Machines
+ * Corporation and others. All Rights Reserved.
+ *
+ *******************************************************************************
+ * file name: letsutil.cpp
+ *
+ * created on: 04/25/2006
+ * created by: Eric R. Mader
+ */
+
+#include "unicode/utypes.h"
+#include "unicode/unistr.h"
+#include "unicode/ubidi.h"
+
+#include "layout/LETypes.h"
+#include "layout/LEScripts.h"
+#include "layout/LayoutEngine.h"
+#include "layout/LELanguages.h"
+
+#include "OpenTypeLayoutEngine.h"
+
+#include "letest.h"
+#include "letsutil.h"
+
+U_NAMESPACE_USE
+
+char *getCString(const UnicodeString *uString)
+{
+ if (uString == NULL) {
+ return NULL;
+ }
+
+ le_int32 uLength = uString->length();
+ le_int32 cLength = uString->extract(0, uLength, NULL, 0, US_INV);
+ char *cString = NEW_ARRAY(char, cLength + 1);
+
+ uString->extract(0, uLength, cString, cLength, US_INV);
+ cString[cLength] = '\0';
+
+ return cString;
+}
+
+char *getUTF8String(const UnicodeString *uString)
+{
+ if (uString == NULL) {
+ return NULL;
+ }
+
+ le_int32 uLength = uString->length();
+ le_int32 cLength = uString->extract(0, uLength, NULL, 0, "UTF-8");
+ char *cString = NEW_ARRAY(char, cLength + 1);
+
+ uString->extract(0, uLength, cString, cLength, "UTF-8");
+
+ cString[cLength] = '\0';
+
+ return cString;
+}
+
+void freeCString(char *cString)
+{
+ DELETE_ARRAY(cString);
+}
+
+le_bool getRTL(const UnicodeString &text)
+{
+ UBiDiLevel paraLevel;
+ UErrorCode status = U_ZERO_ERROR;
+ le_int32 charCount = text.length();
+ UBiDi *ubidi = ubidi_openSized(charCount, 0, &status);
+
+ ubidi_setPara(ubidi, text.getBuffer(), charCount, UBIDI_DEFAULT_LTR, NULL, &status);
+ paraLevel = ubidi_getParaLevel(ubidi);
+ ubidi_close(ubidi);
+
+ return paraLevel & 1;
+}
+
+le_int32 getLanguageCode(const char *lang)
+{
+ if (strlen(lang) != 3) {
+ return -1;
+ }
+
+ LETag langTag = (LETag) ((lang[0] << 24) + (lang[1] << 16) + (lang[2] << 8) + 0x20);
+
+ for (le_int32 i = 0; i < languageCodeCount; i += 1) {
+ if (langTag == OpenTypeLayoutEngine::languageTags[i]) {
+ return i;
+ }
+ }
+
+ return -1;
+}
+
diff --git a/Build/source/libs/icu/icu-xetex/test/letest/letsutil.h b/Build/source/libs/icu/icu-xetex/test/letest/letsutil.h
new file mode 100644
index 00000000000..b7822e5d900
--- /dev/null
+++ b/Build/source/libs/icu/icu-xetex/test/letest/letsutil.h
@@ -0,0 +1,36 @@
+/*
+ *******************************************************************************
+ *
+ * Copyright (C) 1999-2006, International Business Machines
+ * Corporation and others. All Rights Reserved.
+ *
+ *******************************************************************************
+ * file name: letsutil.h
+ *
+ * created on: 04/25/2006
+ * created by: Eric R. Mader
+ */
+
+#ifndef __LETSUTIL_H
+#define __LETSUTIL_H
+
+#include "unicode/utypes.h"
+#include "unicode/unistr.h"
+#include "unicode/ubidi.h"
+
+#include "layout/LETypes.h"
+#include "layout/LEScripts.h"
+#include "layout/LayoutEngine.h"
+#include "layout/LELanguages.h"
+
+#include "OpenTypeLayoutEngine.h"
+
+#include "letest.h"
+
+char *getCString(const UnicodeString *uString);
+char *getUTF8String(const UnicodeString *uString);
+void freeCString(char *cString);
+le_bool getRTL(const UnicodeString &text);
+le_int32 getLanguageCode(const char *lang);
+
+#endif
diff --git a/Build/source/libs/icu/icu-xetex/test/letest/readme.html b/Build/source/libs/icu/icu-xetex/test/letest/readme.html
new file mode 100644
index 00000000000..8e91b9ae254
--- /dev/null
+++ b/Build/source/libs/icu/icu-xetex/test/letest/readme.html
@@ -0,0 +1,114 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta name="generator" content=
+"HTML Tidy for Windows (vers 26 April 2007), see www.w3.org">
+<meta http-equiv="Content-Type" content=
+"text/html; charset=us-ascii">
+<meta name="Copyright" content=
+"Copyright (c) 2001-2007, International Business Machines Corporation and others. All Rights Reserved.">
+<meta name="Author" content="Eric Mader">
+<meta name="GENERATOR" content=
+"Mozilla/4.72 [en] (Windows NT 5.0; U) [Netscape]">
+<title>Readme file for letest and gendata</title>
+</head>
+<body>
+<h2>What are letest and gendata?</h2>
+letest is a test program that you can use to verify the basic
+functionality of the ICU LayoutEngine. It tests the LayoutEngine's
+API and reads an XML file that contains test cases to test some of
+the features of the LayoutEngine. These test cases are not
+comprehensive, but they do test the most important features of
+&nbsp;the LayoutEngine. When you have successfully run letest, you
+can use the ICU LayoutEngine in you application knowing that the
+basic functionality is working correctly.<br>
+<p>gendata is a program that is used by the ICU team to build the
+file letest.xml which contains the test cases. Unless you have
+changed your copy of the LayoutEngine and want to validate the
+changes on other platforms, there's no reason for you to run this
+program.</p>
+<p>(The ICU team first runs a Windows application which uses the
+ICU LayoutEngine to display the text that letest uses. Once it has
+been verified that the text is displayed correctly, gendata is run
+to produce letest.xml, and then letest is run on Windows to verify
+that letest still works with the new data.)<br></p>
+<h2>How do I build letest?</h2>
+First, you need to build ICU, including the LayoutEngine.&nbsp;
+<p>On Windows, letest is part of the allinone project, so a normal
+build of ICU will also build letest. On UNIX systems, connect to
+&lt;top-build-dir&gt;/test/letest and do "make all" .<br></p>
+<h2>How do I run letest?</h2>
+Before you can run letest, you'll need to get the fonts it uses.
+For legal reasons, we can't include most of them with ICU, but you
+can download them from the web. To do this, you'll need access to a
+computer running Windows. All of the fonts should be stored in
+&lt;icu&gt;/source/test/testdata. Here's how to get the fonts:
+<p>Download a recent version of the Java 2 Platform, Standard
+Edition (J2SE) from <a href=
+"http://java.sun.com/javase/downloads/index.html">java.sun.com</a>.
+Click on the "Download" button for the version of Java that you
+want to download. The page offers both JDKs and JREs. (The JRE is
+sufficient for letest.) The download page will have a link to the
+license agreement. Be sure to read and understand the license
+agreement, and then click on the Accept button. Download the
+package and install it. You'll need one font. On Windows, it will
+be in, for example, "C:\Program Files\Java\jdk1.6.0\jre\lib\fonts".
+The file you want is "LucidaSansRegular.ttf". Copy this file into
+the directory from which you'll run letest.<br></p>
+<p>Next is the Hindi font. Go to the NCST site and download
+<a href="http://tdil.mit.gov.in/download/Raghu.htm">raghu.ttf</a>.
+When you hit the DOWNLOAD button on the page, it will open another
+window which contains a disclaimer and a license agreement. Be sure
+that you understand and agree to all of this before you download
+the font. You can download raghu.ttf into the directory from which
+you'll run letest.<br></p>
+<p>Then download the Thai font. Go to <a href=
+"http://www.into-asia.com/thai_language/thaifont/">into-asia.com</a>
+and click on the link for the Angsana font. This will download a
+.ZIP file. Extract the font file, angsd___.ttf, into the directory
+from which you will run letest.<br></p>
+<p>There's still one more font to get, the Code2000 Unicode font.
+Go to James Kass' <a href="http://www.code2000.net/">Unicode
+Support In Your Browser</a> page and click on the link that says
+"Click Here to download Code2000 shareware demo Unicode font." This
+will download a .ZIP file which contains CODE2000.TTF and
+CODE2000.HTM. Expand this .ZIP file and put the CODE2000.TTF file
+in the directory from which you'll run letest.<br></p>
+<p><span style="font-weight: bold;">Note:</span> The Code2000 font
+is shareware. If you want to use it for longer than a trial period,
+you should send a shareware fee to James. Directions for how to do
+this are in CODE2000.HTM.</p>
+<p>letest.xml references three other fonts:</p>
+<ul>
+<li>ARIALUNI.TTF is Microsoft's Arial Unicode MS font, which is
+distributed with Microsoft Office and is licensed only for use on
+the Windows operating system.</li>
+<li>Devamt.ttf is a proprietary font which cannot be freely
+downloaded.</li>
+<li>TestFont1.otf is included with ICU.</li>
+</ul>
+To run letest type CTRL+F5 in Visual Studio, or "make check" in
+UNIX.&nbsp; If everything's OK you should see something like this:
+<blockquote><tt>&nbsp;/<br>
+&nbsp;/api/<br>
+&nbsp;&nbsp; ---[OK]&nbsp; ---/api/ParameterTest<br>
+&nbsp;&nbsp; ---[OK]&nbsp; ---/api/FactoryTest<br>
+&nbsp;/layout/<br>
+&nbsp;&nbsp; ---[OK]&nbsp; ---/layout/AccessTest<br>
+&nbsp;&nbsp; ---[OK]&nbsp; ---/layout/DataDrivenTest<br>
+&nbsp;/c_api/<br>
+&nbsp;&nbsp; ---[OK]&nbsp; ---/c_api/ParameterTest<br>
+&nbsp;&nbsp; ---[OK]&nbsp; ---/c_api/FactoryTest<br>
+&nbsp;/c_layout/<br>
+&nbsp;&nbsp; ---[OK]&nbsp; ---/c_layout/AccessTest<br>
+&nbsp;&nbsp; ---[OK]&nbsp; ---/c_layout/DataDrivenTest<br>
+<br>
+[All tests passed successfully...]<br>
+Elapsed Time: 00:00:00.351<br></tt></blockquote>
+If letest cannot open a font, it will print a warning message and
+skip the test. letest will also check the version of the font you
+have to make sure it's the same one that was used to generate the
+test case. If the version doesn't match, letest will print a
+warning message and proceed with the test.<br>
+</body>
+</html>
diff --git a/Build/source/libs/icu/icu-xetex/test/letest/sfnt.h b/Build/source/libs/icu/icu-xetex/test/letest/sfnt.h
new file mode 100644
index 00000000000..f83f9212e35
--- /dev/null
+++ b/Build/source/libs/icu/icu-xetex/test/letest/sfnt.h
@@ -0,0 +1,449 @@
+/***************************************************************************
+*
+* Copyright (C) 1998-2008, International Business Machines
+* Corporation and others. All Rights Reserved.
+*
+************************************************************************/
+
+#ifndef __SFNT_H
+#define __SFNT_H
+
+#include "LETypes.h"
+
+U_NAMESPACE_USE
+
+#ifndef ANY_NUMBER
+#define ANY_NUMBER 1
+#endif
+
+struct DirectoryEntry
+{
+ le_uint32 tag;
+ le_uint32 checksum;
+ le_uint32 offset;
+ le_uint32 length;
+};
+
+#ifndef XP_CPLUSPLUS
+typedef struct DirectoryEntry DirectoryEntry;
+#endif
+
+struct SFNTDirectory
+{
+ le_uint32 scalerType;
+ le_uint16 numTables;
+ le_uint16 searchRange;
+ le_uint16 entrySelector;
+ le_uint16 rangeShift;
+ DirectoryEntry tableDirectory[ANY_NUMBER];
+};
+
+#ifndef XP_CPLUSPLUS
+typedef struct SFNTDirectory SFNTDirectory;
+#endif
+
+
+struct CMAPEncodingSubtableHeader
+{
+ le_uint16 platformID;
+ le_uint16 platformSpecificID;
+ le_uint32 encodingOffset;
+};
+
+#ifndef XP_CPLUSPLUS
+typedef struct CMAPEncodingSubtableHeader CMAPEncodingSubtableHeader;
+#endif
+
+struct CMAPTable
+{
+ le_uint16 version;
+ le_uint16 numberSubtables;
+ CMAPEncodingSubtableHeader encodingSubtableHeaders[ANY_NUMBER];
+};
+
+#ifndef XP_CPLUSPLUS
+typedef struct CMAPTable CMAPTable;
+#endif
+
+struct CMAPEncodingSubtable
+{
+ le_uint16 format;
+ le_uint16 length;
+ le_uint16 language;
+};
+
+#ifndef XP_CPLUSPLUS
+typedef struct CMAPEncodingSubtable CMAPEncodingSubtable;
+#endif
+
+#ifdef XP_CPLUSPLUS
+struct CMAPFormat0Encoding : CMAPEncodingSubtable
+{
+ le_uint8 glyphIndexArray[256];
+};
+#else
+struct CMAPFormat0Encoding
+{
+ CMAPEncodingSubtable base;
+
+ le_uint8 glyphIndexArray[256];
+};
+
+typedef struct CMAPFormat0Encoding CMAPFormat0Encoding;
+#endif
+
+struct CMAPFormat2Subheader
+{
+ le_uint16 firstCode;
+ le_uint16 entryCount;
+ le_int16 idDelta;
+ le_uint16 idRangeOffset;
+};
+
+#ifndef XP_CPLUSPLUS
+typedef struct CMAPFormat2Subheader CMAPFormat2Subheader;
+#endif
+
+#ifdef XP_CPLUSPLUS
+struct CMAPFormat2Encoding : CMAPEncodingSubtable
+{
+ le_uint16 subHeadKeys[256];
+ CMAPFormat2Subheader subheaders[ANY_NUMBER];
+};
+#else
+struct CMAPFormat2Encoding
+{
+ CMAPEncodingSubtable base;
+
+ le_uint16 subHeadKeys[256];
+ CMAPFormat2Subheader subheaders[ANY_NUMBER];
+};
+
+typedef struct CMAPFormat2Encoding CMAPFormat2Encoding;
+#endif
+
+#ifdef XP_CPLUSPLUS
+struct CMAPFormat4Encoding : CMAPEncodingSubtable
+{
+ le_uint16 segCountX2;
+ le_uint16 searchRange;
+ le_uint16 entrySelector;
+ le_uint16 rangeShift;
+ le_uint16 endCodes[ANY_NUMBER];
+/*
+ le_uint16 reservedPad;
+ le_uint16 startCodes[ANY_NUMBER];
+ le_uint16 idDelta[ANY_NUMBER];
+ le_uint16 idRangeOffset[ANY_NUMBER];
+ le_uint16 glyphIndexArray[ANY_NUMBER];
+*/
+};
+#else
+struct CMAPFormat4Encoding
+{
+ CMAPEncodingSubtable base;
+
+ le_uint16 segCountX2;
+ le_uint16 searchRange;
+ le_uint16 entrySelector;
+ le_uint16 rangeShift;
+ le_uint16 endCodes[ANY_NUMBER];
+/*
+// le_uint16 reservedPad;
+// le_uint16 startCodes[ANY_NUMBER];
+// le_uint16 idDelta[ANY_NUMBER];
+// le_uint16 idRangeOffset[ANY_NUMBER];
+// le_uint16 glyphIndexArray[ANY_NUMBER];
+*/
+};
+
+typedef struct CMAPFormat4Encoding CMAPFormat4Encoding;
+#endif
+
+#ifdef XP_CPLUSPLUS
+struct CMAPFormat6Encoding : CMAPEncodingSubtable
+{
+ le_uint16 firstCode;
+ le_uint16 entryCount;
+ le_uint16 glyphIndexArray[ANY_NUMBER];
+};
+#else
+struct CMAPFormat6Encoding
+{
+ CMAPEncodingSubtable base;
+
+ le_uint16 firstCode;
+ le_uint16 entryCount;
+ le_uint16 glyphIndexArray[ANY_NUMBER];
+};
+
+typedef struct CMAPFormat6Encoding CMAPFormat6Encoding;
+#endif
+
+struct CMAPEncodingSubtable32
+{
+ le_uint32 format;
+ le_uint32 length;
+ le_uint32 language;
+};
+
+#ifndef XP_CPLUSPLUS
+typedef struct CMAPEncodingSubtable32 CMAPEncodingSubtable32;
+#endif
+
+struct CMAPGroup
+{
+ le_uint32 startCharCode;
+ le_uint32 endCharCode;
+ le_uint32 startGlyphCode;
+};
+
+#ifndef XP_CPLUSPLUS
+typedef struct CMAPGroup CMAPGroup;
+#endif
+
+#ifdef XP_CPLUSPLUS
+struct CMAPFormat8Encoding : CMAPEncodingSubtable32
+{
+ le_uint32 is32[65536/32];
+ le_uint32 nGroups;
+ CMAPGroup groups[ANY_NUMBER];
+};
+#else
+struct CMAPFormat8Encoding
+{
+ CMAPEncodingSubtable32 base;
+
+ le_uint32 is32[65536/32];
+ le_uint32 nGroups;
+ CMAPGroup groups[ANY_NUMBER];
+};
+
+typedef struct CMAPFormat8Encoding CMAPFormat8Encoding;
+#endif
+
+#ifdef XP_CPLUSPLUS
+struct CMAPFormat10Encoding : CMAPEncodingSubtable32
+{
+ le_uint32 startCharCode;
+ le_uint32 numCharCodes;
+ le_uint16 glyphs[ANY_NUMBER];
+};
+#else
+struct CMAPFormat10Encoding
+{
+ CMAPEncodingSubtable32 base;
+
+ le_uint32 startCharCode;
+ le_uint32 numCharCodes;
+ le_uint16 glyphs[ANY_NUMBER];
+};
+
+typedef struct CMAPFormat10Encoding CMAPFormat10Encoding;
+#endif
+
+#ifdef XP_CPLUSPLUS
+struct CMAPFormat12Encoding : CMAPEncodingSubtable32
+{
+ le_uint32 nGroups;
+ CMAPGroup groups[ANY_NUMBER];
+};
+#else
+struct CMAPFormat12Encoding
+{
+ CMAPEncodingSubtable32 base;
+
+ le_uint32 nGroups;
+ CMAPGroup groups[ANY_NUMBER];
+};
+
+typedef struct CMAPFormat12Encoding CMAPFormat12Encoding;
+#endif
+
+typedef le_int32 fixed;
+
+struct BigDate
+{
+ le_uint32 bc;
+ le_uint32 ad;
+};
+
+#ifndef XP_CPLUSPLUS
+typedef struct BigDate BigDate;
+#endif
+
+struct HEADTable
+{
+ fixed version;
+ fixed fontRevision;
+ le_uint32 checksumAdjustment;
+ le_uint32 magicNumber;
+ le_uint16 flags;
+ le_uint16 unitsPerEm;
+ BigDate created;
+ BigDate modified;
+ le_int16 xMin;
+ le_int16 yMin;
+ le_int16 xMax;
+ le_int16 yMax;
+ le_int16 lowestRecPPEM;
+ le_int16 fontDirectionHint;
+ le_int16 indexToLocFormat;
+ le_int16 glyphDataFormat;
+};
+
+#ifndef XP_CPLUSPLUS
+typedef struct HEADTable HEADTable;
+#endif
+
+struct MAXPTable
+{
+ fixed version;
+ le_uint16 numGlyphs;
+ le_uint16 maxPoints;
+ le_uint16 maxContours;
+ le_uint16 maxComponentPoints;
+ le_uint16 maxComponentContours;
+ le_uint16 maxZones;
+ le_uint16 maxTwilightPoints;
+ le_uint16 maxStorage;
+ le_uint16 maxFunctionDefs;
+ le_uint16 maxInstructionDefs;
+ le_uint16 maxStackElements;
+ le_uint16 maxSizeOfInstructions;
+ le_uint16 maxComponentElements;
+ le_uint16 maxComponentDepth;
+};
+
+#ifndef XP_CPLUSPLUS
+typedef struct MAXPTable MAXPTable;
+#endif
+
+struct HHEATable
+{
+ fixed version;
+ le_int16 ascent;
+ le_int16 descent;
+ le_int16 lineGap;
+ le_uint16 advanceWidthMax;
+ le_int16 minLeftSideBearing;
+ le_int16 minRightSideBearing;
+ le_int16 xMaxExtent;
+ le_int16 caretSlopeRise;
+ le_int16 caretSlopeRun;
+ le_int16 caretOffset;
+ le_int16 reserved1;
+ le_int16 reserved2;
+ le_int16 reserved3;
+ le_int16 reserved4;
+ le_int16 metricDataFormat;
+ le_uint16 numOfLongHorMetrics;
+};
+
+#ifndef XP_CPLUSPLUS
+typedef struct HHEATable HHEATable;
+#endif
+
+struct LongHorMetric
+{
+ le_uint16 advanceWidth;
+ le_int16 leftSideBearing;
+};
+
+#ifndef XP_CPLUSPLUS
+typedef struct LongHorMetric LongHorMetric;
+#endif
+
+struct HMTXTable
+{
+ LongHorMetric hMetrics[ANY_NUMBER]; /* ANY_NUMBER = numOfLongHorMetrics from hhea table */
+/* le_int16 leftSideBearing[ANY_NUMBER]; ANY_NUMBER = numGlyphs - numOfLongHorMetrics */
+};
+
+#ifndef XP_CPLUSPLUS
+typedef struct HMTXTable HMTXTable;
+#endif
+
+enum PlatformID
+{
+ PLATFORM_UNICODE = 0,
+ PLATFORM_MACINTOSH = 1,
+ PLATFORM_ISO = 2,
+ PLATFORM_MICROSOFT = 3,
+ PLATFORM_CUSTOM = 4
+};
+
+enum MacintoshEncodingID
+{
+ MACINTOSH_ROMAN = 0
+};
+
+enum MacintoshLanguageID
+{
+ MACINTOSH_ENGLISH = 0
+};
+
+enum MicrosoftEncodingID
+{
+ MICROSOFT_UNICODE_BMP = 1,
+ MICROSOFT_UNICODE_FULL = 10
+};
+
+enum MicrosoftLanguageID
+{
+ MICROSOFT_ENGLISH = 0x409
+};
+
+enum NameID
+{
+ NAME_COPYRIGHT_NOTICE = 0,
+ NAME_FONT_FAMILY = 1,
+ NAME_FONT_SUB_FAMILY = 2,
+ NAME_UNIQUE_FONT_ID = 3,
+ NAME_FULL_FONT_NAME = 4,
+ NAME_VERSION_STRING = 5,
+ NAME_POSTSCRIPT_NAME = 6,
+ NAME_TRADEMARK = 7,
+ NAME_MANUFACTURER = 8,
+ NAME_DESIGNER = 9,
+ NAME_DESCRIPTION = 10,
+ NAME_VENDOR_URL = 11,
+ NAME_DESIGNER_URL = 12,
+ NAME_LICENSE_DESCRIPTION = 13,
+ NAME_LICENSE_URL = 14,
+ NAME_RESERVED = 15,
+ NAME_PREFERRED_FAMILY = 16,
+ NAME_PREFERRED_SUB_FAMILY = 17,
+ NAME_COMPATIBLE_FULL = 18,
+ NAME_SAMPLE_TEXT = 19,
+ NAME_POSTSCRIPT_CID = 20
+};
+
+struct NameRecord
+{
+ le_uint16 platformID;
+ le_uint16 encodingID;
+ le_uint16 languageID;
+ le_uint16 nameID;
+ le_uint16 length;
+ le_uint16 offset;
+};
+
+#ifndef XP_CPLUSPLUS
+typedef struct NameRecord NameRecord;
+#endif
+
+struct NAMETable
+{
+ le_uint16 version;
+ le_uint16 count;
+ le_uint16 stringOffset;
+ NameRecord nameRecords[ANY_NUMBER];
+};
+
+#ifndef XP_CPLUSPLUS
+typedef struct NAMETable NAMETable;
+#endif
+
+#endif
+
diff --git a/Build/source/libs/icu/icu-xetex/test/letest/testdata.cpp b/Build/source/libs/icu/icu-xetex/test/letest/testdata.cpp
new file mode 100644
index 00000000000..f0624d2f7de
--- /dev/null
+++ b/Build/source/libs/icu/icu-xetex/test/letest/testdata.cpp
@@ -0,0 +1,638 @@
+/*
+ *******************************************************************************
+ *
+ * Copyright (C) 1999-2005, International Business Machines
+ * Corporation and others. All Rights Reserved.
+ *
+ * WARNING: THIS FILE IS MACHINE GENERATED. DO NOT HAND EDIT IT
+ * UNLESS YOU REALLY KNOW WHAT YOU'RE DOING.
+ *
+ *******************************************************************************
+ *
+ * file name: testdata.cpp
+ * generated on: 02/28/2005 03:20:06 PM Pacific Standard Time
+ * generated by: gendata.cpp
+ */
+
+#include "LETypes.h"
+#include "LEScripts.h"
+#include "letest.h"
+
+const char *fontVersionString0 = "Version 0.99";
+le_uint32 fontChecksum0 = 0x541C94C7;
+
+LEUnicode inputText0[] =
+{
+ 0x0936, 0x094D, 0x0930, 0x0940, 0x092E, 0x0926, 0x094D, 0x0020,
+ 0x092D, 0x0917, 0x0935, 0x0926, 0x094D, 0x0917, 0x0940, 0x0924,
+ 0x093E, 0x0020, 0x0905, 0x0927, 0x094D, 0x092F, 0x093E, 0x092F,
+ 0x0020, 0x0905, 0x0930, 0x094D, 0x091C, 0x0941, 0x0928, 0x0020,
+ 0x0935, 0x093F, 0x0937, 0x093E, 0x0926, 0x0020, 0x092F, 0x094B,
+ 0x0917, 0x0020, 0x0927, 0x0943, 0x0924, 0x0930, 0x093E, 0x0937,
+ 0x094D, 0x091F, 0x094D, 0x0930, 0x0020, 0x0909, 0x0935, 0x093E,
+ 0x091A, 0x0943, 0x0020, 0x0927, 0x0930, 0x094D, 0x092E, 0x0915,
+ 0x094D, 0x0937, 0x0947, 0x0924, 0x094D, 0x0930, 0x0947, 0x0020,
+ 0x0915, 0x0941, 0x0930, 0x0941, 0x0915, 0x094D, 0x0937, 0x0947,
+ 0x0924, 0x094D, 0x0930, 0x0947, 0x0020, 0x0938, 0x092E, 0x0935,
+ 0x0947, 0x0924, 0x093E, 0x0020, 0x092F, 0x0941, 0x092F, 0x0941,
+ 0x0924, 0x094D, 0x0938, 0x0935, 0x0903, 0x0020, 0x092E, 0x093E,
+ 0x092E, 0x0915, 0x093E, 0x0903, 0x0020, 0x092A, 0x093E, 0x0923,
+ 0x094D, 0x0921, 0x0935, 0x093E, 0x0936, 0x094D, 0x091A, 0x0948,
+ 0x0935, 0x0020, 0x0915, 0x093F, 0x092E, 0x0915, 0x0941, 0x0930,
+ 0x094D, 0x0935, 0x0924, 0x0020, 0x0938, 0x0902, 0x091C, 0x0935
+};
+
+LEGlyphID resultGlyphs0[] =
+{
+ 0x0000012E, 0x0000FFFF, 0x0000FFFF, 0x00000222, 0x00000098, 0x0000026E, 0x0000FFFF, 0x00000003,
+ 0x00000097, 0x00000082, 0x0000009D, 0x000001A5, 0x0000FFFF, 0x0000FFFF, 0x00000222, 0x0000008F,
+ 0x00000221, 0x00000003, 0x0000005C, 0x000000DA, 0x0000FFFF, 0x00000099, 0x00000221, 0x00000099,
+ 0x00000003, 0x0000005C, 0x00000087, 0x000001D5, 0x0000005B, 0x0000FFFF, 0x00000093, 0x00000003,
+ 0x000001D2, 0x0000009D, 0x0000009F, 0x00000221, 0x00000091, 0x00000003, 0x00000099, 0x0000022A,
+ 0x00000082, 0x00000003, 0x00000092, 0x000001D9, 0x0000008F, 0x0000009A, 0x00000221, 0x000001B6,
+ 0x0000FFFF, 0x0000FFFF, 0x0000FFFF, 0x0000FFFF, 0x00000003, 0x00000060, 0x0000009D, 0x00000221,
+ 0x00000085, 0x000001D9, 0x00000003, 0x00000092, 0x00000098, 0x0000005B, 0x0000FFFF, 0x000000A2,
+ 0x0000FFFF, 0x0000FFFF, 0x0000022F, 0x0000011F, 0x0000FFFF, 0x0000FFFF, 0x0000022F, 0x00000003,
+ 0x00000080, 0x000001D5, 0x0000009A, 0x000001FD, 0x000000A2, 0x0000FFFF, 0x0000FFFF, 0x0000022F,
+ 0x0000011F, 0x0000FFFF, 0x0000FFFF, 0x0000022F, 0x00000003, 0x000000A0, 0x00000098, 0x0000009D,
+ 0x0000022F, 0x0000008F, 0x00000221, 0x00000003, 0x00000099, 0x000001D5, 0x00000099, 0x000001D5,
+ 0x000000D7, 0x0000FFFF, 0x000000A0, 0x0000009D, 0x0000022C, 0x00000003, 0x00000098, 0x00000221,
+ 0x00000098, 0x00000080, 0x00000221, 0x0000022C, 0x00000003, 0x00000094, 0x00000221, 0x000000D6,
+ 0x0000FFFF, 0x0000008C, 0x0000009D, 0x00000221, 0x000001B1, 0x0000FFFF, 0x0000FFFF, 0x00000230,
+ 0x0000009D, 0x00000003, 0x000001D1, 0x00000080, 0x00000098, 0x00000080, 0x000001D5, 0x0000009D,
+ 0x0000005B, 0x0000FFFF, 0x0000008F, 0x00000003, 0x000000A0, 0x00000232, 0x00000087, 0x0000009D
+};
+
+le_int32 resultGlyphCount0 = 136;
+
+le_int32 resultIndices0[] =
+{
+ 0x00000000, 0x00000002, 0x00000001, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007,
+ 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E, 0x0000000F,
+ 0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017,
+ 0x00000018, 0x00000019, 0x0000001C, 0x0000001D, 0x0000001A, 0x0000001B, 0x0000001E, 0x0000001F,
+ 0x00000021, 0x00000020, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027,
+ 0x00000028, 0x00000029, 0x0000002A, 0x0000002B, 0x0000002C, 0x0000002D, 0x0000002E, 0x0000002F,
+ 0x00000030, 0x00000031, 0x00000033, 0x00000032, 0x00000034, 0x00000035, 0x00000036, 0x00000037,
+ 0x00000038, 0x00000039, 0x0000003A, 0x0000003B, 0x0000003E, 0x0000003C, 0x0000003D, 0x0000003F,
+ 0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x00000045, 0x00000044, 0x00000046, 0x00000047,
+ 0x00000048, 0x00000049, 0x0000004A, 0x0000004B, 0x0000004C, 0x0000004D, 0x0000004E, 0x0000004F,
+ 0x00000050, 0x00000052, 0x00000051, 0x00000053, 0x00000054, 0x00000055, 0x00000056, 0x00000057,
+ 0x00000058, 0x00000059, 0x0000005A, 0x0000005B, 0x0000005C, 0x0000005D, 0x0000005E, 0x0000005F,
+ 0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000066, 0x00000067,
+ 0x00000068, 0x00000069, 0x0000006A, 0x0000006B, 0x0000006C, 0x0000006D, 0x0000006E, 0x0000006F,
+ 0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077,
+ 0x00000078, 0x00000079, 0x0000007B, 0x0000007A, 0x0000007C, 0x0000007D, 0x0000007E, 0x00000081,
+ 0x0000007F, 0x00000080, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000087
+};
+
+float resultPositions0[] =
+{
+ 0.000000F, 0.000000F, 9.468750F, 0.000000F, 9.468750F, 0.000000F, 9.468750F, 0.000000F,
+ 13.125000F, 0.000000F, 22.593750F, 0.000000F, 30.562500F, 0.000000F, 30.562500F, 0.000000F,
+ 36.562500F, 0.000000F, 46.031250F, 0.000000F, 55.500000F, 0.000000F, 63.468750F, 0.000000F,
+ 71.437500F, 0.000000F, 71.437500F, 0.000000F, 71.437500F, 0.000000F, 75.093750F, 0.000000F,
+ 83.062500F, 0.000000F, 86.718750F, 0.000000F, 92.718750F, 0.000000F, 102.656250F, 0.000000F,
+ 109.921875F, 0.000000F, 109.921875F, 0.000000F, 119.390625F, 0.000000F, 123.046875F, 0.000000F,
+ 132.515625F, 0.000000F, 138.515625F, 0.000000F, 148.453125F, 0.000000F, 158.203125F, -0.011719F,
+ 158.203125F, 0.263672F, 157.921875F, 0.000000F, 157.921875F, 0.000000F, 167.390625F, 0.000000F,
+ 173.390625F, 0.000000F, 177.750000F, 0.000000F, 185.718750F, 0.000000F, 193.687500F, 0.000000F,
+ 197.343750F, 0.000000F, 205.312500F, 0.000000F, 211.312500F, 0.000000F, 220.781250F, 0.000000F,
+ 224.859375F, 0.000000F, 234.328125F, 0.000000F, 240.328125F, 0.000000F, 250.224609F, -0.011719F,
+ 249.796875F, 0.000000F, 257.765625F, 0.000000F, 264.281250F, 0.000000F, 267.937500F, 0.000000F,
+ 276.281250F, 0.000000F, 276.281250F, 0.000000F, 276.281250F, 0.000000F, 276.281250F, 0.000000F,
+ 276.281250F, 0.000000F, 282.281250F, 0.000000F, 290.250000F, 0.000000F, 298.218750F, 0.000000F,
+ 301.875000F, 0.000000F, 311.859375F, -0.011719F, 311.343750F, 0.000000F, 317.343750F, 0.000000F,
+ 326.812500F, 0.000000F, 336.644531F, 0.263672F, 336.281250F, 0.000000F, 336.281250F, 0.000000F,
+ 347.156250F, 0.000000F, 347.156250F, 0.000000F, 346.353516F, 0.275391F, 347.156250F, 0.000000F,
+ 355.125000F, 0.000000F, 355.125000F, 0.000000F, 355.263672F, 0.263672F, 355.125000F, 0.000000F,
+ 361.125000F, 0.000000F, 368.824219F, -0.011719F, 372.000000F, 0.000000F, 378.515625F, 0.000000F,
+ 379.875000F, 0.000000F, 390.750000F, 0.000000F, 390.750000F, 0.000000F, 389.947266F, 0.275391F,
+ 390.750000F, 0.000000F, 398.718750F, 0.000000F, 398.718750F, 0.000000F, 398.857422F, 0.263672F,
+ 398.718750F, 0.000000F, 404.718750F, 0.000000F, 414.187500F, 0.000000F, 423.656250F, 0.000000F,
+ 430.769531F, 0.263672F, 431.625000F, 0.000000F, 439.593750F, 0.000000F, 443.250000F, 0.000000F,
+ 449.250000F, 0.000000F, 458.859375F, -0.011719F, 458.718750F, 0.000000F, 468.328125F, -0.011719F,
+ 468.187500F, 0.000000F, 474.117188F, 0.000000F, 474.117188F, 0.000000F, 483.585938F, 0.000000F,
+ 491.554688F, 0.000000F, 495.914063F, 0.000000F, 501.914063F, 0.000000F, 511.382813F, 0.000000F,
+ 515.039063F, 0.000000F, 524.507813F, 0.000000F, 535.382813F, 0.000000F, 539.039063F, 0.000000F,
+ 543.398438F, 0.000000F, 549.398438F, 0.000000F, 557.367188F, 0.000000F, 561.023438F, 0.000000F,
+ 568.289063F, 0.000000F, 568.289063F, 0.000000F, 576.257813F, 0.000000F, 584.226563F, 0.000000F,
+ 587.882813F, 0.000000F, 598.757813F, 0.000000F, 598.757813F, 0.000000F, 598.628906F, 0.263672F,
+ 598.757813F, 0.000000F, 606.726563F, 0.000000F, 612.726563F, 0.000000F, 617.085938F, 0.000000F,
+ 627.960938F, 0.000000F, 637.429688F, 0.000000F, 645.128906F, -0.011719F, 648.304688F, 0.000000F,
+ 656.566406F, 0.263672F, 656.273438F, 0.000000F, 656.273438F, 0.000000F, 664.242188F, 0.000000F,
+ 670.242188F, 0.000000F, 679.429688F, 0.966797F, 679.710938F, 0.000000F, 689.179688F, 0.000000F,
+ 697.148438F, 0.000000F
+};
+
+
+const char *fontVersionString1 = "Version 1.14";
+le_uint32 fontChecksum1 = 0x2B6E171D;
+
+LEUnicode inputText1[] =
+{
+ 0x0623, 0x0633, 0x0627, 0x0633, 0x064B, 0x0627, 0x060C, 0x0020,
+ 0x062A, 0x062A, 0x0639, 0x0627, 0x0645, 0x0644, 0x0020, 0x0627,
+ 0x0644, 0x062D, 0x0648, 0x0627, 0x0633, 0x064A, 0x0628, 0x0020,
+ 0x0641, 0x0642, 0x0637, 0x0020, 0x0645, 0x0639, 0x0020, 0x0627,
+ 0x0644, 0x0623, 0x0631, 0x0642, 0x0627, 0x0645, 0x060C, 0x0020,
+ 0x0648, 0x062A, 0x0642, 0x0648, 0x0645, 0x0020, 0x0628, 0x062A,
+ 0x062E, 0x0632, 0x064A, 0x0646, 0x0020, 0x0627, 0x0644, 0x0623,
+ 0x062D, 0x0631, 0x0641, 0x0020, 0x0648, 0x0627, 0x0644, 0x0645,
+ 0x062D, 0x0627, 0x0631, 0x0641, 0x0020, 0x0627, 0x0644, 0x0623,
+ 0x062E, 0x0631, 0x0649, 0x0020, 0x0628, 0x0639, 0x062F, 0x0020,
+ 0x0623, 0x0646, 0x0020, 0x062A, 0x064F, 0x0639, 0x0637, 0x064A,
+ 0x0020, 0x0631, 0x0642, 0x0645, 0x0627, 0x0020, 0x0645, 0x0639,
+ 0x064A, 0x0646, 0x0627, 0x0020, 0x0644, 0x0643, 0x0644, 0x0020,
+ 0x0648, 0x0627, 0x062D, 0x062F, 0x0020, 0x0645, 0x0646, 0x0647,
+ 0x0627, 0x002E, 0x0020, 0x0648, 0x0642, 0x0628, 0x0644, 0x0020,
+ 0x0627, 0x062E, 0x062A, 0x0631, 0x0627, 0x0639, 0x0020, 0x0022,
+ 0x064A, 0x0648, 0x0646, 0x0650, 0x0643, 0x0648, 0x062F, 0x0022,
+ 0x060C, 0x0020, 0x0643, 0x0627, 0x0646, 0x0020, 0x0647, 0x0646,
+ 0x0627, 0x0643, 0x0020, 0x0645, 0x0626, 0x0627, 0x062A, 0x0020,
+ 0x0627, 0x0644, 0x0623, 0x0646, 0x0638, 0x0645, 0x0629, 0x0020,
+ 0x0644, 0x0644, 0x062A, 0x0634, 0x0641, 0x064A, 0x0631, 0x0020,
+ 0x0648, 0x062A, 0x062E, 0x0635, 0x064A, 0x0635, 0x0020, 0x0647,
+ 0x0630, 0x0647, 0x0020, 0x0627, 0x0644, 0x0623, 0x0631, 0x0642,
+ 0x0627, 0x0645, 0x0020, 0x0644, 0x0644, 0x0645, 0x062D, 0x0627,
+ 0x0631, 0x0641, 0x060C, 0x0020, 0x0648, 0x0644, 0x0645, 0x0020,
+ 0x064A, 0x0648, 0x062C, 0x062F, 0x0020, 0x0646, 0x0638, 0x0627,
+ 0x0645, 0x0020, 0x062A, 0x0634, 0x0641, 0x064A, 0x0631, 0x0020,
+ 0x0648, 0x0627, 0x062D, 0x062F, 0x0020, 0x064A, 0x062D, 0x062A,
+ 0x0648, 0x064A, 0x0020, 0x0639, 0x0644, 0x0649, 0x0020, 0x062C,
+ 0x0645, 0x064A, 0x0639, 0x0020, 0x0627, 0x0644, 0x0645, 0x062D,
+ 0x0627, 0x0631, 0x0641, 0x0020, 0x0627, 0x0644, 0x0636, 0x0631,
+ 0x0648, 0x0631, 0x064A, 0x0629
+};
+
+LEGlyphID resultGlyphs1[] =
+{
+ 0x0000C530, 0x0000C58F, 0x0000C549, 0x0000C589, 0x0000C54A, 0x0000C55C, 0x0000C57B, 0x0000C529,
+ 0x00000003, 0x0000C56D, 0x0000C549, 0x0000C52A, 0x0000C540, 0x0000C580, 0x0000C57B, 0x0000C529,
+ 0x00000003, 0x0000C566, 0x0000C590, 0x0000C580, 0x0000C53B, 0x00000003, 0x0000C58C, 0x0000C57C,
+ 0x0000C567, 0x00000003, 0x0000C58D, 0x0000C58A, 0x0000C534, 0x0000C540, 0x0000C58F, 0x00000003,
+ 0x0000C546, 0x0000C53F, 0x0000C529, 0x0000C589, 0x00000003, 0x0000C54A, 0x0000C590, 0x0000C570,
+ 0x0000C554, 0x0000C533, 0x00000003, 0x0000C57D, 0x0000C52A, 0x0000C564, 0x0000C583, 0x00000003,
+ 0x0000C546, 0x0000C53B, 0x0000C58A, 0x0000C58F, 0x00000003, 0x0000C57E, 0x0000C57B, 0x0000C589,
+ 0x00000003, 0x00000528, 0x0000C56D, 0x0000C549, 0x0000C52A, 0x0000C540, 0x0000C580, 0x0000C57C,
+ 0x0000C57B, 0x00000003, 0x0000C57D, 0x0000C52A, 0x0000C573, 0x0000C549, 0x0000FFFE, 0x0000C593,
+ 0x0000C529, 0x00000003, 0x0000C585, 0x0000C548, 0x0000C587, 0x00000003, 0x0000C556, 0x0000C590,
+ 0x0000C558, 0x0000C544, 0x0000C533, 0x0000C589, 0x00000003, 0x0000C54A, 0x0000C590, 0x0000C570,
+ 0x0000C554, 0x0000C534, 0x0000C57C, 0x0000C57B, 0x00000003, 0x0000C530, 0x0000C580, 0x0000C564,
+ 0x0000C583, 0x0000FFFE, 0x0000C593, 0x0000C529, 0x00000003, 0x0000C531, 0x0000C52A, 0x00000530,
+ 0x0000C57F, 0x00000003, 0x0000C575, 0x0000C52A, 0x0000C584, 0x0000C587, 0x00000003, 0x0000C581,
+ 0x0000C52A, 0x0000C577, 0x00000003, 0x00000528, 0x00000005, 0x0000C545, 0x0000C58A, 0x0000C578,
+ 0x00000555, 0x0000C583, 0x0000C58A, 0x0000C58F, 0x00000005, 0x00000003, 0x0000C565, 0x0000C529,
+ 0x0000C54A, 0x0000C534, 0x0000C543, 0x0000C529, 0x00000003, 0x0000C57A, 0x0000C52E, 0x0000C573,
+ 0x0000C589, 0x00000003, 0x00000011, 0x0000C52A, 0x0000C588, 0x0000C584, 0x0000C57F, 0x00000003,
+ 0x0000C546, 0x0000C53F, 0x0000C529, 0x0000C589, 0x00000003, 0x0000C57A, 0x0000C578, 0x0000C57B,
+ 0x00000003, 0x0000C52A, 0x0000C584, 0x0000C590, 0x0000C568, 0x0000C57F, 0x00000003, 0x0000C52A,
+ 0x0000C580, 0x0000C573, 0x0000C549, 0x00000003, 0x0000C58E, 0x0000C560, 0x0000C568, 0x00000554,
+ 0x0000C533, 0x00000003, 0x0000C581, 0x0000C51F, 0x00000003, 0x0000C546, 0x0000C568, 0x0000C52D,
+ 0x00000003, 0x0000C58B, 0x0000C54A, 0x0000C543, 0x0000FFFE, 0x0000C593, 0x0000C529, 0x00000003,
+ 0x0000C56D, 0x0000C549, 0x0000C52A, 0x0000C540, 0x0000C580, 0x0000C57B, 0x0000C529, 0x0000C589,
+ 0x00000003, 0x0000C56D, 0x0000C54A, 0x0000C53F, 0x0000FFFE, 0x0000C593, 0x0000C529, 0x00000003,
+ 0x0000C582, 0x0000C58F, 0x0000C54C, 0x0000C544, 0x0000C534, 0x0000C52D, 0x00000003, 0x0000C57D,
+ 0x0000C58A, 0x0000C574, 0x0000C533, 0x0000C589, 0x00000003, 0x00000528, 0x0000C57D, 0x0000C52A,
+ 0x0000C573, 0x0000C549, 0x0000FFFE, 0x0000C593, 0x0000C529, 0x00000003, 0x0000C566, 0x0000C57F,
+ 0x00000003, 0x0000C55E, 0x0000C574, 0x0000C56F, 0x00000003, 0x0000C52C, 0x0000C590, 0x0000C54F,
+ 0x0000C529, 0x0000C58A, 0x0000C540, 0x0000C57B, 0x0000C529, 0x00000003, 0x0000C57A, 0x0000C57F,
+ 0x0000C52A, 0x0000C568, 0x0000C534, 0x0000C533, 0x00000003, 0x00000528, 0x0000C52A, 0x00000550,
+ 0x0000C54F, 0x0000C52A, 0x0000C54F, 0x0000C51F
+};
+
+le_int32 resultGlyphCount1 = 252;
+
+le_int32 resultIndices1[] =
+{
+ 0x000000FB, 0x000000FA, 0x000000F9, 0x000000F8, 0x000000F7, 0x000000F6, 0x000000F5, 0x000000F4,
+ 0x000000F3, 0x000000F2, 0x000000F1, 0x000000F0, 0x000000EF, 0x000000EE, 0x000000ED, 0x000000EC,
+ 0x000000EB, 0x000000EA, 0x000000E9, 0x000000E8, 0x000000E7, 0x000000E6, 0x000000E5, 0x000000E4,
+ 0x000000E3, 0x000000E2, 0x000000E1, 0x000000E0, 0x000000DF, 0x000000DE, 0x000000DD, 0x000000DC,
+ 0x000000DB, 0x000000DA, 0x000000D9, 0x000000D8, 0x000000D7, 0x000000D6, 0x000000D5, 0x000000D4,
+ 0x000000D3, 0x000000D2, 0x000000D1, 0x000000D0, 0x000000CF, 0x000000CE, 0x000000CD, 0x000000CC,
+ 0x000000CB, 0x000000CA, 0x000000C9, 0x000000C8, 0x000000C7, 0x000000C6, 0x000000C5, 0x000000C4,
+ 0x000000C3, 0x000000C2, 0x000000C1, 0x000000C0, 0x000000BF, 0x000000BE, 0x000000BD, 0x000000BC,
+ 0x000000BB, 0x000000BA, 0x000000B9, 0x000000B8, 0x000000B7, 0x000000B6, 0x000000B5, 0x000000B4,
+ 0x000000B3, 0x000000B2, 0x000000B1, 0x000000B0, 0x000000AF, 0x000000AE, 0x000000AD, 0x000000AC,
+ 0x000000AB, 0x000000AA, 0x000000A9, 0x000000A8, 0x000000A7, 0x000000A6, 0x000000A5, 0x000000A4,
+ 0x000000A3, 0x000000A2, 0x000000A1, 0x000000A0, 0x0000009F, 0x0000009E, 0x0000009D, 0x0000009C,
+ 0x0000009B, 0x0000009A, 0x00000099, 0x00000098, 0x00000097, 0x00000096, 0x00000095, 0x00000094,
+ 0x00000093, 0x00000092, 0x00000091, 0x00000090, 0x0000008F, 0x0000008E, 0x0000008D, 0x0000008C,
+ 0x0000008B, 0x0000008A, 0x00000089, 0x00000088, 0x00000087, 0x00000086, 0x00000085, 0x00000084,
+ 0x00000083, 0x00000082, 0x00000081, 0x00000080, 0x0000007F, 0x0000007E, 0x0000007D, 0x0000007C,
+ 0x0000007B, 0x0000007A, 0x00000079, 0x00000078, 0x00000077, 0x00000076, 0x00000075, 0x00000074,
+ 0x00000073, 0x00000072, 0x00000071, 0x00000070, 0x0000006F, 0x0000006E, 0x0000006D, 0x0000006C,
+ 0x0000006B, 0x0000006A, 0x00000069, 0x00000068, 0x00000067, 0x00000066, 0x00000065, 0x00000064,
+ 0x00000063, 0x00000062, 0x00000061, 0x00000060, 0x0000005F, 0x0000005E, 0x0000005D, 0x0000005C,
+ 0x0000005B, 0x0000005A, 0x00000059, 0x00000058, 0x00000057, 0x00000056, 0x00000055, 0x00000054,
+ 0x00000053, 0x00000052, 0x00000051, 0x00000050, 0x0000004F, 0x0000004E, 0x0000004D, 0x0000004C,
+ 0x0000004B, 0x0000004A, 0x00000049, 0x00000048, 0x00000047, 0x00000046, 0x00000045, 0x00000044,
+ 0x00000043, 0x00000042, 0x00000041, 0x00000040, 0x0000003F, 0x0000003E, 0x0000003D, 0x0000003C,
+ 0x0000003B, 0x0000003A, 0x00000039, 0x00000038, 0x00000037, 0x00000036, 0x00000035, 0x00000034,
+ 0x00000033, 0x00000032, 0x00000031, 0x00000030, 0x0000002F, 0x0000002E, 0x0000002D, 0x0000002C,
+ 0x0000002B, 0x0000002A, 0x00000029, 0x00000028, 0x00000027, 0x00000026, 0x00000025, 0x00000024,
+ 0x00000023, 0x00000022, 0x00000021, 0x00000020, 0x0000001F, 0x0000001E, 0x0000001D, 0x0000001C,
+ 0x0000001B, 0x0000001A, 0x00000019, 0x00000018, 0x00000017, 0x00000016, 0x00000015, 0x00000014,
+ 0x00000013, 0x00000012, 0x00000011, 0x00000010, 0x0000000F, 0x0000000E, 0x0000000D, 0x0000000C,
+ 0x0000000B, 0x0000000A, 0x00000009, 0x00000008, 0x00000007, 0x00000006, 0x00000005, 0x00000004,
+ 0x00000003, 0x00000002, 0x00000001, 0x00000000
+};
+
+float resultPositions1[] =
+{
+ 0.000000F, 0.000000F, 4.007813F, 0.000000F, 8.226563F, 0.000000F, 12.679688F, 0.000000F,
+ 18.679688F, 0.000000F, 23.132813F, 0.000000F, 31.289063F, 0.000000F, 34.312500F, 0.000000F,
+ 36.375000F, 0.000000F, 41.062500F, 0.000000F, 50.296875F, 0.000000F, 54.750000F, 0.000000F,
+ 56.859375F, 0.000000F, 62.367188F, 0.000000F, 66.632813F, 0.000000F, 69.656250F, 0.000000F,
+ 71.718750F, 0.000000F, 76.406250F, 0.000000F, 81.421875F, 0.000000F, 85.664063F, 0.000000F,
+ 89.929688F, 0.000000F, 95.742188F, 0.000000F, 100.429688F, 0.000000F, 108.796875F, 0.000000F,
+ 112.171875F, 0.000000F, 115.734375F, 0.000000F, 120.421875F, 0.000000F, 128.765625F, 0.000000F,
+ 134.765625F, 0.000000F, 139.007813F, 0.000000F, 144.515625F, 0.000000F, 148.734375F, 0.000000F,
+ 153.421875F, 0.000000F, 157.359375F, 0.000000F, 163.171875F, 0.000000F, 165.234375F, 0.000000F,
+ 171.234375F, 0.000000F, 175.921875F, 0.000000F, 180.375000F, 0.000000F, 184.617188F, 0.000000F,
+ 188.085938F, 0.000000F, 195.117188F, 0.000000F, 199.312500F, 0.000000F, 204.000000F, 0.000000F,
+ 208.007813F, 0.000000F, 210.117188F, 0.000000F, 217.054688F, 0.000000F, 220.429688F, 0.000000F,
+ 225.117188F, 0.000000F, 229.054688F, 0.000000F, 234.867188F, 0.000000F, 240.867188F, 0.000000F,
+ 245.085938F, 0.000000F, 249.773438F, 0.000000F, 253.781250F, 0.000000F, 256.804688F, 0.000000F,
+ 262.804688F, 0.000000F, 267.492188F, 0.000000F, 271.007813F, 0.000000F, 280.242188F, 0.000000F,
+ 284.695313F, 0.000000F, 286.804688F, 0.000000F, 292.312500F, 0.000000F, 296.578125F, 0.000000F,
+ 299.953125F, 0.000000F, 302.976563F, 0.000000F, 307.664063F, 0.000000F, 311.671875F, 0.000000F,
+ 313.781250F, 0.000000F, 317.882813F, 0.000000F, 322.335938F, 0.000000F, 322.335938F, 0.000000F,
+ 328.500000F, 0.000000F, 330.562500F, 0.000000F, 335.250000F, 0.000000F, 339.140625F, 0.000000F,
+ 343.078125F, 0.000000F, 348.984375F, 0.000000F, 353.671875F, 0.000000F, 366.445313F, 0.000000F,
+ 370.687500F, 0.000000F, 378.843750F, 0.000000F, 384.351563F, 0.000000F, 388.546875F, 0.000000F,
+ 394.546875F, 0.000000F, 399.234375F, 0.000000F, 403.687500F, 0.000000F, 407.929688F, 0.000000F,
+ 411.398438F, 0.000000F, 418.429688F, 0.000000F, 422.671875F, 0.000000F, 426.046875F, 0.000000F,
+ 429.070313F, 0.000000F, 433.757813F, 0.000000F, 437.765625F, 0.000000F, 442.031250F, 0.000000F,
+ 448.968750F, 0.000000F, 452.343750F, 0.000000F, 452.343750F, 0.000000F, 458.507813F, 0.000000F,
+ 460.570313F, 0.000000F, 465.257813F, 0.000000F, 474.492188F, 0.000000F, 476.601563F, 0.000000F,
+ 484.968750F, 0.000000F, 489.234375F, 0.000000F, 493.921875F, 0.000000F, 501.562500F, 0.000000F,
+ 503.671875F, 0.000000F, 507.890625F, 0.000000F, 513.796875F, 0.000000F, 518.484375F, 0.000000F,
+ 525.796875F, 0.000000F, 527.906250F, 0.000000F, 533.578125F, 0.000000F, 538.265625F, 0.000000F,
+ 541.781250F, 0.000000F, 547.171875F, 0.000000F, 550.710938F, 0.000000F, 556.710938F, 0.000000F,
+ 564.492188F, 0.000000F, 564.492188F, 0.000000F, 567.867188F, 0.000000F, 573.867188F, 0.000000F,
+ 578.085938F, 0.000000F, 583.476563F, 0.000000F, 588.164063F, 0.000000F, 593.976563F, 0.000000F,
+ 596.039063F, 0.000000F, 600.492188F, 0.000000F, 604.734375F, 0.000000F, 610.546875F, 0.000000F,
+ 612.609375F, 0.000000F, 617.296875F, 0.000000F, 623.695313F, 0.000000F, 627.937500F, 0.000000F,
+ 632.039063F, 0.000000F, 638.039063F, 0.000000F, 642.726563F, 0.000000F, 646.054688F, 0.000000F,
+ 648.164063F, 0.000000F, 651.914063F, 0.000000F, 656.132813F, 0.000000F, 660.398438F, 0.000000F,
+ 665.085938F, 0.000000F, 669.023438F, 0.000000F, 674.835938F, 0.000000F, 676.898438F, 0.000000F,
+ 682.898438F, 0.000000F, 687.585938F, 0.000000F, 693.984375F, 0.000000F, 701.765625F, 0.000000F,
+ 704.789063F, 0.000000F, 709.476563F, 0.000000F, 711.585938F, 0.000000F, 715.804688F, 0.000000F,
+ 720.046875F, 0.000000F, 723.515625F, 0.000000F, 727.781250F, 0.000000F, 732.468750F, 0.000000F,
+ 734.578125F, 0.000000F, 738.843750F, 0.000000F, 742.945313F, 0.000000F, 747.398438F, 0.000000F,
+ 752.085938F, 0.000000F, 760.453125F, 0.000000F, 767.390625F, 0.000000F, 770.859375F, 0.000000F,
+ 770.859375F, 0.000000F, 775.054688F, 0.000000F, 779.742188F, 0.000000F, 787.054688F, 0.000000F,
+ 789.398438F, 0.000000F, 794.085938F, 0.000000F, 798.023438F, 0.000000F, 801.492188F, 0.000000F,
+ 804.937500F, 0.000000F, 809.625000F, 0.000000F, 817.968750F, 0.000000F, 822.421875F, 0.000000F,
+ 828.234375F, 0.000000F, 828.234375F, 0.000000F, 834.398438F, 0.000000F, 836.460938F, 0.000000F,
+ 841.148438F, 0.000000F, 850.382813F, 0.000000F, 854.835938F, 0.000000F, 856.945313F, 0.000000F,
+ 862.453125F, 0.000000F, 866.718750F, 0.000000F, 869.742188F, 0.000000F, 871.804688F, 0.000000F,
+ 877.804688F, 0.000000F, 882.492188F, 0.000000F, 891.726563F, 0.000000F, 896.179688F, 0.000000F,
+ 901.992188F, 0.000000F, 901.992188F, 0.000000F, 908.156250F, 0.000000F, 910.218750F, 0.000000F,
+ 914.906250F, 0.000000F, 922.382813F, 0.000000F, 926.601563F, 0.000000F, 931.054688F, 0.000000F,
+ 936.562500F, 0.000000F, 940.804688F, 0.000000F, 944.250000F, 0.000000F, 948.937500F, 0.000000F,
+ 952.945313F, 0.000000F, 958.945313F, 0.000000F, 962.414063F, 0.000000F, 966.609375F, 0.000000F,
+ 972.609375F, 0.000000F, 977.296875F, 0.000000F, 980.812500F, 0.000000F, 984.820313F, 0.000000F,
+ 986.929688F, 0.000000F, 991.031250F, 0.000000F, 995.484375F, 0.000000F, 995.484375F, 0.000000F,
+ 1001.648438F, 0.000000F, 1003.710938F, 0.000000F, 1008.398438F, 0.000000F, 1013.414063F, 0.000000F,
+ 1017.679688F, 0.000000F, 1022.367188F, 0.000000F, 1030.312500F, 0.000000F, 1033.781250F, 0.000000F,
+ 1037.882813F, 0.000000F, 1042.570313F, 0.000000F, 1051.921875F, 0.000000F, 1056.164063F, 0.000000F,
+ 1062.984375F, 0.000000F, 1065.046875F, 0.000000F, 1071.046875F, 0.000000F, 1076.554688F, 0.000000F,
+ 1079.578125F, 0.000000F, 1081.640625F, 0.000000F, 1086.328125F, 0.000000F, 1092.726563F, 0.000000F,
+ 1096.992188F, 0.000000F, 1099.101563F, 0.000000F, 1102.570313F, 0.000000F, 1106.812500F, 0.000000F,
+ 1111.007813F, 0.000000F, 1115.695313F, 0.000000F, 1119.210938F, 0.000000F, 1121.320313F, 0.000000F,
+ 1121.320313F, 0.000000F, 1128.140625F, 0.000000F, 1130.250000F, 0.000000F, 1137.070313F, 0.000000F,
+ 1139.414063F, 0.000000F
+};
+
+
+const char *fontVersionString2 = "Version 1.20 - October 2000";
+le_uint32 fontChecksum2 = 0xF5D9BA6D;
+
+LEUnicode inputText2[] =
+{
+ 0x0623, 0x0633, 0x0627, 0x0633, 0x064B, 0x0627, 0x060C, 0x0020,
+ 0x062A, 0x062A, 0x0639, 0x0627, 0x0645, 0x0644, 0x0020, 0x0627,
+ 0x0644, 0x062D, 0x0648, 0x0627, 0x0633, 0x064A, 0x0628, 0x0020,
+ 0x0641, 0x0642, 0x0637, 0x0020, 0x0645, 0x0639, 0x0020, 0x0627,
+ 0x0644, 0x0623, 0x0631, 0x0642, 0x0627, 0x0645, 0x060C, 0x0020,
+ 0x0648, 0x062A, 0x0642, 0x0648, 0x0645, 0x0020, 0x0628, 0x062A,
+ 0x062E, 0x0632, 0x064A, 0x0646, 0x0020, 0x0627, 0x0644, 0x0623,
+ 0x062D, 0x0631, 0x0641, 0x0020, 0x0648, 0x0627, 0x0644, 0x0645,
+ 0x062D, 0x0627, 0x0631, 0x0641, 0x0020, 0x0627, 0x0644, 0x0623,
+ 0x062E, 0x0631, 0x0649, 0x0020, 0x0628, 0x0639, 0x062F, 0x0020,
+ 0x0623, 0x0646, 0x0020, 0x062A, 0x064F, 0x0639, 0x0637, 0x064A,
+ 0x0020, 0x0631, 0x0642, 0x0645, 0x0627, 0x0020, 0x0645, 0x0639,
+ 0x064A, 0x0646, 0x0627, 0x0020, 0x0644, 0x0643, 0x0644, 0x0020,
+ 0x0648, 0x0627, 0x062D, 0x062F, 0x0020, 0x0645, 0x0646, 0x0647,
+ 0x0627, 0x002E, 0x0020, 0x0648, 0x0642, 0x0628, 0x0644, 0x0020,
+ 0x0627, 0x062E, 0x062A, 0x0631, 0x0627, 0x0639, 0x0020, 0x0022,
+ 0x064A, 0x0648, 0x0646, 0x0650, 0x0643, 0x0648, 0x062F, 0x0022,
+ 0x060C, 0x0020, 0x0643, 0x0627, 0x0646, 0x0020, 0x0647, 0x0646,
+ 0x0627, 0x0643, 0x0020, 0x0645, 0x0626, 0x0627, 0x062A, 0x0020,
+ 0x0627, 0x0644, 0x0623, 0x0646, 0x0638, 0x0645, 0x0629, 0x0020,
+ 0x0644, 0x0644, 0x062A, 0x0634, 0x0641, 0x064A, 0x0631, 0x0020,
+ 0x0648, 0x062A, 0x062E, 0x0635, 0x064A, 0x0635, 0x0020, 0x0647,
+ 0x0630, 0x0647, 0x0020, 0x0627, 0x0644, 0x0623, 0x0631, 0x0642,
+ 0x0627, 0x0645, 0x0020, 0x0644, 0x0644, 0x0645, 0x062D, 0x0627,
+ 0x0631, 0x0641, 0x060C, 0x0020, 0x0648, 0x0644, 0x0645, 0x0020,
+ 0x064A, 0x0648, 0x062C, 0x062F, 0x0020, 0x0646, 0x0638, 0x0627,
+ 0x0645, 0x0020, 0x062A, 0x0634, 0x0641, 0x064A, 0x0631, 0x0020,
+ 0x0648, 0x0627, 0x062D, 0x062F, 0x0020, 0x064A, 0x062D, 0x062A,
+ 0x0648, 0x064A, 0x0020, 0x0639, 0x0644, 0x0649, 0x0020, 0x062C,
+ 0x0645, 0x064A, 0x0639, 0x0020, 0x0627, 0x0644, 0x0645, 0x062D,
+ 0x0627, 0x0631, 0x0641, 0x0020, 0x0627, 0x0644, 0x0636, 0x0631,
+ 0x0648, 0x0631, 0x064A, 0x0629
+};
+
+LEGlyphID resultGlyphs2[] =
+{
+ 0x00000872, 0x000008D1, 0x000003F9, 0x0000040B, 0x0000088C, 0x0000089E, 0x000008BD, 0x000003EF,
+ 0x00000003, 0x00000404, 0x000003F9, 0x0000086C, 0x00000882, 0x000008C2, 0x000008BD, 0x000003EF,
+ 0x00000003, 0x000008A8, 0x000008D2, 0x000008C2, 0x0000087D, 0x00000003, 0x000008CE, 0x000008BE,
+ 0x000008A9, 0x00000003, 0x0000040D, 0x000008CC, 0x00000876, 0x00000882, 0x000008D1, 0x00000003,
+ 0x00000888, 0x00000881, 0x000003EF, 0x0000040B, 0x00000003, 0x0000088C, 0x000008D2, 0x000008B2,
+ 0x00000896, 0x00000875, 0x00000003, 0x00000408, 0x0000086C, 0x000008A6, 0x000008C5, 0x00000003,
+ 0x00000888, 0x0000087D, 0x000008CC, 0x000008D1, 0x00000003, 0x000008C0, 0x000008BD, 0x0000040B,
+ 0x00000003, 0x000003E6, 0x00000404, 0x000003F9, 0x0000086C, 0x00000882, 0x000008C2, 0x000008BE,
+ 0x000008BD, 0x00000003, 0x00000408, 0x0000086C, 0x000008B5, 0x000003F9, 0x0000FFFF, 0x000008D5,
+ 0x000003EF, 0x00000003, 0x0000040A, 0x0000088A, 0x000008C9, 0x00000003, 0x00000898, 0x000008D2,
+ 0x0000089A, 0x00000886, 0x00000875, 0x0000040B, 0x00000003, 0x0000088C, 0x000008D2, 0x000008B2,
+ 0x00000896, 0x00000876, 0x000008BE, 0x000008BD, 0x00000003, 0x00000872, 0x000008C2, 0x000008A6,
+ 0x000008C5, 0x0000FFFF, 0x000008D5, 0x000003EF, 0x00000003, 0x000003F2, 0x0000086C, 0x0000086A,
+ 0x000008C1, 0x00000003, 0x00000406, 0x0000086C, 0x000008C6, 0x000008C9, 0x00000003, 0x00000409,
+ 0x0000086C, 0x000008B9, 0x00000003, 0x000003E6, 0x00000005, 0x000003F7, 0x000008CC, 0x000008BA,
+ 0x00000413, 0x000008C5, 0x000008CC, 0x000008D1, 0x00000005, 0x00000003, 0x00000401, 0x000003EF,
+ 0x0000088C, 0x00000876, 0x00000885, 0x000003EF, 0x00000003, 0x000008BC, 0x00000870, 0x000008B5,
+ 0x0000040B, 0x00000003, 0x00000011, 0x0000086C, 0x000008CA, 0x000008C6, 0x000008C1, 0x00000003,
+ 0x00000888, 0x00000881, 0x000003EF, 0x0000040B, 0x00000003, 0x000008BC, 0x000008BA, 0x000008BD,
+ 0x00000003, 0x0000086C, 0x000008C6, 0x000008D2, 0x000008AA, 0x000008C1, 0x00000003, 0x0000086C,
+ 0x000008C2, 0x000008B5, 0x000003F9, 0x00000003, 0x000008D0, 0x000008A2, 0x000008AA, 0x00000412,
+ 0x00000875, 0x00000003, 0x00000409, 0x000003EB, 0x00000003, 0x00000888, 0x000008AA, 0x0000086F,
+ 0x00000003, 0x0000040C, 0x0000088C, 0x00000885, 0x0000FFFF, 0x000008D5, 0x000003EF, 0x00000003,
+ 0x00000404, 0x000003F9, 0x0000086C, 0x00000882, 0x000008C2, 0x000008BD, 0x000003EF, 0x0000040B,
+ 0x00000003, 0x00000404, 0x0000088C, 0x00000881, 0x0000FFFF, 0x000008D5, 0x000003EF, 0x00000003,
+ 0x000008C4, 0x000008D1, 0x0000088E, 0x00000886, 0x00000876, 0x0000086F, 0x00000003, 0x00000408,
+ 0x000008CC, 0x000008B6, 0x00000875, 0x0000040B, 0x00000003, 0x000003E6, 0x00000408, 0x0000086C,
+ 0x000008B5, 0x000003F9, 0x0000FFFF, 0x000008D5, 0x000003EF, 0x00000003, 0x000008A8, 0x000008C1,
+ 0x00000003, 0x000008A0, 0x000008B6, 0x000008B1, 0x00000003, 0x0000086E, 0x000008D2, 0x00000891,
+ 0x000003EF, 0x000008CC, 0x00000882, 0x000008BD, 0x000003EF, 0x00000003, 0x000008BC, 0x000008C1,
+ 0x0000086C, 0x000008AA, 0x00000876, 0x00000875, 0x00000003, 0x000003E6, 0x0000086C, 0x0000040E,
+ 0x00000891, 0x0000086C, 0x00000891, 0x000003EB
+};
+
+le_int32 resultGlyphCount2 = 252;
+
+le_int32 resultIndices2[] =
+{
+ 0x000000FB, 0x000000FA, 0x000000F9, 0x000000F8, 0x000000F7, 0x000000F6, 0x000000F5, 0x000000F4,
+ 0x000000F3, 0x000000F2, 0x000000F1, 0x000000F0, 0x000000EF, 0x000000EE, 0x000000ED, 0x000000EC,
+ 0x000000EB, 0x000000EA, 0x000000E9, 0x000000E8, 0x000000E7, 0x000000E6, 0x000000E5, 0x000000E4,
+ 0x000000E3, 0x000000E2, 0x000000E1, 0x000000E0, 0x000000DF, 0x000000DE, 0x000000DD, 0x000000DC,
+ 0x000000DB, 0x000000DA, 0x000000D9, 0x000000D8, 0x000000D7, 0x000000D6, 0x000000D5, 0x000000D4,
+ 0x000000D3, 0x000000D2, 0x000000D1, 0x000000D0, 0x000000CF, 0x000000CE, 0x000000CD, 0x000000CC,
+ 0x000000CB, 0x000000CA, 0x000000C9, 0x000000C8, 0x000000C7, 0x000000C6, 0x000000C5, 0x000000C4,
+ 0x000000C3, 0x000000C2, 0x000000C1, 0x000000C0, 0x000000BF, 0x000000BE, 0x000000BD, 0x000000BC,
+ 0x000000BB, 0x000000BA, 0x000000B9, 0x000000B8, 0x000000B7, 0x000000B6, 0x000000B5, 0x000000B4,
+ 0x000000B3, 0x000000B2, 0x000000B1, 0x000000B0, 0x000000AF, 0x000000AE, 0x000000AD, 0x000000AC,
+ 0x000000AB, 0x000000AA, 0x000000A9, 0x000000A8, 0x000000A7, 0x000000A6, 0x000000A5, 0x000000A4,
+ 0x000000A3, 0x000000A2, 0x000000A1, 0x000000A0, 0x0000009F, 0x0000009E, 0x0000009D, 0x0000009C,
+ 0x0000009B, 0x0000009A, 0x00000099, 0x00000098, 0x00000097, 0x00000096, 0x00000095, 0x00000094,
+ 0x00000093, 0x00000092, 0x00000091, 0x00000090, 0x0000008F, 0x0000008E, 0x0000008D, 0x0000008C,
+ 0x0000008B, 0x0000008A, 0x00000089, 0x00000088, 0x00000087, 0x00000086, 0x00000085, 0x00000084,
+ 0x00000083, 0x00000082, 0x00000081, 0x00000080, 0x0000007F, 0x0000007E, 0x0000007D, 0x0000007C,
+ 0x0000007B, 0x0000007A, 0x00000079, 0x00000078, 0x00000077, 0x00000076, 0x00000075, 0x00000074,
+ 0x00000073, 0x00000072, 0x00000071, 0x00000070, 0x0000006F, 0x0000006E, 0x0000006D, 0x0000006C,
+ 0x0000006B, 0x0000006A, 0x00000069, 0x00000068, 0x00000067, 0x00000066, 0x00000065, 0x00000064,
+ 0x00000063, 0x00000062, 0x00000061, 0x00000060, 0x0000005F, 0x0000005E, 0x0000005D, 0x0000005C,
+ 0x0000005B, 0x0000005A, 0x00000059, 0x00000058, 0x00000057, 0x00000056, 0x00000055, 0x00000054,
+ 0x00000053, 0x00000052, 0x00000051, 0x00000050, 0x0000004F, 0x0000004E, 0x0000004D, 0x0000004C,
+ 0x0000004B, 0x0000004A, 0x00000049, 0x00000048, 0x00000047, 0x00000046, 0x00000045, 0x00000044,
+ 0x00000043, 0x00000042, 0x00000041, 0x00000040, 0x0000003F, 0x0000003E, 0x0000003D, 0x0000003C,
+ 0x0000003B, 0x0000003A, 0x00000039, 0x00000038, 0x00000037, 0x00000036, 0x00000035, 0x00000034,
+ 0x00000033, 0x00000032, 0x00000031, 0x00000030, 0x0000002F, 0x0000002E, 0x0000002D, 0x0000002C,
+ 0x0000002B, 0x0000002A, 0x00000029, 0x00000028, 0x00000027, 0x00000026, 0x00000025, 0x00000024,
+ 0x00000023, 0x00000022, 0x00000021, 0x00000020, 0x0000001F, 0x0000001E, 0x0000001D, 0x0000001C,
+ 0x0000001B, 0x0000001A, 0x00000019, 0x00000018, 0x00000017, 0x00000016, 0x00000015, 0x00000014,
+ 0x00000013, 0x00000012, 0x00000011, 0x00000010, 0x0000000F, 0x0000000E, 0x0000000D, 0x0000000C,
+ 0x0000000B, 0x0000000A, 0x00000009, 0x00000008, 0x00000007, 0x00000006, 0x00000005, 0x00000004,
+ 0x00000003, 0x00000002, 0x00000001, 0x00000000
+};
+
+float resultPositions2[] =
+{
+ 0.000000F, 0.000000F, 6.316406F, 0.000000F, 10.382813F, 0.000000F, 15.492188F, 0.000000F,
+ 21.035156F, 0.000000F, 27.058594F, 0.000000F, 39.527344F, 0.000000F, 43.792969F, 0.000000F,
+ 47.408203F, 0.000000F, 51.205078F, 0.000000F, 66.216797F, 0.000000F, 71.326172F, 0.000000F,
+ 74.695313F, 0.000000F, 83.367188F, 0.000000F, 90.826172F, 0.000000F, 95.091797F, 0.000000F,
+ 98.707031F, 0.000000F, 102.503906F, 0.000000F, 109.962891F, 0.000000F, 114.949219F, 0.000000F,
+ 122.408203F, 0.000000F, 130.687500F, 0.000000F, 134.484375F, 0.000000F, 145.787109F, 0.000000F,
+ 150.773438F, 0.000000F, 156.884766F, 0.000000F, 160.681641F, 0.000000F, 172.277344F, 0.000000F,
+ 177.919922F, 0.000000F, 182.906250F, 0.000000F, 191.578125F, 0.000000F, 195.644531F, 0.000000F,
+ 199.441406F, 0.000000F, 206.507813F, 0.000000F, 214.787109F, 0.000000F, 218.402344F, 0.000000F,
+ 223.945313F, 0.000000F, 227.742188F, 0.000000F, 233.765625F, 0.000000F, 238.751953F, 0.000000F,
+ 245.185547F, 0.000000F, 257.982422F, 0.000000F, 262.048828F, 0.000000F, 265.845703F, 0.000000F,
+ 272.654297F, 0.000000F, 276.023438F, 0.000000F, 285.240234F, 0.000000F, 289.306641F, 0.000000F,
+ 293.103516F, 0.000000F, 300.169922F, 0.000000F, 308.449219F, 0.000000F, 314.091797F, 0.000000F,
+ 318.158203F, 0.000000F, 321.955078F, 0.000000F, 329.572266F, 0.000000F, 333.837891F, 0.000000F,
+ 339.380859F, 0.000000F, 343.177734F, 0.000000F, 346.974609F, 0.000000F, 361.986328F, 0.000000F,
+ 367.095703F, 0.000000F, 370.464844F, 0.000000F, 379.136719F, 0.000000F, 386.595703F, 0.000000F,
+ 391.582031F, 0.000000F, 395.847656F, 0.000000F, 399.644531F, 0.000000F, 406.453125F, 0.000000F,
+ 409.822266F, 0.000000F, 415.523438F, 0.000000F, 420.632813F, 0.000000F, 420.632813F, 0.000000F,
+ 427.441406F, 0.000000F, 431.056641F, 0.000000F, 434.853516F, 0.000000F, 441.357422F, 0.000000F,
+ 448.423828F, 0.000000F, 455.912109F, 0.000000F, 459.708984F, 0.000000F, 479.255859F, 0.000000F,
+ 484.242188F, 0.000000F, 496.710938F, 0.000000F, 505.382813F, 0.000000F, 509.449219F, 0.000000F,
+ 514.992188F, 0.000000F, 518.789063F, 0.000000F, 524.812500F, 0.000000F, 529.798828F, 0.000000F,
+ 536.232422F, 0.000000F, 549.029297F, 0.000000F, 554.015625F, 0.000000F, 559.001953F, 0.000000F,
+ 563.267578F, 0.000000F, 567.064453F, 0.000000F, 573.380859F, 0.000000F, 580.839844F, 0.000000F,
+ 590.056641F, 0.000000F, 594.123047F, 0.000000F, 594.123047F, 0.000000F, 600.931641F, 0.000000F,
+ 604.546875F, 0.000000F, 608.343750F, 0.000000F, 620.636719F, 0.000000F, 624.005859F, 0.000000F,
+ 628.992188F, 0.000000F, 635.830078F, 0.000000F, 639.626953F, 0.000000F, 653.361328F, 0.000000F,
+ 656.730469F, 0.000000F, 661.716797F, 0.000000F, 669.205078F, 0.000000F, 673.001953F, 0.000000F,
+ 683.777344F, 0.000000F, 687.146484F, 0.000000F, 692.660156F, 0.000000F, 696.457031F, 0.000000F,
+ 700.253906F, 0.000000F, 704.736328F, 0.000000F, 711.105469F, 0.000000F, 716.748047F, 0.000000F,
+ 722.994141F, 0.000000F, 722.994141F, 0.000000F, 727.060547F, 0.000000F, 732.703125F, 0.000000F,
+ 736.769531F, 0.000000F, 741.251953F, 0.000000F, 745.048828F, 0.000000F, 752.507813F, 0.000000F,
+ 756.123047F, 0.000000F, 762.146484F, 0.000000F, 767.132813F, 0.000000F, 775.412109F, 0.000000F,
+ 779.027344F, 0.000000F, 782.824219F, 0.000000F, 794.203125F, 0.000000F, 799.189453F, 0.000000F,
+ 804.890625F, 0.000000F, 810.433594F, 0.000000F, 814.230469F, 0.000000F, 818.027344F, 0.000000F,
+ 821.396484F, 0.000000F, 828.128906F, 0.000000F, 833.115234F, 0.000000F, 839.953125F, 0.000000F,
+ 843.750000F, 0.000000F, 850.816406F, 0.000000F, 859.095703F, 0.000000F, 862.710938F, 0.000000F,
+ 868.253906F, 0.000000F, 872.050781F, 0.000000F, 883.429688F, 0.000000F, 889.675781F, 0.000000F,
+ 893.941406F, 0.000000F, 897.738281F, 0.000000F, 901.107422F, 0.000000F, 906.093750F, 0.000000F,
+ 911.080078F, 0.000000F, 917.800781F, 0.000000F, 924.638672F, 0.000000F, 928.435547F, 0.000000F,
+ 931.804688F, 0.000000F, 939.263672F, 0.000000F, 944.964844F, 0.000000F, 950.074219F, 0.000000F,
+ 953.871094F, 0.000000F, 965.173828F, 0.000000F, 974.390625F, 0.000000F, 981.111328F, 0.000000F,
+ 981.111328F, 0.000000F, 985.177734F, 0.000000F, 988.974609F, 0.000000F, 999.750000F, 0.000000F,
+ 1003.365234F, 0.000000F, 1007.162109F, 0.000000F, 1014.228516F, 0.000000F, 1020.949219F, 0.000000F,
+ 1025.015625F, 0.000000F, 1028.812500F, 0.000000F, 1040.408203F, 0.000000F, 1046.431641F, 0.000000F,
+ 1054.710938F, 0.000000F, 1054.710938F, 0.000000F, 1061.519531F, 0.000000F, 1065.134766F, 0.000000F,
+ 1068.931641F, 0.000000F, 1083.943359F, 0.000000F, 1089.052734F, 0.000000F, 1092.421875F, 0.000000F,
+ 1101.093750F, 0.000000F, 1108.552734F, 0.000000F, 1112.818359F, 0.000000F, 1116.433594F, 0.000000F,
+ 1121.976563F, 0.000000F, 1125.773438F, 0.000000F, 1140.785156F, 0.000000F, 1146.808594F, 0.000000F,
+ 1155.087891F, 0.000000F, 1155.087891F, 0.000000F, 1161.896484F, 0.000000F, 1165.511719F, 0.000000F,
+ 1169.308594F, 0.000000F, 1180.541016F, 0.000000F, 1184.607422F, 0.000000F, 1190.630859F, 0.000000F,
+ 1199.302734F, 0.000000F, 1204.289063F, 0.000000F, 1208.355469F, 0.000000F, 1212.152344F, 0.000000F,
+ 1218.960938F, 0.000000F, 1224.603516F, 0.000000F, 1231.037109F, 0.000000F, 1235.103516F, 0.000000F,
+ 1240.646484F, 0.000000F, 1244.443359F, 0.000000F, 1248.240234F, 0.000000F, 1255.048828F, 0.000000F,
+ 1258.417969F, 0.000000F, 1264.119141F, 0.000000F, 1269.228516F, 0.000000F, 1269.228516F, 0.000000F,
+ 1276.037109F, 0.000000F, 1279.652344F, 0.000000F, 1283.449219F, 0.000000F, 1290.908203F, 0.000000F,
+ 1297.746094F, 0.000000F, 1301.542969F, 0.000000F, 1311.427734F, 0.000000F, 1317.861328F, 0.000000F,
+ 1323.562500F, 0.000000F, 1327.359375F, 0.000000F, 1341.492188F, 0.000000F, 1346.478516F, 0.000000F,
+ 1357.904297F, 0.000000F, 1361.519531F, 0.000000F, 1367.162109F, 0.000000F, 1375.833984F, 0.000000F,
+ 1380.099609F, 0.000000F, 1383.714844F, 0.000000F, 1387.511719F, 0.000000F, 1398.890625F, 0.000000F,
+ 1405.728516F, 0.000000F, 1409.097656F, 0.000000F, 1415.818359F, 0.000000F, 1420.804688F, 0.000000F,
+ 1424.871094F, 0.000000F, 1428.667969F, 0.000000F, 1432.464844F, 0.000000F, 1435.833984F, 0.000000F,
+ 1435.833984F, 0.000000F, 1447.259766F, 0.000000F, 1450.628906F, 0.000000F, 1462.054688F, 0.000000F,
+ 1465.669922F, 0.000000F
+};
+
+
+const char *fontVersionString3 = "Version 2.1 - July 1995";
+le_uint32 fontChecksum3 = 0x49B67200;
+
+LEUnicode inputText3[] =
+{
+ 0x0E1A, 0x0E17, 0x0E17, 0x0E35, 0x0E48, 0x0E51, 0x0E1E, 0x0E32,
+ 0x0E22, 0x0E38, 0x0E44, 0x0E0B, 0x0E42, 0x0E04, 0x0E25, 0x0E19,
+ 0x0E42, 0x0E14, 0x0E42, 0x0E23, 0x0E18, 0x0E35, 0x0E2D, 0x0E32,
+ 0x0E28, 0x0E31, 0x0E22, 0x0E2D, 0x0E22, 0x0E39, 0x0E48, 0x0E17,
+ 0x0E48, 0x0E32, 0x0E21, 0x0E01, 0x0E25, 0x0E32, 0x0E07, 0x0E17,
+ 0x0E38, 0x0E48, 0x0E07, 0x0E43, 0x0E2B, 0x0E0D, 0x0E48, 0x0E43,
+ 0x0E19, 0x0E41, 0x0E04, 0x0E19, 0x0E0B, 0x0E31, 0x0E2A, 0x0E01,
+ 0x0E31, 0x0E1A, 0x0E25, 0x0E38, 0x0E07, 0x0E40, 0x0E2E, 0x0E19,
+ 0x0E23, 0x0E35, 0x0E0A, 0x0E32, 0x0E27, 0x0E44, 0x0E23, 0x0E48,
+ 0x0E41, 0x0E25, 0x0E30, 0x0E1B, 0x0E49, 0x0E32, 0x0E40, 0x0E2D,
+ 0x0E47, 0x0E21, 0x0E20, 0x0E23, 0x0E23, 0x0E22, 0x0E32, 0x0E0A,
+ 0x0E32, 0x0E27, 0x0E44, 0x0E23, 0x0E48, 0x0E1A, 0x0E49, 0x0E32,
+ 0x0E19, 0x0E02, 0x0E2D, 0x0E07, 0x0E1E, 0x0E27, 0x0E01, 0x0E40,
+ 0x0E02, 0x0E32, 0x0E2B, 0x0E25, 0x0E31, 0x0E07, 0x0E40, 0x0E25,
+ 0x0E47, 0x0E01, 0x0E40, 0x0E1E, 0x0E23, 0x0E32, 0x0E30, 0x0E44,
+ 0x0E21, 0x0E49, 0x0E2A, 0x0E23, 0x0E49, 0x0E32, 0x0E07, 0x0E1A,
+ 0x0E49, 0x0E32, 0x0E19, 0x0E15, 0x0E49, 0x0E2D, 0x0E07, 0x0E02,
+ 0x0E19, 0x0E21, 0x0E32, 0x0E14, 0x0E49, 0x0E27, 0x0E22, 0x0E40,
+ 0x0E01, 0x0E27, 0x0E35, 0x0E22, 0x0E19, 0x0E40, 0x0E1B, 0x0E47,
+ 0x0E19, 0x0E23, 0x0E30, 0x0E22, 0x0E30, 0x0E17, 0x0E32, 0x0E07,
+ 0x0E2B, 0x0E25, 0x0E32, 0x0E22, 0x0E44, 0x0E21, 0x0E25, 0x0E4C
+};
+
+LEGlyphID resultGlyphs3[] =
+{
+ 0x000000F3, 0x000000F0, 0x000000F0, 0x0000010E, 0x0000011D, 0x00000126, 0x000000F7, 0x0000010B,
+ 0x000000FB, 0x00000111, 0x00000119, 0x000000E4, 0x00000117, 0x000000DD, 0x000000FE, 0x000000F2,
+ 0x00000117, 0x000000ED, 0x00000117, 0x000000FC, 0x000000F1, 0x0000010E, 0x00000106, 0x0000010B,
+ 0x00000101, 0x0000010A, 0x000000FB, 0x00000106, 0x000000FB, 0x00000112, 0x0000013B, 0x000000F0,
+ 0x0000013B, 0x0000010B, 0x000000FA, 0x000000DA, 0x000000FE, 0x0000010B, 0x000000E0, 0x000000F0,
+ 0x00000111, 0x0000013B, 0x000000E0, 0x00000118, 0x00000104, 0x000000E6, 0x0000013B, 0x00000118,
+ 0x000000F2, 0x00000116, 0x000000DD, 0x000000F2, 0x000000E4, 0x0000010A, 0x00000103, 0x000000DA,
+ 0x0000010A, 0x000000F3, 0x000000FE, 0x00000111, 0x000000E0, 0x00000115, 0x00000107, 0x000000F2,
+ 0x000000FC, 0x0000010E, 0x000000E3, 0x0000010B, 0x00000100, 0x00000119, 0x000000FC, 0x0000013B,
+ 0x00000116, 0x000000FE, 0x00000109, 0x000000F4, 0x00000137, 0x0000010B, 0x00000115, 0x00000106,
+ 0x0000011C, 0x000000FA, 0x000000F9, 0x000000FC, 0x000000FC, 0x000000FB, 0x0000010B, 0x000000E3,
+ 0x0000010B, 0x00000100, 0x00000119, 0x000000FC, 0x0000013B, 0x000000F3, 0x0000013C, 0x0000010B,
+ 0x000000F2, 0x000000DB, 0x00000106, 0x000000E0, 0x000000F7, 0x00000100, 0x000000DA, 0x00000115,
+ 0x000000DB, 0x0000010B, 0x00000104, 0x000000FE, 0x0000010A, 0x000000E0, 0x00000115, 0x000000FE,
+ 0x0000011C, 0x000000DA, 0x00000115, 0x000000F7, 0x000000FC, 0x0000010B, 0x00000109, 0x00000119,
+ 0x000000FA, 0x0000013C, 0x00000103, 0x000000FC, 0x0000013C, 0x0000010B, 0x000000E0, 0x000000F3,
+ 0x0000013C, 0x0000010B, 0x000000F2, 0x000000EE, 0x0000013C, 0x00000106, 0x000000E0, 0x000000DB,
+ 0x000000F2, 0x000000FA, 0x0000010B, 0x000000ED, 0x0000013C, 0x00000100, 0x000000FB, 0x00000115,
+ 0x000000DA, 0x00000100, 0x0000010E, 0x000000FB, 0x000000F2, 0x00000115, 0x000000F4, 0x00000143,
+ 0x000000F2, 0x000000FC, 0x00000109, 0x000000FB, 0x00000109, 0x000000F0, 0x0000010B, 0x000000E0,
+ 0x00000104, 0x000000FE, 0x0000010B, 0x000000FB, 0x00000119, 0x000000FA, 0x000000FE, 0x0000013F
+};
+
+le_int32 resultGlyphCount3 = 168;
+
+le_int32 resultIndices3[] =
+{
+ 0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007,
+ 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E, 0x0000000F,
+ 0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017,
+ 0x00000018, 0x00000019, 0x0000001A, 0x0000001B, 0x0000001C, 0x0000001D, 0x0000001E, 0x0000001F,
+ 0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027,
+ 0x00000028, 0x00000029, 0x0000002A, 0x0000002B, 0x0000002C, 0x0000002D, 0x0000002E, 0x0000002F,
+ 0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037,
+ 0x00000038, 0x00000039, 0x0000003A, 0x0000003B, 0x0000003C, 0x0000003D, 0x0000003E, 0x0000003F,
+ 0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000047,
+ 0x00000048, 0x00000049, 0x0000004A, 0x0000004B, 0x0000004C, 0x0000004D, 0x0000004E, 0x0000004F,
+ 0x00000050, 0x00000051, 0x00000052, 0x00000053, 0x00000054, 0x00000055, 0x00000056, 0x00000057,
+ 0x00000058, 0x00000059, 0x0000005A, 0x0000005B, 0x0000005C, 0x0000005D, 0x0000005E, 0x0000005F,
+ 0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000066, 0x00000067,
+ 0x00000068, 0x00000069, 0x0000006A, 0x0000006B, 0x0000006C, 0x0000006D, 0x0000006E, 0x0000006F,
+ 0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077,
+ 0x00000078, 0x00000079, 0x0000007A, 0x0000007B, 0x0000007C, 0x0000007D, 0x0000007E, 0x0000007F,
+ 0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000087,
+ 0x00000088, 0x00000089, 0x0000008A, 0x0000008B, 0x0000008C, 0x0000008D, 0x0000008E, 0x0000008F,
+ 0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097,
+ 0x00000098, 0x00000099, 0x0000009A, 0x0000009B, 0x0000009C, 0x0000009D, 0x0000009E, 0x0000009F,
+ 0x000000A0, 0x000000A1, 0x000000A2, 0x000000A3, 0x000000A4, 0x000000A5, 0x000000A6, 0x000000A7
+};
+
+float resultPositions3[] =
+{
+ 0.000000F, 0.000000F, 5.399414F, 0.000000F, 10.798828F, 0.000000F, 16.198242F, 0.000000F,
+ 16.198242F, 0.000000F, 16.198242F, 0.000000F, 21.046875F, 0.000000F, 26.616211F, 0.000000F,
+ 30.035156F, 0.000000F, 34.151367F, 0.000000F, 34.151367F, 0.000000F, 38.279297F, 0.000000F,
+ 43.558594F, 0.000000F, 47.663086F, 0.000000F, 52.438477F, 0.000000F, 57.178711F, 0.000000F,
+ 62.698242F, 0.000000F, 66.802734F, 0.000000F, 71.601563F, 0.000000F, 75.706055F, 0.000000F,
+ 79.810547F, 0.000000F, 84.369141F, 0.000000F, 84.369141F, 0.000000F, 89.097656F, 0.000000F,
+ 92.516602F, 0.000000F, 97.195313F, 0.000000F, 97.195313F, 0.000000F, 101.311523F, 0.000000F,
+ 106.040039F, 0.000000F, 110.156250F, 0.000000F, 110.156250F, 0.000000F, 110.156250F, 0.000000F,
+ 115.555664F, 0.000000F, 115.555664F, 0.000000F, 118.974609F, 0.000000F, 124.013672F, 0.000000F,
+ 128.765625F, 0.000000F, 133.505859F, 0.000000F, 136.924805F, 0.000000F, 140.704102F, 0.000000F,
+ 146.103516F, 0.000000F, 146.103516F, 0.000000F, 146.103516F, 0.000000F, 149.882813F, 0.000000F,
+ 153.553711F, 0.000000F, 159.158203F, 0.000000F, 165.421875F, 0.000000F, 165.421875F, 0.000000F,
+ 169.092773F, 0.000000F, 174.612305F, 0.000000F, 179.135742F, 0.000000F, 183.911133F, 0.000000F,
+ 189.430664F, 0.000000F, 194.709961F, 0.000000F, 194.709961F, 0.000000F, 199.989258F, 0.000000F,
+ 204.741211F, 0.000000F, 204.741211F, 0.000000F, 210.140625F, 0.000000F, 214.880859F, 0.000000F,
+ 214.880859F, 0.000000F, 218.660156F, 0.000000F, 220.675781F, 0.000000F, 225.128906F, 0.000000F,
+ 230.648438F, 0.000000F, 234.752930F, 0.000000F, 234.752930F, 0.000000F, 239.613281F, 0.000000F,
+ 243.032227F, 0.000000F, 247.280273F, 0.000000F, 251.408203F, 0.000000F, 255.512695F, 0.000000F,
+ 255.512695F, 0.000000F, 260.036133F, 0.000000F, 264.776367F, 0.000000F, 269.071289F, 0.000000F,
+ 274.470703F, 0.000000F, 274.470703F, 0.000000F, 277.889648F, 0.000000F, 279.905273F, 0.000000F,
+ 284.633789F, 0.000000F, 284.633789F, 0.000000F, 289.672852F, 0.000000F, 294.641602F, 0.000000F,
+ 298.746094F, 0.000000F, 302.850586F, 0.000000F, 306.966797F, 0.000000F, 310.385742F, 0.000000F,
+ 315.246094F, 0.000000F, 318.665039F, 0.000000F, 322.913086F, 0.000000F, 327.041016F, 0.000000F,
+ 331.145508F, 0.000000F, 331.145508F, 0.000000F, 336.544922F, 0.000000F, 336.544922F, 0.000000F,
+ 339.963867F, 0.000000F, 345.483398F, 0.000000F, 350.258789F, 0.000000F, 354.987305F, 0.000000F,
+ 358.766602F, 0.000000F, 364.335938F, 0.000000F, 368.583984F, 0.000000F, 373.335938F, 0.000000F,
+ 375.351563F, 0.000000F, 380.126953F, 0.000000F, 383.545898F, 0.000000F, 389.150391F, 0.000000F,
+ 393.890625F, 0.000000F, 393.890625F, 0.000000F, 397.669922F, 0.000000F, 399.685547F, 0.000000F,
+ 404.425781F, 0.000000F, 404.425781F, 0.000000F, 409.177734F, 0.000000F, 411.193359F, 0.000000F,
+ 416.762695F, 0.000000F, 420.867188F, 0.000000F, 424.286133F, 0.000000F, 428.581055F, 0.000000F,
+ 432.708984F, 0.000000F, 437.748047F, 0.000000F, 437.748047F, 0.000000F, 443.027344F, 0.000000F,
+ 447.131836F, 0.000000F, 447.131836F, 0.000000F, 450.550781F, 0.000000F, 454.330078F, 0.000000F,
+ 459.729492F, 0.000000F, 459.729492F, 0.000000F, 463.148438F, 0.000000F, 468.667969F, 0.000000F,
+ 473.478516F, 0.000000F, 473.478516F, 0.000000F, 478.207031F, 0.000000F, 481.986328F, 0.000000F,
+ 486.761719F, 0.000000F, 492.281250F, 0.000000F, 497.320313F, 0.000000F, 500.739258F, 0.000000F,
+ 505.538086F, 0.000000F, 505.538086F, 0.000000F, 509.786133F, 0.000000F, 513.902344F, 0.000000F,
+ 515.917969F, 0.000000F, 520.669922F, 0.000000F, 524.917969F, 0.000000F, 524.917969F, 0.000000F,
+ 529.034180F, 0.000000F, 534.553711F, 0.000000F, 536.569336F, 0.000000F, 541.968750F, 0.000000F,
+ 541.968750F, 0.000000F, 547.488281F, 0.000000F, 551.592773F, 0.000000F, 555.887695F, 0.000000F,
+ 560.003906F, 0.000000F, 564.298828F, 0.000000F, 569.698242F, 0.000000F, 573.117188F, 0.000000F,
+ 576.896484F, 0.000000F, 582.500977F, 0.000000F, 587.241211F, 0.000000F, 590.660156F, 0.000000F,
+ 594.776367F, 0.000000F, 598.904297F, 0.000000F, 603.943359F, 0.000000F, 608.683594F, 0.000000F,
+ 608.683594F, 0.000000F
+};
+
+
+TestInput testInputs[] =
+{
+ {"raghu.ttf", fontVersionString0, fontChecksum0, inputText0, 136, devaScriptCode, FALSE},
+ {"CODE2000.TTF", fontVersionString1, fontChecksum1, inputText1, 252, arabScriptCode, TRUE},
+ {"LucidaSansRegular.ttf", fontVersionString2, fontChecksum2, inputText2, 252, arabScriptCode, TRUE},
+ {"angsd___.ttf", fontVersionString3, fontChecksum3, inputText3, 168, thaiScriptCode, FALSE},
+};
+
+le_int32 testCount = ARRAY_LENGTH(testInputs);
+
+TestResult testResults[] =
+{
+ {resultGlyphCount0, resultGlyphs0, resultIndices0, resultPositions0},
+ {resultGlyphCount1, resultGlyphs1, resultIndices1, resultPositions1},
+ {resultGlyphCount2, resultGlyphs2, resultIndices2, resultPositions2},
+ {resultGlyphCount3, resultGlyphs3, resultIndices3, resultPositions3},
+};
+
diff --git a/Build/source/libs/icu/icu-xetex/test/letest/xmlreader.cpp b/Build/source/libs/icu/icu-xetex/test/letest/xmlreader.cpp
new file mode 100644
index 00000000000..c84dc8ce28c
--- /dev/null
+++ b/Build/source/libs/icu/icu-xetex/test/letest/xmlreader.cpp
@@ -0,0 +1,259 @@
+/*
+ *******************************************************************************
+ *
+ * Copyright (C) 1999-2007, International Business Machines
+ * Corporation and others. All Rights Reserved.
+ *
+ *******************************************************************************
+ */
+
+#include "unicode/utypes.h"
+#include "unicode/uclean.h"
+#include "unicode/uchar.h"
+#include "unicode/unistr.h"
+#include "unicode/uscript.h"
+#include "unicode/putil.h"
+#include "unicode/ctest.h"
+
+#include "layout/LETypes.h"
+#include "layout/LEScripts.h"
+
+#include "letsutil.h"
+#include "letest.h"
+
+#include "xmlreader.h"
+
+#include "xmlparser.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+//U_NAMESPACE_USE
+
+#define CH_COMMA 0x002C
+
+static le_uint32 *getHexArray(const UnicodeString &numbers, int32_t &arraySize)
+{
+ int32_t offset = -1;
+
+ arraySize = 1;
+ while((offset = numbers.indexOf(CH_COMMA, offset + 1)) >= 0) {
+ arraySize += 1;
+ }
+
+ le_uint32 *array = NEW_ARRAY(le_uint32, arraySize);
+ char number[16];
+ le_int32 count = 0;
+ le_int32 start = 0, end = 0;
+ le_int32 len = 0;
+
+ // trim leading whitespace
+ while(u_isUWhiteSpace(numbers[start])) {
+ start += 1;
+ }
+
+ while((end = numbers.indexOf(CH_COMMA, start)) >= 0) {
+ len = numbers.extract(start, end - start, number, ARRAY_SIZE(number), US_INV);
+ number[len] = '\0';
+ start = end + 1;
+
+ sscanf(number, "%x", &array[count++]);
+
+ // trim whitespace following the comma
+ while(u_isUWhiteSpace(numbers[start])) {
+ start += 1;
+ }
+ }
+
+ // trim trailing whitespace
+ end = numbers.length();
+ while(u_isUWhiteSpace(numbers[end - 1])) {
+ end -= 1;
+ }
+
+ len = numbers.extract(start, end - start, number, ARRAY_SIZE(number), US_INV);
+ number[len] = '\0';
+ sscanf(number, "%x", &array[count]);
+
+ return array;
+}
+
+static float *getFloatArray(const UnicodeString &numbers, int32_t &arraySize)
+{
+ int32_t offset = -1;
+
+ arraySize = 1;
+ while((offset = numbers.indexOf(CH_COMMA, offset + 1)) >= 0) {
+ arraySize += 1;
+ }
+
+ float *array = NEW_ARRAY(float, arraySize);
+ char number[32];
+ le_int32 count = 0;
+ le_int32 start = 0, end = 0;
+ le_int32 len = 0;
+
+ // trim leading whitespace
+ while(u_isUWhiteSpace(numbers[start])) {
+ start += 1;
+ }
+
+ while((end = numbers.indexOf(CH_COMMA, start)) >= 0) {
+ len = numbers.extract(start, end - start, number, ARRAY_SIZE(number), US_INV);
+ number[len] = '\0';
+ start = end + 1;
+
+ sscanf(number, "%f", &array[count++]);
+
+ // trim whiteapce following the comma
+ while(u_isUWhiteSpace(numbers[start])) {
+ start += 1;
+ }
+ }
+
+ while(u_isUWhiteSpace(numbers[start])) {
+ start += 1;
+ }
+
+ // trim trailing whitespace
+ end = numbers.length();
+ while(u_isUWhiteSpace(numbers[end - 1])) {
+ end -= 1;
+ }
+
+ len = numbers.extract(start, end - start, number, ARRAY_SIZE(number), US_INV);
+ number[len] = '\0';
+ sscanf(number, "%f", &array[count]);
+
+ return array;
+}
+
+U_CDECL_BEGIN
+void readTestFile(const char *testFilePath, TestCaseCallback callback)
+{
+#if !UCONFIG_NO_REGULAR_EXPRESSIONS
+ UErrorCode status = U_ZERO_ERROR;
+ UXMLParser *parser = UXMLParser::createParser(status);
+ UXMLElement *root = parser->parseFile(testFilePath, status);
+
+ if (root == NULL) {
+ log_err("Could not open the test data file: %s\n", testFilePath);
+ delete parser;
+ return;
+ }
+
+ UnicodeString test_case = UNICODE_STRING_SIMPLE("test-case");
+ UnicodeString test_text = UNICODE_STRING_SIMPLE("test-text");
+ UnicodeString test_font = UNICODE_STRING_SIMPLE("test-font");
+ UnicodeString result_glyphs = UNICODE_STRING_SIMPLE("result-glyphs");
+ UnicodeString result_indices = UNICODE_STRING_SIMPLE("result-indices");
+ UnicodeString result_positions = UNICODE_STRING_SIMPLE("result-positions");
+
+ // test-case attributes
+ UnicodeString id_attr = UNICODE_STRING_SIMPLE("id");
+ UnicodeString script_attr = UNICODE_STRING_SIMPLE("script");
+ UnicodeString lang_attr = UNICODE_STRING_SIMPLE("lang");
+
+ // test-font attributes
+ UnicodeString name_attr = UNICODE_STRING_SIMPLE("name");
+ UnicodeString ver_attr = UNICODE_STRING_SIMPLE("version");
+ UnicodeString cksum_attr = UNICODE_STRING_SIMPLE("checksum");
+
+ const UXMLElement *testCase;
+ int32_t tc = 0;
+
+ while((testCase = root->nextChildElement(tc)) != NULL) {
+ if (testCase->getTagName().compare(test_case) == 0) {
+ char *id = getCString(testCase->getAttribute(id_attr));
+ char *script = getCString(testCase->getAttribute(script_attr));
+ char *lang = getCString(testCase->getAttribute(lang_attr));
+ char *fontName = NULL;
+ char *fontVer = NULL;
+ char *fontCksum = NULL;
+ const UXMLElement *element;
+ int32_t ec = 0;
+ int32_t charCount = 0;
+ int32_t typoFlags = 3; // kerning + ligatures...
+ UScriptCode scriptCode;
+ le_int32 languageCode = -1;
+ UnicodeString text, glyphs, indices, positions;
+ int32_t glyphCount = 0, indexCount = 0, positionCount = 0;
+ TestResult expected = {0, NULL, NULL, NULL};
+
+ uscript_getCode(script, &scriptCode, 1, &status);
+ if (LE_FAILURE(status)) {
+ log_err("invalid script name: %s.\n", script);
+ goto free_c_strings;
+ }
+
+ if (lang != NULL) {
+ languageCode = getLanguageCode(lang);
+
+ if (languageCode < 0) {
+ log_err("invalid language name: %s.\n", lang);
+ goto free_c_strings;
+ }
+ }
+
+ while((element = testCase->nextChildElement(ec)) != NULL) {
+ UnicodeString tag = element->getTagName();
+
+ // TODO: make sure that each element is only used once.
+ if (tag.compare(test_font) == 0) {
+ fontName = getCString(element->getAttribute(name_attr));
+ fontVer = getCString(element->getAttribute(ver_attr));
+ fontCksum = getCString(element->getAttribute(cksum_attr));
+
+ } else if (tag.compare(test_text) == 0) {
+ text = element->getText(TRUE);
+ charCount = text.length();
+ } else if (tag.compare(result_glyphs) == 0) {
+ glyphs = element->getText(TRUE);
+ } else if (tag.compare(result_indices) == 0) {
+ indices = element->getText(TRUE);
+ } else if (tag.compare(result_positions) == 0) {
+ positions = element->getText(TRUE);
+ } else {
+ // an unknown tag...
+ char *cTag = getCString(&tag);
+
+ log_info("Test %s: unknown element with tag \"%s\"\n", id, cTag);
+ freeCString(cTag);
+ }
+ }
+
+ expected.glyphs = (LEGlyphID *) getHexArray(glyphs, glyphCount);
+ expected.indices = (le_int32 *) getHexArray(indices, indexCount);
+ expected.positions = getFloatArray(positions, positionCount);
+
+ expected.glyphCount = glyphCount;
+
+ if (glyphCount < charCount || indexCount != glyphCount || positionCount < glyphCount * 2 + 2) {
+ log_err("Test %s: inconsistent input data: charCount = %d, glyphCount = %d, indexCount = %d, positionCount = %d\n",
+ id, charCount, glyphCount, indexCount, positionCount);
+ goto free_expected;
+ };
+
+ (*callback)(id, fontName, fontVer, fontCksum, scriptCode, languageCode, text.getBuffer(), charCount, &expected);
+
+free_expected:
+ DELETE_ARRAY(expected.positions);
+ DELETE_ARRAY(expected.indices);
+ DELETE_ARRAY(expected.glyphs);
+
+free_c_strings:
+ freeCString(fontCksum);
+ freeCString(fontVer);
+ freeCString(fontName);
+ freeCString(lang);
+ freeCString(script);
+ freeCString(id);
+ }
+ }
+
+ delete root;
+ delete parser;
+#endif
+}
+U_CDECL_END
diff --git a/Build/source/libs/icu/icu-xetex/test/letest/xmlreader.h b/Build/source/libs/icu/icu-xetex/test/letest/xmlreader.h
new file mode 100644
index 00000000000..be47b562795
--- /dev/null
+++ b/Build/source/libs/icu/icu-xetex/test/letest/xmlreader.h
@@ -0,0 +1,25 @@
+/*
+ *
+ * (C) Copyright IBM Corp. 1998-2007 - All Rights Reserved
+ *
+ */
+
+#ifndef __XMLREADER_H
+#define __XMLREADER_H
+
+#include "LETypes.h"
+#include "letest.h"
+
+typedef void (*TestCaseCallback) (const char *testID,
+ const char *fontName,
+ const char *fontVersion,
+ const char *fontChecksum,
+ le_int32 scriptCode,
+ le_int32 languageCode,
+ const LEUnicode *text,
+ le_int32 charCount,
+ TestResult *expected);
+
+U_CAPI void readTestFile(const char *testFilePath, TestCaseCallback callback);
+
+#endif