summaryrefslogtreecommitdiff
path: root/Build/source/libs/icu-xetex/samples/layout
diff options
context:
space:
mode:
authorJonathan Kew <jfkthame@googlemail.com>2008-03-04 13:21:23 +0000
committerJonathan Kew <jfkthame@googlemail.com>2008-03-04 13:21:23 +0000
commitf483a5de9331a257f597282e611ecfb63f5ab118 (patch)
tree756baa5a727dd0438448eb380bb6ca81fb41d534 /Build/source/libs/icu-xetex/samples/layout
parente2603863b071e717675b6a69e97c45a42e55bf2c (diff)
remove old icu version
git-svn-id: svn://tug.org/texlive/trunk@6841 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/icu-xetex/samples/layout')
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/.cvsignore8
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/FontMap.GDI11
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/FontMap.Gnome8
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/FontMap.cpp285
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/FontMap.h66
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/FontTableCache.cpp86
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/FontTableCache.h38
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/GDIFontInstance.cpp378
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/GDIFontInstance.h156
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/GDIFontMap.cpp39
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/GDIFontMap.h38
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/GDIGUISupport.cpp22
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/GDIGUISupport.h28
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/GUISupport.h26
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/GnomeFontInstance.cpp333
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/GnomeFontInstance.h163
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/GnomeFontMap.cpp40
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/GnomeFontMap.h37
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/GnomeGUISupport.cpp37
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/GnomeGUISupport.h28
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/LayoutSample.rc115
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/Makefile.in96
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/RenderingSurface.h30
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/Sample.txt1
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/ScriptCompositeFontInstance.cpp103
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/ScriptCompositeFontInstance.h191
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/Surface.cpp30
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/Surface.h14
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/UnicodeReader.cpp119
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/UnicodeReader.h32
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/cmaps.cpp206
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/cmaps.h89
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/gnomelayout.cpp333
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/layout.cpp358
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/layout.sln21
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/layout.vcproj225
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/paragraph.cpp280
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/paragraph.h89
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/readme.html186
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/resource.h22
-rw-r--r--Build/source/libs/icu-xetex/samples/layout/sfnt.h219
41 files changed, 0 insertions, 4586 deletions
diff --git a/Build/source/libs/icu-xetex/samples/layout/.cvsignore b/Build/source/libs/icu-xetex/samples/layout/.cvsignore
deleted file mode 100644
index fb9345c0e91..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/.cvsignore
+++ /dev/null
@@ -1,8 +0,0 @@
-Makefile
-*.d
-*.pdb
-Debug
-Release
-tmp
-.#*
-
diff --git a/Build/source/libs/icu-xetex/samples/layout/FontMap.GDI b/Build/source/libs/icu-xetex/samples/layout/FontMap.GDI
deleted file mode 100644
index 198c02218a7..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/FontMap.GDI
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (C) 2001-2005, International Business Machines
-# Corporation and others. All Rights Reserved.
-#
-# This is a sample FontMap file for Windows.
-# Fonts are specified by font name, as shown
-# in the "Fonts" folder.
-
- DEVANAGARI: Raghindi
- THAI: AngsanaDSE
- DEFAULT: Code2000
-
diff --git a/Build/source/libs/icu-xetex/samples/layout/FontMap.Gnome b/Build/source/libs/icu-xetex/samples/layout/FontMap.Gnome
deleted file mode 100644
index 1f57bb4814d..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/FontMap.Gnome
+++ /dev/null
@@ -1,8 +0,0 @@
-# Copyright (C) 2001-2005, International Business Machines
-# Corporation and others. All Rights Reserved.
-# This is a sample FontMap file for Linux.
-# Fonts are specified by file names.
-
- DEVANAGARI: raghu.ttf
- THAI: angsd___.ttf
- DEFAULT: CODE2000.TTF
diff --git a/Build/source/libs/icu-xetex/samples/layout/FontMap.cpp b/Build/source/libs/icu-xetex/samples/layout/FontMap.cpp
deleted file mode 100644
index 485351b403f..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/FontMap.cpp
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
- ******************************************************************************
- * Copyright (C) 1998-2005, International Business Machines Corporation and *
- * others. All Rights Reserved. *
- ******************************************************************************
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-
-#include "unicode/utypes.h"
-#include "unicode/uscript.h"
-
-#include "layout/LETypes.h"
-#include "layout/LEScripts.h"
-#include "layout/LEFontInstance.h"
-
-#include "GUISupport.h"
-#include "FontMap.h"
-
-FontMap::FontMap(const char *fileName, le_int16 pointSize, GUISupport *guiSupport, LEErrorCode &status)
- : fPointSize(pointSize), fFontCount(0), fAscent(0), fDescent(0), fLeading(0), fGUISupport(guiSupport)
-{
- le_int32 defaultFont = -1, i, script;
- le_bool haveFonts = FALSE;
-
- for (i = 0; i < scriptCodeCount; i += 1) {
- fFontIndices[i] = -1;
- fFontNames[i] = NULL;
- fFontInstances[i] = NULL;
- }
-
- if (LE_FAILURE(status)) {
- return;
- }
-
- char *c, *scriptName, *fontName, *line, buffer[BUFFER_SIZE];
- FILE *file;
-
- file = fopen(fileName, "r");
-
- if (file == NULL) {
- sprintf(errorMessage, "Could not open the font map file: %s.", fileName);
- fGUISupport->postErrorMessage(errorMessage, "Font Map Error");
- status = LE_FONT_FILE_NOT_FOUND_ERROR;
- return;
- }
-
- while (fgets(buffer, BUFFER_SIZE, file) != NULL) {
- UScriptCode scriptCode;
- UErrorCode scriptStatus = U_ZERO_ERROR;
-
- line = strip(buffer);
- if (line[0] == '#' || line[0] == 0) {
- continue;
- }
-
- c = strchr(line, ':');
- c[0] = 0;
-
- fontName = strip(&c[1]);
- scriptName = strip(line);
-
- if (strcmp(scriptName, "DEFAULT") == 0) {
- defaultFont = getFontIndex(fontName);
- haveFonts = TRUE;
- continue;
- }
-
- le_int32 fillCount = uscript_getCode(scriptName, &scriptCode, 1, &scriptStatus);
-
- if (U_FAILURE(scriptStatus) || fillCount <= 0 ||
- scriptStatus == U_USING_FALLBACK_WARNING || scriptStatus == U_USING_DEFAULT_WARNING) {
- sprintf(errorMessage, "The script name %s is invalid.", line);
- fGUISupport->postErrorMessage(errorMessage, "Font Map Error");
- continue;
- }
-
- script = (le_int32) scriptCode;
-
- if (fFontIndices[script] >= 0) {
- // FIXME: complain that this is a duplicate entry and bail (?)
- fFontIndices[script] = -1;
- }
-
- fFontIndices[script] = getFontIndex(fontName);
- haveFonts = TRUE;
- }
-
- if (defaultFont >= 0) {
- for (script = 0; script < scriptCodeCount; script += 1) {
- if (fFontIndices[script] < 0) {
- fFontIndices[script] = defaultFont;
- }
- }
- }
-
- if (! haveFonts) {
- sprintf(errorMessage, "The font map file %s does not contain any valid scripts.", fileName);
- fGUISupport->postErrorMessage(errorMessage, "Font Map Error");
- status = LE_ILLEGAL_ARGUMENT_ERROR;
- }
-
- fclose(file);
-}
-
-FontMap::~FontMap()
-{
- le_int32 font;
-
- for (font = 0; font < fFontCount; font += 1) {
- if (fFontNames[font] != NULL) {
- delete[] (char *) fFontNames[font];
- }
- }
-
- for (font = 0; font < fFontCount; font += 1) {
- if (fFontInstances[font] != NULL) {
- delete fFontInstances[font];
- }
- }
-}
-
-le_int32 FontMap::getFontIndex(const char *fontName)
-{
- le_int32 index;
-
- for (index = 0; index < fFontCount; index += 1) {
- if (strcmp(fontName, fFontNames[index]) == 0) {
- return index;
- }
- }
-
- if (fFontCount < (le_int32) scriptCodeCount) {
- index = fFontCount++;
- } else {
- // The font name table is full. Since there can
- // only be scriptCodeCount fonts in use at once,
- // there should be at least one that's not being
- // referenced; find it and resue it's index.
-
- for (index = 0; index < fFontCount; index += 1) {
- le_int32 script;
-
- for (script = 0; script < scriptCodeCount; script += 1) {
- if (fFontIndices[script] == index) {
- break;
- }
- }
-
- if (script >= scriptCodeCount) {
- break;
- }
- }
- }
-
- if (index >= scriptCodeCount) {
- return -1;
- }
-
- le_int32 len = strlen(fontName);
- char *s = new char[len + 1];
-
- fFontNames[index] = strcpy(s, fontName);
- return index;
-}
-
-char *FontMap::strip(char *s)
-{
- le_int32 start, end, len;
-
- start = 0;
- len = strlen(s);
-
- while (start < len && isspace(s[start])) {
- start += 1;
- }
-
- end = len - 1;
-
- while (end > start && isspace(s[end])) {
- end -= 1;
- }
-
- if (end < len) {
- s[end + 1] = '\0';
- }
-
- return &s[start];
-}
-
-const LEFontInstance *FontMap::getScriptFont(le_int32 scriptCode, LEErrorCode &status)
-{
- if (LE_FAILURE(status)) {
- return NULL;
- }
-
- if (scriptCode <= -1 || scriptCode >= scriptCodeCount) {
- status = LE_ILLEGAL_ARGUMENT_ERROR;
- return NULL;
- }
-
-
- le_int32 fontIndex = fFontIndices[scriptCode];
-
- if (fontIndex < 0) {
- sprintf(errorMessage, "No font was set for script %s", uscript_getName((UScriptCode) scriptCode));
- fGUISupport->postErrorMessage(errorMessage, "Font Map Error");
- status = LE_FONT_FILE_NOT_FOUND_ERROR;
- return NULL;
- }
-
- if (fFontInstances[fontIndex] == NULL) {
- fFontInstances[fontIndex] = openFont(fFontNames[fontIndex], fPointSize, status);
-
- if (LE_FAILURE(status)) {
- sprintf(errorMessage, "Could not open font file %s", fFontNames[fontIndex]);
- fGUISupport->postErrorMessage(errorMessage, "Font Map Error");
- return NULL;
- }
- }
-
- return fFontInstances[fontIndex];
-}
-
-le_int32 FontMap::getAscent() const
-{
- if (fAscent <= 0) {
- ((FontMap *) this)->getMaxMetrics();
- }
-
- return fAscent;
-}
-
-le_int32 FontMap::getDescent() const
-{
- if (fDescent <= 0) {
- ((FontMap *) this)->getMaxMetrics();
- }
-
- return fDescent;
-}
-
-le_int32 FontMap::getLeading() const
-{
- if (fLeading <= 0) {
- ((FontMap *) this)->getMaxMetrics();
- }
-
- return fLeading;
-}
-
-void FontMap::getMaxMetrics()
-{
- for (le_int32 i = 0; i < fFontCount; i += 1) {
- LEErrorCode status = LE_NO_ERROR;
- le_int32 ascent, descent, leading;
-
- if (fFontInstances[i] == NULL) {
- fFontInstances[i] = openFont(fFontNames[i], fPointSize, status);
-
- if (LE_FAILURE(status)) {
- continue;
- }
- }
-
- ascent = fFontInstances[i]->getAscent();
- descent = fFontInstances[i]->getDescent();
- leading = fFontInstances[i]->getLeading();
-
- if (ascent > fAscent) {
- fAscent = ascent;
- }
-
- if (descent > fDescent) {
- fDescent = descent;
- }
-
- if (leading > fLeading) {
- fLeading = leading;
- }
- }
-}
-
diff --git a/Build/source/libs/icu-xetex/samples/layout/FontMap.h b/Build/source/libs/icu-xetex/samples/layout/FontMap.h
deleted file mode 100644
index fa80ebfd090..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/FontMap.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- ******************************************************************************
- * Copyright (C) 1998-2003, International Business Machines Corporation and *
- * others. All Rights Reserved. *
- ******************************************************************************
- */
-
-#ifndef __FONTMAP_H
-#define __FONTMAP_H
-
-#include "layout/LETypes.h"
-#include "layout/LEScripts.h"
-#include "layout/LEFontInstance.h"
-
-#include "GUISupport.h"
-
-#define BUFFER_SIZE 128
-
-class FontMap
-{
-public:
- FontMap(const char *fileName, le_int16 pointSize, GUISupport *guiSupport, LEErrorCode &status);
-
- virtual ~FontMap();
-
- virtual const LEFontInstance *getScriptFont(le_int32 scriptCode, LEErrorCode &status);
-
- virtual le_int16 getPointSize() const;
-
- virtual le_int32 getAscent() const;
-
- virtual le_int32 getDescent() const;
-
- virtual le_int32 getLeading() const;
-
-protected:
- virtual const LEFontInstance *openFont(const char *fontName, le_int16 pointSize, LEErrorCode &status) = 0;
-
- char errorMessage[256];
-
-private:
- static char *strip(char *s);
- le_int32 getFontIndex(const char *fontName);
- void getMaxMetrics();
-
- le_int16 fPointSize;
- le_int32 fFontCount;
-
- le_int32 fAscent;
- le_int32 fDescent;
- le_int32 fLeading;
-
- GUISupport *fGUISupport;
-
- const LEFontInstance *fFontInstances[scriptCodeCount];
- const char *fFontNames[scriptCodeCount];
- le_int32 fFontIndices[scriptCodeCount];
-};
-
-inline le_int16 FontMap::getPointSize() const
-{
- return fPointSize;
-}
-
-#endif
-
diff --git a/Build/source/libs/icu-xetex/samples/layout/FontTableCache.cpp b/Build/source/libs/icu-xetex/samples/layout/FontTableCache.cpp
deleted file mode 100644
index 75130ff3af1..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/FontTableCache.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- **********************************************************************
- * Copyright (C) 2003, International Business Machines
- * Corporation and others. All Rights Reserved.
- **********************************************************************
- */
-
-#include "layout/LETypes.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 = LE_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) {
- LE_DELETE_ARRAY(fTableCache[i].table);
-
- fTableCache[i].tag = 0;
- fTableCache[i].table = NULL;
- }
-
- fTableCacheCurr = 0;
-
- LE_DELETE_ARRAY(fTableCache);
- fTableCache = NULL;
-}
-
-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 *) LE_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-xetex/samples/layout/FontTableCache.h b/Build/source/libs/icu-xetex/samples/layout/FontTableCache.h
deleted file mode 100644
index bb85eeb011d..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/FontTableCache.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- **********************************************************************
- * Copyright (C) 2003, International Business Machines
- * Corporation and others. All Rights Reserved.
- **********************************************************************
- */
-
-#ifndef __FONTTABLECACHE_H
-
-#define __FONTTABLECACHE_H
-
-#include "layout/LETypes.h"
-
-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-xetex/samples/layout/GDIFontInstance.cpp b/Build/source/libs/icu-xetex/samples/layout/GDIFontInstance.cpp
deleted file mode 100644
index d3451e9a575..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/GDIFontInstance.cpp
+++ /dev/null
@@ -1,378 +0,0 @@
-/*
- *******************************************************************************
- *
- * Copyright (C) 1999-2006, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- *******************************************************************************
- * file name: GDIFontInstance.cpp
- *
- * created on: 08/09/2000
- * created by: Eric R. Mader
- */
-
-#include <windows.h>
-
-#include "layout/LETypes.h"
-#include "layout/LESwaps.h"
-#include "layout/LEFontInstance.h"
-
-#include "GDIFontInstance.h"
-#include "sfnt.h"
-#include "cmaps.h"
-
-GDISurface::GDISurface(HDC theHDC)
- : fHdc(theHDC), fCurrentFont(NULL)
-{
- // nothing else to do
-}
-
-GDISurface::~GDISurface()
-{
- // nothing to do
-}
-
-void GDISurface::setHDC(HDC theHDC)
-{
- fHdc = theHDC;
- fCurrentFont = NULL;
-}
-
-void GDISurface::setFont(const GDIFontInstance *font)
-{
-#if 0
- if (fCurrentFont != font) {
- fCurrentFont = font;
- SelectObject(fHdc, font->getFont());
- }
-#else
- SelectObject(fHdc, font->getFont());
-#endif
-}
-
-void GDISurface::drawGlyphs(const LEFontInstance *font, const LEGlyphID *glyphs, le_int32 count, const float *positions,
- le_int32 x, le_int32 y, le_int32 width, le_int32 height)
-{
- TTGlyphID *ttGlyphs = LE_NEW_ARRAY(TTGlyphID, count);
- le_int32 *dx = LE_NEW_ARRAY(le_int32, count);
- float *ps = LE_NEW_ARRAY(float, count * 2 + 2);
- le_int32 out = 0;
- RECT clip;
-
- clip.top = 0;
- clip.left = 0;
- clip.bottom = height;
- clip.right = width;
-
- for (le_int32 g = 0; g < count; g += 1) {
- TTGlyphID ttGlyph = (TTGlyphID) LE_GET_GLYPH(glyphs[g]);
-
- if (ttGlyph < 0xFFFE) {
- ttGlyphs[out] = ttGlyph;
- dx[out] = (le_int32) (positions[g * 2 + 2] - positions[g * 2]);
- ps[out * 2] = positions[g * 2];
- ps[out * 2 + 1] = positions[g * 2 + 1];
- out += 1;
- }
- }
-
- le_int32 dyStart, dyEnd;
-
- setFont((GDIFontInstance *) font);
-
- dyStart = dyEnd = 0;
-
- while (dyEnd < out) {
- float yOffset = ps[dyStart * 2 + 1];
- float xOffset = ps[dyStart * 2];
-
- while (dyEnd < out && yOffset == ps[dyEnd * 2 + 1]) {
- dyEnd += 1;
- }
-
- ExtTextOut(fHdc, x + (le_int32) xOffset, y + (le_int32) yOffset - font->getAscent(), ETO_CLIPPED | ETO_GLYPH_INDEX, &clip,
- (LPCWSTR) &ttGlyphs[dyStart], dyEnd - dyStart, (INT *) &dx[dyStart]);
-
- dyStart = dyEnd;
- }
-
- LE_DELETE_ARRAY(ps);
- LE_DELETE_ARRAY(dx);
- LE_DELETE_ARRAY(ttGlyphs);
-}
-
-GDIFontInstance::GDIFontInstance(GDISurface *surface, TCHAR *faceName, le_int16 pointSize, LEErrorCode &status)
- : FontTableCache(), fSurface(surface), fFont(NULL),
- fPointSize(pointSize), fUnitsPerEM(0), fAscent(0), fDescent(0), fLeading(0),
- fDeviceScaleX(1), fDeviceScaleY(1), fMapper(NULL)
-{
- LOGFONT lf;
- FLOAT dpiX, dpiY;
- POINT pt;
- OUTLINETEXTMETRIC otm;
- HDC hdc = surface->getHDC();
-
- if (LE_FAILURE(status)) {
- return;
- }
-
- SaveDC(hdc);
-
- SetGraphicsMode(hdc, GM_ADVANCED);
- ModifyWorldTransform(hdc, NULL, MWT_IDENTITY);
- SetViewportOrgEx(hdc, 0, 0, NULL);
- SetWindowOrgEx(hdc, 0, 0, NULL);
-
- dpiX = (FLOAT) GetDeviceCaps(hdc, LOGPIXELSX);
- dpiY = (FLOAT) GetDeviceCaps(hdc, LOGPIXELSY);
-
-#if 1
- pt.x = (int) (pointSize * dpiX / 72);
- pt.y = (int) (pointSize * dpiY / 72);
-
- DPtoLP(hdc, &pt, 1);
-#else
- pt.x = pt.y = pointSize;
-#endif
-
- lf.lfHeight = - pt.y;
- lf.lfWidth = 0;
- lf.lfEscapement = 0;
- lf.lfOrientation = 0;
- lf.lfWeight = 0;
- lf.lfItalic = 0;
- lf.lfUnderline = 0;
- lf.lfStrikeOut = 0;
- lf.lfCharSet = DEFAULT_CHARSET;
- lf.lfOutPrecision = 0;
- lf.lfClipPrecision = 0;
- lf.lfQuality = 0;
- lf.lfPitchAndFamily = 0;
-
- lstrcpy(lf.lfFaceName, faceName);
-
- fFont = CreateFontIndirect(&lf);
-
- if (fFont == NULL) {
- status = LE_FONT_FILE_NOT_FOUND_ERROR;
- return;
- }
-
- SelectObject(hdc, fFont);
-
- UINT ret = GetOutlineTextMetrics(hdc, sizeof otm, &otm);
-
- if (ret == 0) {
- status = LE_MISSING_FONT_TABLE_ERROR;
- goto restore;
- }
-
- fUnitsPerEM = otm.otmEMSquare;
- fAscent = otm.otmTextMetrics.tmAscent;
- fDescent = otm.otmTextMetrics.tmDescent;
- fLeading = otm.otmTextMetrics.tmExternalLeading;
-
- status = initMapper();
-
- if (LE_FAILURE(status)) {
- goto restore;
- }
-
-#if 0
- status = initFontTableCache();
-#endif
-
-restore:
- RestoreDC(hdc, -1);
-}
-
-GDIFontInstance::GDIFontInstance(GDISurface *surface, const char *faceName, le_int16 pointSize, LEErrorCode &status)
- : FontTableCache(), fSurface(surface), fFont(NULL),
- fPointSize(pointSize), fUnitsPerEM(0), fAscent(0), fDescent(0), fLeading(0),
- fDeviceScaleX(1), fDeviceScaleY(1), fMapper(NULL)
-{
- LOGFONTA lf;
- FLOAT dpiX, dpiY;
- POINT pt;
- OUTLINETEXTMETRIC otm;
- HDC hdc = surface->getHDC();
-
- if (LE_FAILURE(status)) {
- return;
- }
-
- SaveDC(hdc);
-
- SetGraphicsMode(hdc, GM_ADVANCED);
- ModifyWorldTransform(hdc, NULL, MWT_IDENTITY);
- SetViewportOrgEx(hdc, 0, 0, NULL);
- SetWindowOrgEx(hdc, 0, 0, NULL);
-
- dpiX = (FLOAT) GetDeviceCaps(hdc, LOGPIXELSX);
- dpiY = (FLOAT) GetDeviceCaps(hdc, LOGPIXELSY);
-
- fDeviceScaleX = dpiX / 72;
- fDeviceScaleY = dpiY / 72;
-
-#if 1
- pt.x = (int) (pointSize * fDeviceScaleX);
- pt.y = (int) (pointSize * fDeviceScaleY);
-
- DPtoLP(hdc, &pt, 1);
-#else
- pt.x = pt.y = pointSize;
-#endif
-
- lf.lfHeight = - pt.y;
- lf.lfWidth = 0;
- lf.lfEscapement = 0;
- lf.lfOrientation = 0;
- lf.lfWeight = 0;
- lf.lfItalic = 0;
- lf.lfUnderline = 0;
- lf.lfStrikeOut = 0;
- lf.lfCharSet = DEFAULT_CHARSET;
- lf.lfOutPrecision = 0;
- lf.lfClipPrecision = 0;
- lf.lfQuality = 0;
- lf.lfPitchAndFamily = 0;
-
- strcpy(lf.lfFaceName, faceName);
-
- fFont = CreateFontIndirectA(&lf);
-
- if (fFont == NULL) {
- status = LE_FONT_FILE_NOT_FOUND_ERROR;
- return;
- }
-
- SelectObject(hdc, fFont);
-
- UINT ret = GetOutlineTextMetrics(hdc, sizeof otm, &otm);
-
- if (ret == 0) {
- status = LE_MISSING_FONT_TABLE_ERROR;
- goto restore;
- }
-
- fUnitsPerEM = otm.otmEMSquare;
- fAscent = otm.otmTextMetrics.tmAscent;
- fDescent = otm.otmTextMetrics.tmDescent;
- fLeading = otm.otmTextMetrics.tmExternalLeading;
-
- status = initMapper();
-
- if (LE_FAILURE(status)) {
- goto restore;
- }
-
-#if 0
- status = initFontTableCache();
-#endif
-
-restore:
- RestoreDC(hdc, -1);
-}
-
-GDIFontInstance::~GDIFontInstance()
-{
-#if 0
- flushFontTableCache();
- delete[] fTableCache;
-#endif
-
- if (fFont != NULL) {
- // FIXME: call RemoveObject first?
- DeleteObject(fFont);
- }
-
- delete fMapper;
- fMapper = NULL;
-}
-
-LEErrorCode GDIFontInstance::initMapper()
-{
- LETag cmapTag = LE_CMAP_TABLE_TAG;
- const CMAPTable *cmap = (const CMAPTable *) readFontTable(cmapTag);
-
- if (cmap == NULL) {
- return LE_MISSING_FONT_TABLE_ERROR;
- }
-
- fMapper = CMAPMapper::createUnicodeMapper(cmap);
-
- if (fMapper == NULL) {
- return LE_MISSING_FONT_TABLE_ERROR;
- }
-
- return LE_NO_ERROR;
-}
-
-const void *GDIFontInstance::getFontTable(LETag tableTag) const
-{
- return FontTableCache::find(tableTag);
-}
-
-const void *GDIFontInstance::readFontTable(LETag tableTag) const
-{
- fSurface->setFont(this);
-
- HDC hdc = fSurface->getHDC();
- DWORD stag = SWAPL(tableTag);
- DWORD len = GetFontData(hdc, stag, 0, NULL, 0);
- void *result = NULL;
-
- if (len != GDI_ERROR) {
- result = LE_NEW_ARRAY(char, len);
- GetFontData(hdc, stag, 0, result, len);
- }
-
- return result;
-}
-
-void GDIFontInstance::getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const
-{
- advance.fX = 0;
- advance.fY = 0;
-
- if (glyph == 0xFFFE || glyph == 0xFFFF) {
- return;
- }
-
-
- GLYPHMETRICS metrics;
- DWORD result;
- MAT2 identity = {{0, 1}, {0, 0}, {0, 0}, {0, 1}};
- HDC hdc = fSurface->getHDC();
-
- fSurface->setFont(this);
-
- result = GetGlyphOutline(hdc, glyph, GGO_GLYPH_INDEX | GGO_METRICS, &metrics, 0, NULL, &identity);
-
- if (result == GDI_ERROR) {
- return;
- }
-
- advance.fX = metrics.gmCellIncX;
- return;
-}
-
-le_bool GDIFontInstance::getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &point) const
-{
-#if 0
- hsFixedPoint2 pt;
- le_bool result;
-
- result = fFontInstance->getGlyphPoint(glyph, pointNumber, pt);
-
- if (result) {
- point.fX = xUnitsToPoints(pt.fX);
- point.fY = yUnitsToPoints(pt.fY);
- }
-
- return result;
-#else
- return FALSE;
-#endif
-}
-
diff --git a/Build/source/libs/icu-xetex/samples/layout/GDIFontInstance.h b/Build/source/libs/icu-xetex/samples/layout/GDIFontInstance.h
deleted file mode 100644
index 7b677e77262..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/GDIFontInstance.h
+++ /dev/null
@@ -1,156 +0,0 @@
-
-/*
- *******************************************************************************
- *
- * Copyright (C) 1999-2003, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- *******************************************************************************
- * file name: GDIFontInstance.h
- *
- * created on: 08/09/2000
- * created by: Eric R. Mader
- */
-
-#ifndef __GDIFONTINSTANCE_H
-#define __GDIFONTINSTANCE_H
-
-#include <windows.h>
-
-#include "layout/LETypes.h"
-#include "layout/LEFontInstance.h"
-#include "RenderingSurface.h"
-#include "FontTableCache.h"
-#include "cmaps.h"
-
-class GDIFontInstance;
-
-class GDISurface : public RenderingSurface
-{
-public:
- GDISurface(HDC theHDC);
- virtual ~GDISurface();
-
- virtual void drawGlyphs(const LEFontInstance *font, const LEGlyphID *glyphs, le_int32 count,
- const float *positions, le_int32 x, le_int32 y, le_int32 width, le_int32 height);
-
- void setFont(const GDIFontInstance *font);
- HDC getHDC() const;
- void setHDC(HDC theHDC);
-
-private:
- HDC fHdc;
- const GDIFontInstance *fCurrentFont;
-};
-
-inline HDC GDISurface::getHDC() const
-{
- return fHdc;
-}
-
-class GDIFontInstance : public LEFontInstance, protected FontTableCache
-{
-protected:
- GDISurface *fSurface;
- HFONT fFont;
-
- le_int32 fPointSize;
- le_int32 fUnitsPerEM;
- le_int32 fAscent;
- le_int32 fDescent;
- le_int32 fLeading;
-
- float fDeviceScaleX;
- float fDeviceScaleY;
-
- CMAPMapper *fMapper;
-
- virtual const void *readFontTable(LETag tableTag) const;
-
- virtual LEErrorCode initMapper();
-
-public:
- GDIFontInstance(GDISurface *surface, TCHAR *faceName, le_int16 pointSize, LEErrorCode &status);
- GDIFontInstance(GDISurface *surface, const char *faceName, le_int16 pointSize, LEErrorCode &status);
- //GDIFontInstance(GDISurface *surface, le_int16 pointSize);
-
- virtual ~GDIFontInstance();
-
- HFONT getFont() const;
-
- 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;
-
- 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;
-};
-
-inline HFONT GDIFontInstance::getFont() const
-{
- return fFont;
-}
-
-inline le_int32 GDIFontInstance::getUnitsPerEM() const
-{
- return fUnitsPerEM;
-}
-
-inline le_int32 GDIFontInstance::getAscent() const
-{
- return fAscent;
-}
-
-inline le_int32 GDIFontInstance::getDescent() const
-{
- return fDescent;
-}
-
-inline le_int32 GDIFontInstance::getLeading() const
-{
- return fLeading;
-}
-
-inline LEGlyphID GDIFontInstance::mapCharToGlyph(LEUnicode32 ch) const
-{
- return fMapper->unicodeToGlyph(ch);
-}
-
-inline float GDIFontInstance::getXPixelsPerEm() const
-{
- return (float) fPointSize;
-}
-
-inline float GDIFontInstance::getYPixelsPerEm() const
-{
- return (float) fPointSize;
-}
-
-inline float GDIFontInstance::getScaleFactorX() const
-{
- return fDeviceScaleX;
-}
-
-inline float GDIFontInstance::getScaleFactorY() const
-{
- return fDeviceScaleY;
-}
-
-#endif
diff --git a/Build/source/libs/icu-xetex/samples/layout/GDIFontMap.cpp b/Build/source/libs/icu-xetex/samples/layout/GDIFontMap.cpp
deleted file mode 100644
index 480bbe0eb8a..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/GDIFontMap.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- ******************************************************************************
- * Copyright (C) 1998-2003, International Business Machines Corporation and *
- * others. All Rights Reserved. *
- ******************************************************************************
- */
-
-#include <windows.h>
-
-#include "layout/LEFontInstance.h"
-
-#include "GDIFontInstance.h"
-
-#include "GUISupport.h"
-#include "FontMap.h"
-#include "GDIFontMap.h"
-
-GDIFontMap::GDIFontMap(GDISurface *surface, const char *fileName, le_int16 pointSize, GUISupport *guiSupport, LEErrorCode &status)
- : FontMap(fileName, pointSize, guiSupport, status), fSurface(surface)
-{
- // nothing to do?
-}
-
-GDIFontMap::~GDIFontMap()
-{
- // anything?
-}
-
-const LEFontInstance *GDIFontMap::openFont(const char *fontName, le_int16 pointSize, LEErrorCode &status)
-{
- LEFontInstance *result = new GDIFontInstance(fSurface, fontName, pointSize, status);
-
- if (LE_FAILURE(status)) {
- delete result;
- result = NULL;
- }
-
- return result;
-}
diff --git a/Build/source/libs/icu-xetex/samples/layout/GDIFontMap.h b/Build/source/libs/icu-xetex/samples/layout/GDIFontMap.h
deleted file mode 100644
index e92f47f0c0c..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/GDIFontMap.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- ******************************************************************************
- * Copyright (C) 1998-2003, International Business Machines Corporation and *
- * others. All Rights Reserved. *
- ******************************************************************************
- */
-
-#ifndef __GDIFONTMAP_H
-#define __GDIFONTMAP_H
-
-#include <windows.h>
-
-#include "unicode/uscript.h"
-
-#include "layout/LETypes.h"
-#include "layout/LEFontInstance.h"
-
-#include "FontMap.h"
-#include "GUISupport.h"
-#include "GDIFontInstance.h"
-
-#define BUFFER_SIZE 128
-
-class GDIFontMap : public FontMap
-{
-public:
- GDIFontMap(GDISurface *surface, const char *fileName, le_int16 pointSize, GUISupport *guiSupport, LEErrorCode &status);
-
- virtual ~GDIFontMap();
-
-protected:
- virtual const LEFontInstance *openFont(const char *fontName, le_int16 pointSize, LEErrorCode &status);
-
-private:
- GDISurface *fSurface;
-};
-
-#endif
diff --git a/Build/source/libs/icu-xetex/samples/layout/GDIGUISupport.cpp b/Build/source/libs/icu-xetex/samples/layout/GDIGUISupport.cpp
deleted file mode 100644
index 9f55ffed61e..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/GDIGUISupport.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- *******************************************************************************
- *
- * Copyright (C) 1999-2001, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- *******************************************************************************
- * file name: GDIGUISupport.h
- *
- * created on: 11/06/2001
- * created by: Eric R. Mader
- */
-
-#include <windows.h>
-
-#include "GDIGUISupport.h"
-
-void GDIGUISupport::postErrorMessage(const char *message, const char *title)
-{
- MessageBoxA(NULL, message, title, MB_ICONERROR);
-}
-
diff --git a/Build/source/libs/icu-xetex/samples/layout/GDIGUISupport.h b/Build/source/libs/icu-xetex/samples/layout/GDIGUISupport.h
deleted file mode 100644
index ad4c7143b5a..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/GDIGUISupport.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- *******************************************************************************
- *
- * Copyright (C) 1999-2005, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- *******************************************************************************
- * file name: GDIGUISupport.h
- *
- * created on: 11/06/2001
- * created by: Eric R. Mader
- */
-
-#ifndef __GDIGUISUPPORT_H
-#define __GDIGUISUPPORT_H
-
-#include "GUISupport.h"
-
-class GDIGUISupport : public GUISupport
-{
-public:
- GDIGUISupport() {};
- virtual ~GDIGUISupport() {};
-
- virtual void postErrorMessage(const char *message, const char *title);
-};
-
-#endif
diff --git a/Build/source/libs/icu-xetex/samples/layout/GUISupport.h b/Build/source/libs/icu-xetex/samples/layout/GUISupport.h
deleted file mode 100644
index f41b7cec91d..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/GUISupport.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- *******************************************************************************
- *
- * Copyright (C) 1999-2005, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- *******************************************************************************
- * file name: GUISupport.h
- *
- * created on: 11/06/2001
- * created by: Eric R. Mader
- */
-
-#ifndef __GUISUPPORT_H
-#define __GUISUPPORT_H
-
-class GUISupport
-{
-public:
- GUISupport() {};
- virtual ~GUISupport() {};
-
- virtual void postErrorMessage(const char *message, const char *title) = 0;
-};
-
-#endif
diff --git a/Build/source/libs/icu-xetex/samples/layout/GnomeFontInstance.cpp b/Build/source/libs/icu-xetex/samples/layout/GnomeFontInstance.cpp
deleted file mode 100644
index afab1748e38..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/GnomeFontInstance.cpp
+++ /dev/null
@@ -1,333 +0,0 @@
-
-/*
- *******************************************************************************
- *
- * Copyright (C) 1999-2005, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- *******************************************************************************
- * file name: GnomeFontInstance.cpp
- *
- * created on: 08/30/2001
- * created by: Eric R. Mader
- */
-
-#include <gnome.h>
-#include "freetype/freetype.h"
-
-#include "layout/LETypes.h"
-#include "layout/LESwaps.h"
-
-#include "GnomeFontInstance.h"
-#include "sfnt.h"
-#include "cmaps.h"
-
-GnomeSurface::GnomeSurface(GtkWidget *theWidget)
- : fWidget(theWidget)
-{
- // nothing else to do
-}
-
-GnomeSurface::~GnomeSurface()
-{
- // nothing to do
-}
-
-void GnomeSurface::drawGlyphs(const LEFontInstance *font, const LEGlyphID *glyphs, le_int32 count,
- const float *positions, le_int32 x, le_int32 y, le_int32 /*width*/, le_int32 /*height*/)
-{
- GnomeFontInstance *gFont = (GnomeFontInstance *) font;
- TT_Instance instance = gFont->getFont();
- le_int32 *dx = LE_NEW_ARRAY(le_int32, count);
- le_int32 *dy = LE_NEW_ARRAY(le_int32, count);
- le_int32 xOffset, yOffset;
- TT_Raster_Map *raster;
-// TT_Error error;
-
- for (le_int32 g = 0; g < count; g += 1) {
- dx[g] = (le_int32) (positions[g * 2 + 2] - positions[g * 2]);
- dy[g] = (le_int32) - positions[g * 2 + 1];
- }
-
- raster = gFont->rasterizeGlyphs(glyphs, count, dx, dy, xOffset, yOffset);
-
- if (raster->width > 0 && raster->rows > 0) {
- GdkBitmap *bitmap = gdk_bitmap_create_from_data(NULL, (const gchar *) raster->bitmap, raster->width, raster->rows);
-
- gint bitsx = x + (gint) positions[0] + xOffset;
- gint bitsy = y - yOffset;
-
- gdk_gc_set_clip_origin(fWidget->style->black_gc, bitsx, bitsy);
- gdk_gc_set_clip_mask(fWidget->style->black_gc, bitmap);
-
- gdk_draw_rectangle(fWidget->window,
- fWidget->style->black_gc,
- TRUE,
- bitsx, bitsy,
- raster->width, raster->rows);
-
- gdk_gc_set_clip_origin(fWidget->style->black_gc, 0, 0);
- gdk_gc_set_clip_mask(fWidget->style->black_gc, NULL);
-
- gdk_bitmap_unref(bitmap);
- }
-
- gFont->freeRaster(raster);
- LE_DELETE_ARRAY(dy);
- LE_DELETE_ARRAY(dx);
-}
-
-GnomeFontInstance::GnomeFontInstance(TT_Engine engine, const TT_Text *fontPathName, le_int16 pointSize, LEErrorCode &status)
- : FontTableCache(), fPointSize(pointSize), fUnitsPerEM(0), fAscent(0), fDescent(0), fLeading(0),
- fDeviceScaleX(1), fDeviceScaleY(1), fMapper(NULL)
-{
- TT_Error error;
- TT_Face_Properties faceProperties;
-
- fFace.z = NULL;
-
- error = TT_Open_Face(engine, fontPathName, &fFace);
-
- if (error != 0) {
- status = LE_FONT_FILE_NOT_FOUND_ERROR;
- return;
- }
-
- error = TT_New_Instance(fFace, &fInstance);
-
- if (error != 0) {
- status = LE_MEMORY_ALLOCATION_ERROR;
- return;
- }
-
- // FIXME: what about the display resolution?
- // TT_Set_Instance_Resolutions(fInstance, 72, 72);
- fDeviceScaleX = ((float) 96) / 72;
- fDeviceScaleY = ((float) 96) / 72;
-
- TT_Set_Instance_CharSize(fInstance, pointSize << 6);
-
- TT_Get_Face_Properties(fFace, &faceProperties);
-
- fUnitsPerEM = faceProperties.header->Units_Per_EM;
-
- fAscent = (le_int32) (yUnitsToPoints(faceProperties.horizontal->Ascender) * fDeviceScaleY);
- fDescent = (le_int32) -(yUnitsToPoints(faceProperties.horizontal->Descender) * fDeviceScaleY);
- fLeading = (le_int32) (yUnitsToPoints(faceProperties.horizontal->Line_Gap) * fDeviceScaleY);
-
- // printf("Face = %s, unitsPerEM = %d, ascent = %d, descent = %d\n", fontPathName, fUnitsPerEM, fAscent, fDescent);
-
- error = TT_New_Glyph(fFace, &fGlyph);
-
- if (error != 0) {
- status = LE_MEMORY_ALLOCATION_ERROR;
- return;
- }
-
- status = initMapper();
-}
-
-GnomeFontInstance::~GnomeFontInstance()
-{
- if (fFace.z != NULL) {
- TT_Close_Face(fFace);
- }
-}
-
-LEErrorCode GnomeFontInstance::initMapper()
-{
- LETag cmapTag = LE_CMAP_TABLE_TAG;
- const CMAPTable *cmap = (const CMAPTable *) readFontTable(cmapTag);
-
- if (cmap == NULL) {
- return LE_MISSING_FONT_TABLE_ERROR;
- }
-
- fMapper = CMAPMapper::createUnicodeMapper(cmap);
-
- if (fMapper == NULL) {
- return LE_MISSING_FONT_TABLE_ERROR;
- }
-
- return LE_NO_ERROR;
-}
-
-const void *GnomeFontInstance::getFontTable(LETag tableTag) const
-{
- return FontTableCache::find(tableTag);
-}
-
-const void *GnomeFontInstance::readFontTable(LETag tableTag) const
-{
- TT_Long len = 0;
- void *result = NULL;
-
- TT_Get_Font_Data(fFace, tableTag, 0, NULL, &len);
-
- if (len > 0) {
- result = LE_NEW_ARRAY(char, len);
- TT_Get_Font_Data(fFace, tableTag, 0, result, &len);
- }
-
- return result;
-}
-
-void GnomeFontInstance::getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const
-{
- advance.fX = 0;
- advance.fY = 0;
-
- if (glyph >= 0xFFFE) {
- return;
- }
-
- TT_Glyph_Metrics metrics;
- TT_Error error;
-
- error = TT_Load_Glyph(fInstance, fGlyph, glyph, TTLOAD_SCALE_GLYPH | TTLOAD_HINT_GLYPH);
-
- if (error != 0) {
- return;
- }
-
- TT_Get_Glyph_Metrics(fGlyph, &metrics);
-
- advance.fX = metrics.advance >> 6;
- return;
-}
-
-le_bool GnomeFontInstance::getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &point) const
-{
- TT_Outline outline;
- TT_Error error;
-
- error = TT_Load_Glyph(fInstance, fGlyph, glyph, TTLOAD_SCALE_GLYPH | TTLOAD_HINT_GLYPH);
-
- if (error != 0) {
- return FALSE;
- }
-
- error = TT_Get_Glyph_Outline(fGlyph, &outline);
-
- if (error != 0 || pointNumber >= outline.n_points) {
- return FALSE;
- }
-
- point.fX = outline.points[pointNumber].x >> 6;
- point.fY = outline.points[pointNumber].y >> 6;
-
- return TRUE;
-}
-
-// This table was generated by a little Java program.
-const char bitReverse[256] = {
- 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0,
- 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8, 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8,
- 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4,
- 0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, 0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC,
- 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2, 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2,
- 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA,
- 0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6, 0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6,
- 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE,
- 0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, 0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1,
- 0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, 0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9,
- 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5,
- 0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, 0x6D, 0xED, 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD,
- 0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3,
- 0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, 0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB,
- 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7,
- 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF
-};
-
-// FIXME: this would be much faster if we cached the TT_Glyph objects based on the glyph ID...
-TT_Raster_Map *GnomeFontInstance::rasterizeGlyphs(const LEGlyphID *glyphs, le_int32 glyphCount,
- const le_int32 *dx, const le_int32 *dy, le_int32 &xOffset, le_int32 &yOffset) const
-{
- le_int32 i, xx = 0, yy = 0, zz;
- le_int32 minx = 0, maxx = 0, miny = 0, maxy = 0;
- TT_Raster_Map *raster = new TT_Raster_Map;
- TT_Glyph_Metrics metrics;
- TT_Error error;
-
- for (i = 0; i < glyphCount; i += 1) {
- error = TT_Load_Glyph(fInstance, fGlyph, (TT_UShort) LE_GET_GLYPH(glyphs[i]), TTLOAD_SCALE_GLYPH | TTLOAD_HINT_GLYPH);
- if (error == 0) {
- TT_Get_Glyph_Metrics(fGlyph, &metrics);
-
- zz = xx + metrics.bbox.xMin;
- if (minx > zz) {
- minx = zz;
- }
-
- zz = xx + metrics.bbox.xMax;
- if (maxx < zz) {
- maxx = zz;
- }
-
- yy = dy[i] * 64;
- zz = yy + metrics.bbox.yMin;
- if (miny > zz) {
- miny = zz;
- }
-
- zz = yy + metrics.bbox.yMax;
- if (maxy < zz) {
- maxy = zz;
- }
- }
-
- xx += (dx[i] * 64);
- }
-
-
- minx = (minx & -64) >> 6;
- miny = (miny & -64) >> 6;
-
- maxx = ((maxx + 63) & -64) >> 6;
- maxy = ((maxy + 63) & -64) >> 6;
-
- //printf("minx = %d, maxx = %d, miny = %d, maxy = %d\n", minx, maxx, miny, maxy);
-
- unsigned char *bits;
-
- raster->flow = TT_Flow_Down;
- raster->width = maxx - minx;
- raster->rows = maxy - miny;
- raster->cols = (raster->width + 7) / 8;
- raster->size = raster->cols * raster->rows;
-
- raster->bitmap = bits = LE_NEW_ARRAY(unsigned char, raster->size);
-
- for (i = 0; i < raster->size; i += 1) {
- bits[i] = 0;
- }
-
- xx = (-minx) * 64; yy = (-miny) * 64;
-
- for (i = 0; i < glyphCount; i += 1) {
- if (glyphs[i] < 0xFFFE) {
- error = TT_Load_Glyph(fInstance, fGlyph, (TT_UShort) LE_GET_GLYPH(glyphs[i]), TTLOAD_SCALE_GLYPH | TTLOAD_HINT_GLYPH);
-
- if (error == 0) {
- TT_Get_Glyph_Bitmap(fGlyph, raster, xx, yy + (dy[i] * 64));
- }
- }
-
- xx += (dx[i] * 64);
- }
-
- for (i = 0; i < raster->size; i += 1) {
- bits[i] = bitReverse[bits[i]];
- }
-
- xOffset = minx;
- yOffset = maxy;
-
- return raster;
-}
-
-void GnomeFontInstance::freeRaster(TT_Raster_Map *raster)
-{
- LE_DELETE_ARRAY(raster->bitmap);
- delete raster;
-}
diff --git a/Build/source/libs/icu-xetex/samples/layout/GnomeFontInstance.h b/Build/source/libs/icu-xetex/samples/layout/GnomeFontInstance.h
deleted file mode 100644
index e8cbfa379d3..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/GnomeFontInstance.h
+++ /dev/null
@@ -1,163 +0,0 @@
-
-/*
- *******************************************************************************
- *
- * Copyright (C) 1999-2003, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- *******************************************************************************
- * file name: GnomeFontInstance.h
- *
- * created on: 08/30/2001
- * created by: Eric R. Mader
- */
-
-#ifndef __GNOMEFONTINSTANCE_H
-#define __GNOMEFONTINSTANCE_H
-
-#include <gnome.h>
-#include "freetype/freetype.h"
-
-#include "layout/LETypes.h"
-#include "layout/LEFontInstance.h"
-
-#include "RenderingSurface.h"
-#include "FontTableCache.h"
-#include "cmaps.h"
-
-class GnomeSurface : public RenderingSurface
-{
-public:
- GnomeSurface(GtkWidget *theWidget);
- virtual ~GnomeSurface();
-
- virtual void drawGlyphs(const LEFontInstance *font, const LEGlyphID *glyphs, le_int32 count,
- const float *positions, le_int32 x, le_int32 y, le_int32 width, le_int32 height);
-
- GtkWidget *getWidget() const;
- void setWidget(GtkWidget *theWidget);
-
-private:
- GtkWidget *fWidget;
-};
-
-class GnomeFontInstance : public LEFontInstance, protected FontTableCache
-{
- protected:
- TT_Face fFace;
- TT_Instance fInstance;
- TT_Glyph fGlyph;
-
- le_int32 fPointSize;
- le_int32 fUnitsPerEM;
- le_int32 fAscent;
- le_int32 fDescent;
- le_int32 fLeading;
-
- float fDeviceScaleX;
- float fDeviceScaleY;
-
- CMAPMapper *fMapper;
-
- virtual const void *readFontTable(LETag tableTag) const;
-
- virtual LEErrorCode initMapper();
-
- public:
- GnomeFontInstance(TT_Engine engine, const TT_Text *fontPathName, le_int16 pointSize, LEErrorCode &status);
-
- virtual ~GnomeFontInstance();
-
- TT_Instance getFont() const;
-
- 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;
-
- 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;
-
- TT_Raster_Map *rasterizeGlyphs(const LEGlyphID *glyphs, le_int32 glyphCount, const le_int32 *dx, const le_int32 *dy,
- le_int32 &xOffset, le_int32 &yOffset) const;
-
- void freeRaster(TT_Raster_Map *raster);
-};
-
-inline GtkWidget *GnomeSurface::getWidget() const
-{
- return fWidget;
-}
-
-inline void GnomeSurface::setWidget(GtkWidget *theWidget)
-{
- fWidget = theWidget;
-}
-
-inline TT_Instance GnomeFontInstance::getFont() const
-{
- return fInstance;
-}
-
-inline le_int32 GnomeFontInstance::getUnitsPerEM() const
-{
- return fUnitsPerEM;
-}
-
-inline le_int32 GnomeFontInstance::getAscent() const
-{
- return fAscent;
-}
-
-inline le_int32 GnomeFontInstance::getDescent() const
-{
- return fDescent;
-}
-
-inline le_int32 GnomeFontInstance::getLeading() const
-{
- return fLeading;
-}
-
-inline LEGlyphID GnomeFontInstance::mapCharToGlyph(LEUnicode32 ch) const
-{
- return fMapper->unicodeToGlyph(ch);
-}
-
-inline float GnomeFontInstance::getXPixelsPerEm() const
-{
- return (float) fPointSize;
-}
-
-inline float GnomeFontInstance::getYPixelsPerEm() const
-{
- return (float) fPointSize;
-}
-
-inline float GnomeFontInstance::getScaleFactorX() const
-{
- return fDeviceScaleX;
-}
-
-inline float GnomeFontInstance::getScaleFactorY() const
-{
- return fDeviceScaleY;
-}
-
-#endif
diff --git a/Build/source/libs/icu-xetex/samples/layout/GnomeFontMap.cpp b/Build/source/libs/icu-xetex/samples/layout/GnomeFontMap.cpp
deleted file mode 100644
index 63cc5cd17ad..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/GnomeFontMap.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- ******************************************************************************
- * Copyright (C) 1998-2003, International Business Machines Corporation and *
- * others. All Rights Reserved. *
- ******************************************************************************
- */
-
-#include <stdio.h>
-
-#include "freetype/freetype.h"
-
-#include "layout/LEFontInstance.h"
-#include "GnomeFontInstance.h"
-
-#include "GUISupport.h"
-#include "FontMap.h"
-#include "GnomeFontMap.h"
-
-GnomeFontMap::GnomeFontMap(TT_Engine engine, const char *fileName, le_int16 pointSize, GUISupport *guiSupport, LEErrorCode &status)
- : FontMap(fileName, pointSize, guiSupport, status), fEngine(engine)
-{
- // nothing to do?
-}
-
-GnomeFontMap::~GnomeFontMap()
-{
- // anything?
-}
-
-const LEFontInstance *GnomeFontMap::openFont(const char *fontName, le_int16 pointSize, LEErrorCode &status)
-{
- LEFontInstance *result = new GnomeFontInstance(fEngine, fontName, pointSize, status);
-
- if (LE_FAILURE(status)) {
- delete result;
- result = NULL;
- }
-
- return result;
-}
diff --git a/Build/source/libs/icu-xetex/samples/layout/GnomeFontMap.h b/Build/source/libs/icu-xetex/samples/layout/GnomeFontMap.h
deleted file mode 100644
index 16527a9e5f1..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/GnomeFontMap.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- ******************************************************************************
- * Copyright (C) 1998-2003, International Business Machines Corporation and *
- * others. All Rights Reserved. *
- ******************************************************************************
- */
-
-#ifndef __GNOMEFONTMAP_H
-#define __GNOMEFONTMAP_H
-
-#include "freetype/freetype.h"
-
-#include "unicode/uscript.h"
-
-#include "layout/LETypes.h"
-#include "layout/LEFontInstance.h"
-
-#include "GUISupport.h"
-#include "FontMap.h"
-
-#define BUFFER_SIZE 128
-
-class GnomeFontMap : public FontMap
-{
- public:
- GnomeFontMap(TT_Engine engine, const char *fileName, le_int16 pointSize, GUISupport *guiSupport, LEErrorCode &status);
-
- virtual ~GnomeFontMap();
-
- protected:
- virtual const LEFontInstance *openFont(const char *fontName, le_int16 pointSize, LEErrorCode &status);
-
- private:
- TT_Engine fEngine;
-};
-
-#endif
diff --git a/Build/source/libs/icu-xetex/samples/layout/GnomeGUISupport.cpp b/Build/source/libs/icu-xetex/samples/layout/GnomeGUISupport.cpp
deleted file mode 100644
index 2835b616a01..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/GnomeGUISupport.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *******************************************************************************
- *
- * Copyright (C) 1999-2001, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- *******************************************************************************
- * file name: GnomeGUISupport.cpp
- *
- * created on: 11/06/2001
- * created by: Eric R. Mader
- */
-
-#if 1
-#include <gnome.h>
-#else
-#include <stdio.h>
-#endif
-
-#include "GnomeGUISupport.h"
-
-void GnomeGUISupport::postErrorMessage(const char *message, const char *title)
-{
-#if 1
- gchar *s;
- GtkWidget *error;
-
- s = g_strconcat(title, ":\n", message, NULL);
- error = gnome_error_dialog(s);
- gtk_widget_show(error);
- g_free(s);
-#else
- fprintf(stderr, "%s: %s\n", title, message);
-#endif
-}
-
-
diff --git a/Build/source/libs/icu-xetex/samples/layout/GnomeGUISupport.h b/Build/source/libs/icu-xetex/samples/layout/GnomeGUISupport.h
deleted file mode 100644
index e88ef128a14..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/GnomeGUISupport.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- *******************************************************************************
- *
- * Copyright (C) 1999-2005, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- *******************************************************************************
- * file name: GnomeGUISupport.h
- *
- * created on: 11/06/2001
- * created by: Eric R. Mader
- */
-
-#ifndef __GNOMEGUISUPPORT_H
-#define __GNOMEGUISUPPORT_H
-
-#include "GUISupport.h"
-
-class GnomeGUISupport : public GUISupport
-{
-public:
- GnomeGUISupport() {};
- virtual ~GnomeGUISupport() {};
-
- virtual void postErrorMessage(const char *message, const char *title);
-};
-
-#endif
diff --git a/Build/source/libs/icu-xetex/samples/layout/LayoutSample.rc b/Build/source/libs/icu-xetex/samples/layout/LayoutSample.rc
deleted file mode 100644
index 9b0d3df88cc..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/LayoutSample.rc
+++ /dev/null
@@ -1,115 +0,0 @@
-//Microsoft Developer Studio generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-/*
-*******************************************************************************
-*
-* Copyright (C) 2002-2003, International Business Machines
-* Corporation and others. All Rights Reserved.
-*
-*******************************************************************************
-*/
-#include <winresrc.h>
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Menu
-//
-
-LAYOUTSAMPLE MENU DISCARDABLE
-BEGIN
- POPUP "&File"
- BEGIN
- MENUITEM "&New Sample\tCtrl+N", IDM_FILE_NEWSAMPLE
- MENUITEM "&Open...\tCtrl+O", IDM_FILE_OPEN
- MENUITEM SEPARATOR
- MENUITEM "&Close\tCtrl+W", IDM_FILE_CLOSE
- MENUITEM "E&xit\tCtrl+Q", IDM_FILE_EXIT
- END
- POPUP "&Help"
- BEGIN
- MENUITEM "&About Layout Sample...", IDM_HELP_ABOUTLAYOUTSAMPLE
- END
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Accelerator
-//
-
-LAYOUTSAMPLE ACCELERATORS DISCARDABLE
-BEGIN
- "N", IDM_FILE_NEWSAMPLE, VIRTKEY, CONTROL, NOINVERT
- "O", IDM_FILE_OPEN, VIRTKEY, CONTROL, NOINVERT
- "Q", IDM_FILE_EXIT, VIRTKEY, CONTROL, NOINVERT
- "W", IDM_FILE_CLOSE, VIRTKEY, CONTROL, NOINVERT
-END
-
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE DISCARDABLE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE DISCARDABLE
-BEGIN
- "/*\r\n"
- "*******************************************************************************\r\n"
- "*\r\n"
- "* Copyright (C) 2002-2003, International Business Machines\r\n"
- "* Corporation and others. All Rights Reserved.\r\n"
- "*\r\n"
- "*******************************************************************************\r\n"
- "*/\r\n"
- "#include <winresrc.h>\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE DISCARDABLE
-BEGIN
- "\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-#endif // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
diff --git a/Build/source/libs/icu-xetex/samples/layout/Makefile.in b/Build/source/libs/icu-xetex/samples/layout/Makefile.in
deleted file mode 100644
index caa80c7b6dc..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/Makefile.in
+++ /dev/null
@@ -1,96 +0,0 @@
-## Makefile.in for ICU - samples/layout
-## Copyright (c) 2001-2003, 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 = samples/layout
-
-## Extra files to remove for 'make clean'
-CLEANFILES = *~ $(DEPS)
-
-## Target information
-TARGET = gnomelayout
-
-CPPFLAGS += `gnome-config --cflags gnomeui` -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/layoutex -I$(top_srcdir)/layout -I$(top_srcdir) -g
-
-# Change the following as needed to locate freetype.
-CPPFLAGS += -DLE_USE_CMEMORY -I/usr/include/freetype1
-
-LIBS = $(LIBICULX) $(LIBICULE) $(LIBICUUC) $(LIBICUI18N) @LIBS@ @LIB_M@ `gnome-config --libs gnomeui` -lttf
-
-
-OBJECTS=cmaps.o UnicodeReader.o GnomeGUISupport.o FontMap.o GnomeFontMap.o ScriptCompositeFontInstance.o GnomeFontInstance.o FontTableCache.o paragraph.o gnomelayout.o
-
-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: $(TARGET)
-
-install-local:
-
-dist-local:
-
-clean-local:
- test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
- $(RMV) $(OBJECTS) $(TARGET)
-
-distclean-local: clean-local
- $(RMV) Makefile
-
-check-local: all-local
- $(INVOKE) ./$(TARGET)
-
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-# The following two rules make it possible to
-# compile scrptrun.cpp from the extra/scrptrun directory.
-# they were copied from the default rules in mh-linux which
-# is probably OK because this sample will only run on Linux...
-scrptrun.d: $(top_srcdir)/extra/scrptrun/scrptrun.cpp
- $(SHELL) -ec '$(GEN_DEPS.cc) $< \
- | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
- [ -s $@ ] || rm -f $@'
-
-scrptrun.o: $(top_srcdir)/extra/scrptrun/scrptrun.cpp
- $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
-
-$(TARGET) : $(OBJECTS)
- $(LINK.cc) -o $@ $^ $(LIBS)
-
-invoke:
- ICU_DATA=$${ICU_DATA:-$(top_builddir)/data/} TZ=PST8PDT $(INVOKE) $(INVOCATION)
-
-ifeq (,$(MAKECMDGOALS))
--include $(DEPS)
-else
-ifneq ($(patsubst %clean,,$(MAKECMDGOALS)),)
--include $(DEPS)
-endif
-endif
diff --git a/Build/source/libs/icu-xetex/samples/layout/RenderingSurface.h b/Build/source/libs/icu-xetex/samples/layout/RenderingSurface.h
deleted file mode 100644
index ab0ad561956..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/RenderingSurface.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- *******************************************************************************
- *
- * Copyright (C) 1999-2003, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- *******************************************************************************
- * file name: RenderingFontInstance.h
- *
- * created on: 02/20/2003
- * created by: Eric R. Mader
- */
-
-#ifndef __RENDERINGSURFACE_H
-#define __RENDERINGSURFACE_H
-
-#include "layout/LETypes.h"
-#include "layout/LEFontInstance.h"
-
-class RenderingSurface
-{
-public:
- RenderingSurface() {};
- virtual ~RenderingSurface() {};
-
- virtual void drawGlyphs(const LEFontInstance *font, const LEGlyphID *glyphs, le_int32 count,
- const float *positions, le_int32 x, le_int32 y, le_int32 width, le_int32 height) = 0;
-};
-
-#endif
diff --git a/Build/source/libs/icu-xetex/samples/layout/Sample.txt b/Build/source/libs/icu-xetex/samples/layout/Sample.txt
deleted file mode 100644
index 367821b7933..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/Sample.txt
+++ /dev/null
@@ -1 +0,0 @@
-The LayoutEngine does all the work necessary to display Unicode text written in languages with complex writing systems such as Hindi (हिन्दी) Thai (ไทย) and Arabic (العربية). Here's a sample of some text written in Sanskrit: श्रीमद् भगवद्गीता अध्याय अर्जुन विषाद योग धृतराष्ट्र उवाच। धर्मक्षेत्रे कुरुक्षेत्रे समवेता युयुत्सवः मामकाः पाण्डवाश्चैव किमकुर्वत संजय Here's a sample of some text written in Arabic: أساسًا، تتعامل الحواسيب فقط مع الأرقام، وتقوم بتخزين الأحرف والمحارف الأخرى بعد أن تُعطي رقما معينا لكل واحد منها. وقبل اختراع "يونِكود"، كان هناك مئات الأنظمة للتشفير وتخصيص هذه الأرقام للمحارف، ولم يوجد نظام تشفير واحد يحتوي على جميع المحارف الضرورية and here's a sample of some text written in Thai: บทที่๑พายุไซโคลนโดโรธีอาศัยอยู่ท่ามกลางทุ่งใหญ่ในแคนซัสกับลุงเฮนรีชาวไร่และป้าเอ็มภรรยาชาวไร่บ้านของพวกเขาหลังเล็กเพราะไม้สร้างบ้านต้องขนมาด้วยเกวียนเป็นระยะทางหลายไมล์
diff --git a/Build/source/libs/icu-xetex/samples/layout/ScriptCompositeFontInstance.cpp b/Build/source/libs/icu-xetex/samples/layout/ScriptCompositeFontInstance.cpp
deleted file mode 100644
index 2fbbaca0d4b..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/ScriptCompositeFontInstance.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- *******************************************************************************
- *
- * Copyright (C) 1999-2003, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- *******************************************************************************
- * file name: ScriptCompositeFontInstance.cpp
- *
- * created on: 02/05/2003
- * created by: Eric R. Mader
- */
-
-#include "layout/LETypes.h"
-
-#include "unicode/uscript.h"
-
-#include "FontMap.h"
-
-#include "ScriptCompositeFontInstance.h"
-
-const char ScriptCompositeFontInstance::fgClassID=0;
-
-ScriptCompositeFontInstance::ScriptCompositeFontInstance(FontMap *fontMap)
- : fFontMap(fontMap)
-{
- // nothing else to do
-}
-
-ScriptCompositeFontInstance::~ScriptCompositeFontInstance()
-{
- delete fFontMap;
- fFontMap = NULL;
-}
-
-void ScriptCompositeFontInstance::getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const
-{
- LEErrorCode status = LE_NO_ERROR;
- le_int32 script = LE_GET_SUB_FONT(glyph);
- const LEFontInstance *font = fFontMap->getScriptFont(script, status);
-
- advance.fX = 0;
- advance.fY = 0;
-
- if (LE_SUCCESS(status)) {
- font->getGlyphAdvance(LE_GET_GLYPH(glyph), advance);
- }
-}
-
-le_bool ScriptCompositeFontInstance::getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &point) const
-{
- LEErrorCode status = LE_NO_ERROR;
- le_int32 script = LE_GET_SUB_FONT(glyph);
- const LEFontInstance *font = fFontMap->getScriptFont(script, status);
-
- if (LE_SUCCESS(status)) {
- return font->getGlyphPoint(LE_GET_GLYPH(glyph), pointNumber, point);
- }
-
- return FALSE;
-}
-
-const LEFontInstance *ScriptCompositeFontInstance::getSubFont(const LEUnicode chars[], le_int32 *offset, le_int32 limit, le_int32 script, LEErrorCode &success) const
-{
- if (LE_FAILURE(success)) {
- return NULL;
- }
-
- if (chars == NULL || *offset < 0 || limit < 0 || *offset >= limit || script < 0 || script >= scriptCodeCount) {
- success = LE_ILLEGAL_ARGUMENT_ERROR;
- return NULL;
- }
-
- const LEFontInstance *result = fFontMap->getScriptFont(script, success);
-
- if (LE_FAILURE(success)) {
- return NULL;
- }
-
- *offset = limit;
- return result;
-}
-
-// This is the really stupid version that doesn't look in any other font for the character...
-// It would be better to also look in the "DEFAULT:" font. Another thing to do would be to
-// look in all the fonts in some order, script code order being the most obvious...
-LEGlyphID ScriptCompositeFontInstance::mapCharToGlyph(LEUnicode32 ch) const
-{
- UErrorCode error = U_ZERO_ERROR;
- LEErrorCode status = LE_NO_ERROR;
- le_int32 script = uscript_getScript(ch, &error);
- const LEFontInstance *scriptFont = fFontMap->getScriptFont(script, status);
- LEGlyphID subFont = LE_SET_SUB_FONT(0, script);
-
- if (LE_FAILURE(status)) {
- return subFont;
- }
-
- LEGlyphID glyph = scriptFont->mapCharToGlyph(ch);
-
- return LE_SET_GLYPH(subFont, glyph);
-}
-
diff --git a/Build/source/libs/icu-xetex/samples/layout/ScriptCompositeFontInstance.h b/Build/source/libs/icu-xetex/samples/layout/ScriptCompositeFontInstance.h
deleted file mode 100644
index 241461769d0..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/ScriptCompositeFontInstance.h
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * %W% %E%
- *
- * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved
- *
- */
-
-#ifndef __SCRIPTCOMPOSITEFONTINSTANCE_H
-#define __SCRIPTCOMPOSITEFONTINSTANCE_H
-
-#include "layout/LETypes.h"
-#include "layout/LEFontInstance.h"
-
-#include "FontMap.h"
-
-// U_NAMESPACE_BEGIN
-
-class ScriptCompositeFontInstance : public LEFontInstance
-{
-public:
-
- ScriptCompositeFontInstance(FontMap *fontMap);
-
- virtual ~ScriptCompositeFontInstance();
-
- /**
- * Get a physical font which can render the given text. For composite fonts,
- * if there is no single physical font which can render all of the text,
- * return a physical font which can render an initial substring of the text,
- * and set the <code>offset</code> parameter to the end of that substring.
- *
- * Internally, the LayoutEngine works with runs of text all in the same
- * font and script, so it is best to call this method with text which is
- * in a single script, passing the script code in as a hint. If you don't
- * know the script of the text, you can use zero, which is the script code
- * for characters used in more than one script.
- *
- * The default implementation of this method is intended for instances of
- * <code>LEFontInstance</code> which represent a physical font. It returns
- * <code>this</code> and indicates that the entire string can be rendered.
- *
- * This method will return a valid <code>LEFontInstance</code> unless you
- * have passed illegal parameters, or an internal error has been encountered.
- * For composite fonts, it may return the warning <code>LE_NO_SUBFONT_WARNING</code>
- * to indicate that the returned font may not be able to render all of
- * the text. Whenever a valid font is returned, the <code>offset</code> parameter
- * will be advanced by at least one.
- *
- * Subclasses which implement composite fonts must override this method.
- * Where it makes sense, they should use the script code as a hint to render
- * characters from the COMMON script in the font which is used for the given
- * script. For example, if the input text is a series of Arabic words separated
- * by spaces, and the script code passed in is <code>arabScriptCode</code> you
- * should return the font used for Arabic characters for all of the input text,
- * including the spaces. If, on the other hand, the input text contains characters
- * which cannot be rendered by the font used for Arabic characters, but which can
- * be rendered by another font, you should return that font for those characters.
- *
- * @param chars - the array of Unicode characters.
- * @param offset - a pointer to the starting offset in the text. On exit this
- * will be set the the limit offset of the text which can be
- * rendered using the returned font.
- * @param limit - the limit offset for the input text.
- * @param script - the script hint.
- * @param success - set to an error code if the arguments are illegal, or no font
- * can be returned for some reason. May also be set to
- * <code>LE_NO_SUBFONT_WARNING</code> if the subfont which
- * was returned cannot render all of the text.
- *
- * @return an <code>LEFontInstance</code> for the sub font which can render the characters, or
- * <code>NULL</code> if there is an error.
- *
- * @see LEScripts.h
- *
- * @draft ICU 2.6
- */
- virtual const LEFontInstance *getSubFont(const LEUnicode chars[], le_int32 *offset, le_int32 limit, le_int32 script, LEErrorCode &success) const;
-
- /**
- * This method maps a single character to a glyph index, using the
- * font's charcter to glyph map.
- *
- * @param ch - the character
- *
- * @return the glyph index
- *
- * @draft ICU 2.6
- */
- virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch) const;
-
- 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;
-
- 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;
-
- /**
- * ICU "poor man's RTTI", returns a UClassID for the actual class.
- *
- * @draft ICU 2.2
- */
- virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); }
-
- /**
- * ICU "poor man's RTTI", returns a UClassID for this class.
- *
- * @draft ICU 2.2
- */
- static inline UClassID getStaticClassID() { return (UClassID)&fgClassID; }
-
-protected:
- FontMap *fFontMap;
-
-private:
-
- /**
- * The address of this static class variable serves as this class's ID
- * for ICU "poor man's RTTI".
- */
- static const char fgClassID;
-};
-
-inline const void *ScriptCompositeFontInstance::getFontTable(LETag /*tableTag*/) const
-{
- return NULL;
-}
-
-// Can't get units per EM without knowing which sub-font, so
-// return a value that will make units == points
-inline le_int32 ScriptCompositeFontInstance::getUnitsPerEM() const
-{
- return 1;
-}
-
-inline le_int32 ScriptCompositeFontInstance::getAscent() const
-{
- return fFontMap->getAscent();
-}
-
-inline le_int32 ScriptCompositeFontInstance::getDescent() const
-{
- return fFontMap->getDescent();
-}
-
-inline le_int32 ScriptCompositeFontInstance::getLeading() const
-{
- return fFontMap->getLeading();
-}
-
-inline float ScriptCompositeFontInstance::getXPixelsPerEm() const
-{
- return fFontMap->getPointSize();
-}
-
-inline float ScriptCompositeFontInstance::getYPixelsPerEm() const
-{
- return fFontMap->getPointSize();
-}
-
-// Can't get a scale factor without knowing the sub-font, so
-// return 1.0.
-inline float ScriptCompositeFontInstance::getScaleFactorX() const
-{
- return 1.0;
-}
-
-// Can't get a scale factor without knowing the sub-font, so
-// return 1.0
-inline float ScriptCompositeFontInstance::getScaleFactorY() const
-{
- return 1.0;
-}
-
-// U_NAMESPACE_END
-#endif
diff --git a/Build/source/libs/icu-xetex/samples/layout/Surface.cpp b/Build/source/libs/icu-xetex/samples/layout/Surface.cpp
deleted file mode 100644
index 1f515241a95..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/Surface.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2003, International Business Machines
- * Corporation and others. All Rights Reserved.
- */
-void GDISurface::setFont(RenderingFontInstance *font)
-{
- GDIFontInstance *gFont = (GDIFontInstance *) font;
-
- if (fCurrentFont != font) {
- fCurrentFont = font;
- SelectObject(fHdc, gFont->fFont);
- }
-}
-
-void GDISurface::drawGlyphs(RenderingFontInstance *font, const LEGlyphID *glyphs, le_int32 count, const le_int32 *dx,
- le_int32 x, le_int32 y, le_int32 width, le_int32 height)
-{
- RECT clip;
-
- clip.top = 0;
- clip.left = 0;
- clip.bottom = height;
- clip.right = width;
-
- setFont(font);
-
- ExtTextOut(fHdc, x, y - fAscent, ETO_CLIPPED | ETO_GLYPH_INDEX, &clip,
- glyphs, count, (INT *) dx);
-}
-
diff --git a/Build/source/libs/icu-xetex/samples/layout/Surface.h b/Build/source/libs/icu-xetex/samples/layout/Surface.h
deleted file mode 100644
index 423ddaaf12c..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/Surface.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Copyright (C) 2003, International Business Machines
- * Corporation and others. All Rights Reserved.
- */
-class Surface
-{
-public:
- Surface(/*what?*/);
-
- void setFont(RenderingFontInstance *font);
-
- void drawGlyphs(RenderingFontInstance *font, const LEGlyphID *glyphs, le_int32 count, const le_int32 *dx,
- le_int32 x, le_int32 y, le_int32 width, le_int32 height);
-};
diff --git a/Build/source/libs/icu-xetex/samples/layout/UnicodeReader.cpp b/Build/source/libs/icu-xetex/samples/layout/UnicodeReader.cpp
deleted file mode 100644
index ab5a7ef70b7..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/UnicodeReader.cpp
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- ******************************************************************************
- * Copyright (C) 1998-2005, International Business Machines Corporation and *
- * others. All Rights Reserved. *
- ******************************************************************************
- */
-
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "unicode/utypes.h"
-#include "unicode/unistr.h"
-
-#include "layout/LETypes.h"
-
-#include "GUISupport.h"
-#include "UnicodeReader.h"
-
-#define BYTE(b) (((int) b) & 0xFF)
-
-/*
- * Read the text from a file. The text must start with a Unicode Byte
- * Order Mark (BOM) so that we know what order to read the bytes in.
- */
-const UChar *UnicodeReader::readFile(const char *fileName, GUISupport *guiSupport, int32_t &charCount)
-{
- FILE *f;
- int32_t fileSize;
-
- UChar *charBuffer;
- char *byteBuffer;
- char startBytes[4] = {'\xA5', '\xA5', '\xA5', '\xA5'};
- char errorMessage[128];
- const char *cp = "";
- int32_t signatureLength = 0;
-
- f = fopen(fileName, "rb");
-
- if( f == NULL ) {
- sprintf(errorMessage,"Couldn't open %s: %s \n", fileName, strerror(errno));
- guiSupport->postErrorMessage(errorMessage, "Text File Error");
- return 0;
- }
-
- fseek(f, 0, SEEK_END);
- fileSize = ftell(f);
-
- fseek(f, 0, SEEK_SET);
- fread(startBytes, sizeof(char), 4, f);
-
- if (startBytes[0] == '\xFE' && startBytes[1] == '\xFF') {
- cp = "UTF-16BE";
- signatureLength = 2;
- } else if (startBytes[0] == '\xFF' && startBytes[1] == '\xFE') {
- if (startBytes[2] == '\x00' && startBytes[3] == '\x00') {
- cp = "UTF-32LE";
- signatureLength = 4;
- } else {
- cp = "UTF-16LE";
- signatureLength = 2;
- }
- } else if (startBytes[0] == '\xEF' && startBytes[1] == '\xBB' && startBytes[2] == '\xBF') {
- cp = "UTF-8";
- signatureLength = 3;
- } else if (startBytes[0] == '\x0E' && startBytes[1] == '\xFE' && startBytes[2] == '\xFF') {
- cp = "SCSU";
- signatureLength = 3;
- } else if (startBytes[0] == '\x00' && startBytes[1] == '\x00' &&
- startBytes[2] == '\xFE' && startBytes[3] == '\xFF') {
- cp = "UTF-32BE";
- signatureLength = 4;
- } else {
- sprintf(errorMessage, "Couldn't detect the encoding of %s: (%2.2X, %2.2X, %2.2X, %2.2X)\n", fileName,
- BYTE(startBytes[0]), BYTE(startBytes[1]), BYTE(startBytes[2]), BYTE(startBytes[3]));
- guiSupport->postErrorMessage(errorMessage, "Text File Error");
- fclose(f);
- return 0;
- }
-
- fileSize -= signatureLength;
- fseek(f, signatureLength, SEEK_SET);
- byteBuffer = new char[fileSize];
-
- if(byteBuffer == 0) {
- sprintf(errorMessage,"Couldn't get memory for reading %s: %s \n", fileName, strerror(errno));
- guiSupport->postErrorMessage(errorMessage, "Text File Error");
- fclose(f);
- return 0;
- }
-
- fread(byteBuffer, sizeof(char), fileSize, f);
- if( ferror(f) ) {
- sprintf(errorMessage,"Couldn't read %s: %s \n", fileName, strerror(errno));
- guiSupport->postErrorMessage(errorMessage, "Text File Error");
- fclose(f);
- delete[] byteBuffer;
- return 0;
- }
- fclose(f);
-
- UnicodeString myText(byteBuffer, fileSize, cp);
-
- delete[] byteBuffer;
-
- charCount = myText.length();
- charBuffer = LE_NEW_ARRAY(UChar, charCount + 1);
- if(charBuffer == 0) {
- sprintf(errorMessage,"Couldn't get memory for reading %s: %s \n", fileName, strerror(errno));
- guiSupport->postErrorMessage(errorMessage, "Text File Error");
- return 0;
- }
-
- myText.extract(0, myText.length(), charBuffer);
- charBuffer[charCount] = 0; // NULL terminate for easier reading in the debugger
-
- return charBuffer;
-}
-
diff --git a/Build/source/libs/icu-xetex/samples/layout/UnicodeReader.h b/Build/source/libs/icu-xetex/samples/layout/UnicodeReader.h
deleted file mode 100644
index 47959bb3a49..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/UnicodeReader.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- ******************************************************************************
- * Copyright (C) 1998-2001, International Business Machines Corporation and *
- * others. All Rights Reserved. *
- ******************************************************************************
- */
-
-#ifndef __UNICODEREADER_H
-#define __UNICODEREADER_H
-
-#include "unicode/utypes.h"
-
-#include "GUISupport.h"
-
-class UnicodeReader
-{
-public:
- UnicodeReader()
- {
- // nothing...
- }
-
- ~UnicodeReader()
- {
- // nothing, too
- }
-
- static const UChar *readFile(const char *fileName, GUISupport *guiSupport, int32_t &charCount);
-};
-
-#endif
-
diff --git a/Build/source/libs/icu-xetex/samples/layout/cmaps.cpp b/Build/source/libs/icu-xetex/samples/layout/cmaps.cpp
deleted file mode 100644
index 33b5cbb801f..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/cmaps.cpp
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- ****************************************************************************** *
- *
- * Copyright (C) 1999-2003, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- ****************************************************************************** *
- * file name: cmaps.cpp
- *
- * created on: ??/??/2001
- * created by: Eric R. Mader
- */
-
-#include "layout/LETypes.h"
-#include "layout/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_uint8 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-xetex/samples/layout/cmaps.h b/Build/source/libs/icu-xetex/samples/layout/cmaps.h
deleted file mode 100644
index 868c357b763..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/cmaps.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- ****************************************************************************** *
- *
- * Copyright (C) 1999-2003, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- ****************************************************************************** *
- * file name: cmaps.h
- *
- * created on: ??/??/2001
- * created by: Eric R. Mader
- */
-
-#ifndef __CMAPS_H
-#define __CMAPS_H
-
-#include "layout/LETypes.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()
-{
- LE_DELETE_ARRAY(fcmap);
-}
-
-#endif
-
diff --git a/Build/source/libs/icu-xetex/samples/layout/gnomelayout.cpp b/Build/source/libs/icu-xetex/samples/layout/gnomelayout.cpp
deleted file mode 100644
index 43a56966860..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/gnomelayout.cpp
+++ /dev/null
@@ -1,333 +0,0 @@
-
-/*
- ****************************************************************************** *
- *
- * Copyright (C) 1999-2005, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- ****************************************************************************** *
- * file name: gnomelayout.cpp
- *
- * created on: 09/04/2001
- * created by: Eric R. Mader
- */
-
-#include <gnome.h>
-#include "freetype/freetype.h"
-
-#include "unicode/ustring.h"
-#include "unicode/uscript.h"
-
-#include "GnomeFontInstance.h"
-
-#include "paragraph.h"
-
-#include "GnomeGUISupport.h"
-#include "GnomeFontMap.h"
-#include "UnicodeReader.h"
-#include "ScriptCompositeFontInstance.h"
-
-#define ARRAY_LENGTH(array) (sizeof array / sizeof array[0])
-
-struct Context
-{
- long width;
- long height;
- Paragraph *paragraph;
-};
-
-static TT_Engine engine;
-static GnomeGUISupport *guiSupport;
-static GnomeFontMap *fontMap;
-static ScriptCompositeFontInstance *font;
-
-static GSList *appList = NULL;
-
-GtkWidget *newSample(const gchar *fileName);
-void closeSample(GtkWidget *sample);
-
-void showabout(GtkWidget */*widget*/, gpointer /*data*/)
-{
- GtkWidget *aboutBox;
- const gchar *writtenBy[] = {
- "Eric Mader",
- NULL
- };
-
- aboutBox = gnome_about_new("Gnome Layout Sample",
- "0.1",
- "Copyright (C) 1998-2002 By International Business Machines Corporation and others. All Rights Reserved.",
- writtenBy,
- "A simple demo of the ICU LayoutEngine.",
- NULL);
-
- gtk_widget_show(aboutBox);
-}
-
-void notimpl(GtkObject */*object*/, gpointer /*data*/)
-{
- gnome_ok_dialog("Not implemented...");
-}
-
-gchar *prettyTitle(const gchar *path)
-{
- gchar *name = g_basename(path);
- gchar *title = g_strconcat("Gnome Layout Sample - ", name, NULL);
-
- return title;
-}
-
-void openOK(GtkObject */*object*/, gpointer data)
-{
- GtkFileSelection *fileselection = GTK_FILE_SELECTION(data);
- GtkWidget *app = GTK_WIDGET(gtk_object_get_data(GTK_OBJECT(fileselection), "app"));
- Context *context = (Context *) gtk_object_get_data(GTK_OBJECT(app), "context");
- gchar *fileName = g_strdup(gtk_file_selection_get_filename(fileselection));
- Paragraph *newPara;
-
- gtk_widget_destroy(GTK_WIDGET(fileselection));
-
- newPara = Paragraph::paragraphFactory(fileName, font, guiSupport);
-
- if (newPara != NULL) {
- gchar *title = prettyTitle(fileName);
- GtkWidget *area = GTK_WIDGET(gtk_object_get_data(GTK_OBJECT(app), "area"));
-
- if (context->paragraph != NULL) {
- delete context->paragraph;
- }
-
- context->paragraph = newPara;
- gtk_window_set_title(GTK_WINDOW(app), title);
-
- gtk_widget_hide(area);
- context->paragraph->breakLines(context->width, context->height);
- gtk_widget_show_all(area);
-
- g_free(title);
- }
-
- g_free(fileName);
-}
-
-void openfile(GtkObject */*object*/, gpointer data)
-{
- GtkWidget *app = GTK_WIDGET(data);
- GtkWidget *fileselection;
- GtkWidget *okButton;
- GtkWidget *cancelButton;
-
- fileselection =
- gtk_file_selection_new("Open File");
-
- gtk_object_set_data(GTK_OBJECT(fileselection), "app", app);
-
- okButton =
- GTK_FILE_SELECTION(fileselection)->ok_button;
-
- cancelButton =
- GTK_FILE_SELECTION(fileselection)->cancel_button;
-
- gtk_signal_connect(GTK_OBJECT(fileselection), "destroy",
- GTK_SIGNAL_FUNC(gtk_main_quit), NULL);
-
- gtk_signal_connect(GTK_OBJECT(okButton), "clicked",
- GTK_SIGNAL_FUNC(openOK), fileselection);
-
- gtk_signal_connect_object(GTK_OBJECT(cancelButton), "clicked",
- GTK_SIGNAL_FUNC(gtk_widget_destroy), GTK_OBJECT(fileselection));
-
- gtk_window_set_modal(GTK_WINDOW(fileselection), TRUE);
- gtk_widget_show(fileselection);
- gtk_main();
-}
-
-void newapp(GtkObject */*object*/, gpointer /*data*/)
-{
- GtkWidget *app = newSample("Sample.txt");
-
- gtk_widget_show_all(app);
-}
-
-void closeapp(GtkWidget */*widget*/, gpointer data)
-{
- GtkWidget *app = GTK_WIDGET(data);
-
- closeSample(app);
-}
-
-void shutdown(GtkObject */*object*/, gpointer /*data*/)
-{
- gtk_main_quit();
-}
-
-GnomeUIInfo fileMenu[] =
-{
- GNOMEUIINFO_MENU_NEW_ITEM((gchar *) "_New Sample",
- (gchar *) "Create a new Gnome Layout Sample",
- newapp, NULL),
-
- GNOMEUIINFO_MENU_OPEN_ITEM(openfile, NULL),
- GNOMEUIINFO_SEPARATOR,
- GNOMEUIINFO_MENU_CLOSE_ITEM(closeapp, NULL),
- GNOMEUIINFO_MENU_EXIT_ITEM(shutdown, NULL),
- GNOMEUIINFO_END
-};
-
-GnomeUIInfo helpMenu[] =
-{
- // GNOMEUIINFO_HELP("gnomelayout"),
- GNOMEUIINFO_MENU_ABOUT_ITEM(showabout, NULL),
- GNOMEUIINFO_END
-};
-
-GnomeUIInfo mainMenu[] =
-{
- GNOMEUIINFO_SUBTREE(N_((gchar *) "File"), fileMenu),
- GNOMEUIINFO_SUBTREE(N_((gchar *) "Help"), helpMenu),
- GNOMEUIINFO_END
-};
-
-gint eventDelete(GtkWidget *widget, GdkEvent */*event*/, gpointer /*data*/)
-{
- closeSample(widget);
-
- // indicate that closeapp already destroyed the window
- return TRUE;
-}
-
-gint eventConfigure(GtkWidget */*widget*/, GdkEventConfigure *event, Context *context)
-{
- if (context->paragraph != NULL) {
- context->width = event->width;
- context->height = event->height;
-
- if (context->width > 0 && context->height > 0) {
- context->paragraph->breakLines(context->width, context->height);
- }
- }
-
- return TRUE;
-}
-
-gint eventExpose(GtkWidget *widget, GdkEvent */*event*/, Context *context)
-{
- if (context->paragraph != NULL) {
- gint maxLines = context->paragraph->getLineCount() - 1;
- gint firstLine = 0, lastLine = context->height / context->paragraph->getLineHeight();
- GnomeSurface surface(widget);
-
- context->paragraph->draw(&surface, firstLine, (maxLines < lastLine)? maxLines : lastLine);
- }
-
- return TRUE;
-}
-
-GtkWidget *newSample(const gchar *fileName)
-{
- Context *context = new Context();
-
- context->width = 600;
- context->height = 400;
- context->paragraph = Paragraph::paragraphFactory(fileName, font, guiSupport);
-
- gchar *title = prettyTitle(fileName);
- GtkWidget *app = gnome_app_new("gnomeLayout", title);
-
- gtk_object_set_data(GTK_OBJECT(app), "context", context);
-
- gtk_window_set_default_size(GTK_WINDOW(app), 600 - 24, 400);
-
- gnome_app_create_menus_with_data(GNOME_APP(app), mainMenu, app);
-
- gtk_signal_connect(GTK_OBJECT(app), "delete_event",
- GTK_SIGNAL_FUNC(eventDelete), NULL);
-
- GtkWidget *area = gtk_drawing_area_new();
- gtk_object_set_data(GTK_OBJECT(app), "area", area);
-
- GtkStyle *style = gtk_style_copy(gtk_widget_get_style(area));
-
- for (int i = 0; i < 5; i += 1) {
- style->fg[i] = style->white;
- }
-
- gtk_widget_set_style(area, style);
-
- gnome_app_set_contents(GNOME_APP(app), area);
-
- gtk_signal_connect(GTK_OBJECT(area),
- "expose_event",
- GTK_SIGNAL_FUNC(eventExpose),
- context);
-
- gtk_signal_connect(GTK_OBJECT(area),
- "configure_event",
- GTK_SIGNAL_FUNC(eventConfigure),
- context);
-
- appList = g_slist_prepend(appList, app);
-
- g_free(title);
-
- return app;
-}
-
-void closeSample(GtkWidget *app)
-{
- Context *context = (Context *) gtk_object_get_data(GTK_OBJECT(app), "context");
-
- if (context->paragraph != NULL) {
- delete context->paragraph;
- }
-
- delete context;
-
- appList = g_slist_remove(appList, app);
-
- gtk_widget_destroy(app);
-
- if (appList == NULL) {
- gtk_main_quit();
- }
-}
-
-int main (int argc, char *argv[])
-{
- LEErrorCode fontStatus = LE_NO_ERROR;
- GtkWidget *app;
-
- TT_Init_FreeType(&engine);
-
- gnome_init("gnomelayout", "0.1", argc, argv);
-
- guiSupport = new GnomeGUISupport();
- fontMap = new GnomeFontMap(engine, "FontMap.Gnome", 24, guiSupport, fontStatus);
- font = new ScriptCompositeFontInstance(fontMap);
-
- if (LE_FAILURE(fontStatus)) {
- TT_Done_FreeType(engine);
- return 1;
- }
-
- if (argc <= 1) {
- app = newSample("Sample.txt");
-
- gtk_widget_show_all(app);
- } else {
- for (int i = 1; i < argc; i += 1) {
- app = newSample(argv[i]);
-
- gtk_widget_show_all(app);
- }
- }
-
- gtk_main();
-
- delete font;
- delete guiSupport;
-
- TT_Done_FreeType(engine);
-
- exit(0);
-}
diff --git a/Build/source/libs/icu-xetex/samples/layout/layout.cpp b/Build/source/libs/icu-xetex/samples/layout/layout.cpp
deleted file mode 100644
index 332e03d9d9c..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/layout.cpp
+++ /dev/null
@@ -1,358 +0,0 @@
-/*
- *******************************************************************************
- *
- * Copyright (C) 1999-2005, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- *******************************************************************************
- * file name: Layout.cpp
- *
- * created on: 08/03/2000
- * created by: Eric R. Mader
- */
-
-#include <windows.h>
-#include <stdio.h>
-
-#include "paragraph.h"
-
-#include "GDIGUISupport.h"
-#include "GDIFontMap.h"
-#include "UnicodeReader.h"
-#include "ScriptCompositeFontInstance.h"
-
-#include "resource.h"
-
-#define ARRAY_LENGTH(array) (sizeof array / sizeof array[0])
-
-struct Context
-{
- le_int32 width;
- le_int32 height;
- Paragraph *paragraph;
-};
-
-LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
-
-#define APP_NAME "LayoutSample"
-
-TCHAR szAppName[] = TEXT(APP_NAME);
-
-void PrettyTitle(HWND hwnd, char *fileName)
-{
- char title[MAX_PATH + 64];
-
- sprintf(title, "%s - %s", APP_NAME, fileName);
-
- SetWindowTextA(hwnd, title);
-}
-
-void InitParagraph(HWND hwnd, Context *context)
-{
- SCROLLINFO si;
-
- if (context->paragraph != NULL) {
- // FIXME: does it matter what we put in the ScrollInfo
- // if the window's been minimized?
- if (context->width > 0 && context->height > 0) {
- context->paragraph->breakLines(context->width, context->height);
- }
-
- si.cbSize = sizeof si;
- si.fMask = SIF_RANGE | SIF_PAGE | SIF_DISABLENOSCROLL;
- si.nMin = 0;
- si.nMax = context->paragraph->getLineCount() - 1;
- si.nPage = context->height / context->paragraph->getLineHeight();
- SetScrollInfo(hwnd, SB_VERT, &si, TRUE);
- }
-}
-
-int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
-{
- HWND hwnd;
- HACCEL hAccel;
- MSG msg;
- WNDCLASS wndclass;
- LEErrorCode status = LE_NO_ERROR;
-
- wndclass.style = CS_HREDRAW | CS_VREDRAW;
- wndclass.lpfnWndProc = WndProc;
- wndclass.cbClsExtra = 0;
- wndclass.cbWndExtra = sizeof(LONG);
- wndclass.hInstance = hInstance;
- wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
- wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
- wndclass.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
- wndclass.lpszMenuName = szAppName;
- wndclass.lpszClassName = szAppName;
-
- if (!RegisterClass(&wndclass)) {
- MessageBox(NULL, TEXT("This demo only runs on Windows 2000!"), szAppName, MB_ICONERROR);
-
- return 0;
- }
-
- hAccel = LoadAccelerators(hInstance, szAppName);
-
- hwnd = CreateWindow(szAppName, NULL,
- WS_OVERLAPPEDWINDOW | WS_VSCROLL,
- CW_USEDEFAULT, CW_USEDEFAULT,
- 600, 400,
- NULL, NULL, hInstance, NULL);
-
- ShowWindow(hwnd, iCmdShow);
- UpdateWindow(hwnd);
-
- while (GetMessage(&msg, NULL, 0, 0)) {
- if (!TranslateAccelerator(hwnd, hAccel, &msg)) {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
- }
-
- UnregisterClass(szAppName, hInstance);
- return msg.wParam;
-}
-
-LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
-{
- HDC hdc;
- Context *context;
- static le_int32 windowCount = 0;
- static GDIFontMap *fontMap = NULL;
- static GDISurface *surface = NULL;
- static GDIGUISupport *guiSupport = new GDIGUISupport();
- static ScriptCompositeFontInstance *font = NULL;
-
- switch (message) {
- case WM_CREATE:
- {
- LEErrorCode fontStatus = LE_NO_ERROR;
-
- hdc = GetDC(hwnd);
- surface = new GDISurface(hdc);
-
- fontMap = new GDIFontMap(surface, "FontMap.GDI", 24, guiSupport, fontStatus);
- font = new ScriptCompositeFontInstance(fontMap);
-
- if (LE_FAILURE(fontStatus)) {
- ReleaseDC(hwnd, hdc);
- return -1;
- }
-
- context = new Context();
-
- context->width = 600;
- context->height = 400;
-
- context->paragraph = Paragraph::paragraphFactory("Sample.txt", font, guiSupport);
- SetWindowLong(hwnd, 0, (LONG) context);
-
- windowCount += 1;
- ReleaseDC(hwnd, hdc);
-
- PrettyTitle(hwnd, "Sample.txt");
- return 0;
- }
-
- case WM_SIZE:
- {
- context = (Context *) GetWindowLong(hwnd, 0);
- context->width = LOWORD(lParam);
- context->height = HIWORD(lParam);
-
- InitParagraph(hwnd, context);
- return 0;
- }
-
- case WM_VSCROLL:
- {
- SCROLLINFO si;
- le_int32 vertPos;
-
- si.cbSize = sizeof si;
- si.fMask = SIF_ALL;
- GetScrollInfo(hwnd, SB_VERT, &si);
-
- vertPos = si.nPos;
-
- switch (LOWORD(wParam))
- {
- case SB_TOP:
- si.nPos = si.nMin;
- break;
-
- case SB_BOTTOM:
- si.nPos = si.nMax;
- break;
-
- case SB_LINEUP:
- si.nPos -= 1;
- break;
-
- case SB_LINEDOWN:
- si.nPos += 1;
- break;
-
- case SB_PAGEUP:
- si.nPos -= si.nPage;
- break;
-
- case SB_PAGEDOWN:
- si.nPos += si.nPage;
- break;
-
- case SB_THUMBTRACK:
- si.nPos = si.nTrackPos;
- break;
-
- default:
- break;
- }
-
- si.fMask = SIF_POS;
- SetScrollInfo(hwnd, SB_VERT, &si, TRUE);
- GetScrollInfo(hwnd, SB_VERT, &si);
-
- context = (Context *) GetWindowLong(hwnd, 0);
-
- if (context->paragraph != NULL && si.nPos != vertPos) {
- ScrollWindow(hwnd, 0, context->paragraph->getLineHeight() * (vertPos - si.nPos), NULL, NULL);
- UpdateWindow(hwnd);
- }
-
- return 0;
- }
-
- case WM_PAINT:
- {
- PAINTSTRUCT ps;
- SCROLLINFO si;
- le_int32 firstLine, lastLine;
-
- hdc = BeginPaint(hwnd, &ps);
- SetBkMode(hdc, TRANSPARENT);
-
- si.cbSize = sizeof si;
- si.fMask = SIF_ALL;
- GetScrollInfo(hwnd, SB_VERT, &si);
-
- firstLine = si.nPos;
-
- context = (Context *) GetWindowLong(hwnd, 0);
-
- if (context->paragraph != NULL) {
- surface->setHDC(hdc);
-
- // NOTE: si.nPos + si.nPage may include a partial line at the bottom
- // of the window. We need this because scrolling assumes that the
- // partial line has been painted.
- lastLine = min (si.nPos + (le_int32) si.nPage, context->paragraph->getLineCount() - 1);
-
- context->paragraph->draw(surface, firstLine, lastLine);
- }
-
- EndPaint(hwnd, &ps);
- return 0;
- }
-
- case WM_COMMAND:
- switch (LOWORD(wParam)) {
- case IDM_FILE_OPEN:
- {
- OPENFILENAMEA ofn;
- char szFileName[MAX_PATH], szTitleName[MAX_PATH];
- static char szFilter[] = "Text Files (.txt)\0*.txt\0"
- "All Files (*.*)\0*.*\0\0";
-
- ofn.lStructSize = sizeof (OPENFILENAMEA);
- ofn.hwndOwner = hwnd;
- ofn.hInstance = NULL;
- ofn.lpstrFilter = szFilter;
- ofn.lpstrCustomFilter = NULL;
- ofn.nMaxCustFilter = 0;
- ofn.nFilterIndex = 0;
- ofn.lpstrFile = szFileName;
- ofn.nMaxFile = MAX_PATH;
- ofn.lpstrFileTitle = szTitleName;
- ofn.nMaxFileTitle = MAX_PATH;
- ofn.lpstrInitialDir = NULL;
- ofn.lpstrTitle = NULL;
- ofn.Flags = OFN_HIDEREADONLY | OFN_PATHMUSTEXIST;
- ofn.nFileOffset = 0;
- ofn.nFileExtension = 0;
- ofn.lpstrDefExt = "txt";
- ofn.lCustData = 0L;
- ofn.lpfnHook = NULL;
- ofn.lpTemplateName = NULL;
-
- szFileName[0] = '\0';
-
- if (GetOpenFileNameA(&ofn)) {
- hdc = GetDC(hwnd);
- surface->setHDC(hdc);
-
- Paragraph *newParagraph = Paragraph::paragraphFactory(szFileName, font, guiSupport);
-
- if (newParagraph != NULL) {
- context = (Context *) GetWindowLong(hwnd, 0);
-
- if (context->paragraph != NULL) {
- delete context->paragraph;
- }
-
- context->paragraph = newParagraph;
- InitParagraph(hwnd, context);
- PrettyTitle(hwnd, szTitleName);
- InvalidateRect(hwnd, NULL, TRUE);
-
- }
- }
-
- //ReleaseDC(hwnd, hdc);
-
- return 0;
- }
-
- case IDM_FILE_EXIT:
- case IDM_FILE_CLOSE:
- SendMessage(hwnd, WM_CLOSE, 0, 0);
- return 0;
-
- case IDM_HELP_ABOUTLAYOUTSAMPLE:
- MessageBox(hwnd, TEXT("Windows Layout Sample 0.1\n")
- TEXT("Copyright (C) 1998-2005 By International Business Machines Corporation and others.\n")
- TEXT("Author: Eric Mader"),
- szAppName, MB_ICONINFORMATION | MB_OK);
- return 0;
-
- }
- break;
-
-
- case WM_DESTROY:
- {
- context = (Context *) GetWindowLong(hwnd, 0);
-
- if (context != NULL && context->paragraph != NULL) {
- delete context->paragraph;
- }
-
- delete context;
-
- if (--windowCount <= 0) {
- delete font;
- delete surface;
-
- PostQuitMessage(0);
- }
-
- return 0;
- }
-
- default:
- return DefWindowProc(hwnd, message, wParam, lParam);
- }
-
- return 0;
-}
diff --git a/Build/source/libs/icu-xetex/samples/layout/layout.sln b/Build/source/libs/icu-xetex/samples/layout/layout.sln
deleted file mode 100644
index a7c567123f3..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/layout.sln
+++ /dev/null
@@ -1,21 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 7.00
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "layout", "layout.vcproj", "{497500ED-DE1D-4B20-B529-F41B5A0FBEEB}"
-EndProject
-Global
- GlobalSection(SolutionConfiguration) = preSolution
- ConfigName.0 = Debug
- ConfigName.1 = Release
- EndGlobalSection
- GlobalSection(ProjectDependencies) = postSolution
- EndGlobalSection
- GlobalSection(ProjectConfiguration) = postSolution
- {497500ED-DE1D-4B20-B529-F41B5A0FBEEB}.Debug.ActiveCfg = Debug|Win32
- {497500ED-DE1D-4B20-B529-F41B5A0FBEEB}.Debug.Build.0 = Debug|Win32
- {497500ED-DE1D-4B20-B529-F41B5A0FBEEB}.Release.ActiveCfg = Release|Win32
- {497500ED-DE1D-4B20-B529-F41B5A0FBEEB}.Release.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- EndGlobalSection
- GlobalSection(ExtensibilityAddIns) = postSolution
- EndGlobalSection
-EndGlobal
diff --git a/Build/source/libs/icu-xetex/samples/layout/layout.vcproj b/Build/source/libs/icu-xetex/samples/layout/layout.vcproj
deleted file mode 100644
index 1cf410426fd..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/layout.vcproj
+++ /dev/null
@@ -1,225 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="layout"
- SccProjectName=""
- SccLocalPath="">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Release|Win32"
- OutputDirectory=".\Release"
- IntermediateDirectory=".\Release"
- ConfigurationType="1"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- InlineFunctionExpansion="1"
- OptimizeForProcessor="2"
- AdditionalIncludeDirectories="..\..\..\include,..\..\..\include\layout,..\..\common"
- PreprocessorDefinitions="NDEBUG,_CONSOLE,WIN32,UNICODE,_WIN32_WINNT=0X500,LE_USE_CMEMORY"
- StringPooling="TRUE"
- RuntimeLibrary="2"
- EnableFunctionLevelLinking="TRUE"
- TreatWChar_tAsBuiltInType="TRUE"
- UsePrecompiledHeader="2"
- PrecompiledHeaderFile=".\Release/layout.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
- WarningLevel="3"
- SuppressStartupBanner="TRUE"
- CompileAs="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="..\..\..\lib\iculx.lib ..\..\..\lib\icule.lib ..\..\..\lib\icuuc.lib ..\..\..\lib\icuin.lib odbc32.lib odbccp32.lib"
- OutputFile=".\Release/layout.exe"
- LinkIncremental="1"
- SuppressStartupBanner="TRUE"
- ProgramDatabaseFile=".\Release/layout.pdb"
- SubSystem="2"/>
- <Tool
- Name="VCMIDLTool"
- TypeLibraryName=".\Release/layout.tlb"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory=".\Debug"
- IntermediateDirectory=".\Debug"
- ConfigurationType="1"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- OptimizeForProcessor="2"
- AdditionalIncludeDirectories="..\..\..\include,..\..\..\include\layout,..\..\common"
- PreprocessorDefinitions="_DEBUG,WIN32,UNICODE,_WIN32_WINNT=0X500,LE_USE_CMEMORY"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- TreatWChar_tAsBuiltInType="TRUE"
- UsePrecompiledHeader="2"
- PrecompiledHeaderFile=".\Debug/layout.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
- WarningLevel="3"
- SuppressStartupBanner="TRUE"
- DebugInformationFormat="4"
- CompileAs="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="..\..\..\lib\iculxd.lib ..\..\..\lib\iculed.lib ..\..\..\lib\icuucd.lib ..\..\..\lib\icuind.lib odbc32.lib odbccp32.lib"
- OutputFile=".\Debug/layout.exe"
- LinkIncremental="2"
- SuppressStartupBanner="TRUE"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile=".\Debug/layout.pdb"
- SubSystem="2"/>
- <Tool
- Name="VCMIDLTool"
- TypeLibraryName=".\Debug/layout.tlb"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </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=".\FontMap.cpp">
- </File>
- <File
- RelativePath=".\FontTableCache.cpp">
- </File>
- <File
- RelativePath=".\GDIFontInstance.cpp">
- </File>
- <File
- RelativePath=".\GDIFontMap.cpp">
- </File>
- <File
- RelativePath=".\GDIGUISupport.cpp">
- </File>
- <File
- RelativePath=".\layout.cpp">
- </File>
- <File
- RelativePath=".\LayoutSample.rc">
- </File>
- <File
- RelativePath=".\paragraph.cpp">
- </File>
- <File
- RelativePath=".\ScriptCompositeFontInstance.cpp">
- </File>
- <File
- RelativePath=".\UnicodeReader.cpp">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl">
- <File
- RelativePath=".\cmaps.h">
- </File>
- <File
- RelativePath=".\FontMap.h">
- </File>
- <File
- RelativePath=".\FontTableCache.h">
- </File>
- <File
- RelativePath=".\GDIFontInstance.h">
- </File>
- <File
- RelativePath=".\GDIFontMap.h">
- </File>
- <File
- RelativePath=".\GDIGUISupport.h">
- </File>
- <File
- RelativePath=".\GUISupport.h">
- </File>
- <File
- RelativePath=".\paragraph.h">
- </File>
- <File
- RelativePath=".\RenderingSurface.h">
- </File>
- <File
- RelativePath=".\resource.h">
- </File>
- <File
- RelativePath=".\ScriptCompositeFontInstance.h">
- </File>
- <File
- RelativePath=".\sfnt.h">
- </File>
- <File
- RelativePath=".\UnicodeReader.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-xetex/samples/layout/paragraph.cpp b/Build/source/libs/icu-xetex/samples/layout/paragraph.cpp
deleted file mode 100644
index 315ca04a4b7..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/paragraph.cpp
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- *******************************************************************************
- *
- * Copyright (C) 1999-2005, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- *******************************************************************************
- * file name: Paragraph.cpp
- *
- * created on: 09/06/2000
- * created by: Eric R. Mader
- */
-
-#include "unicode/utypes.h"
-#include "unicode/uchar.h"
-#include "unicode/ubidi.h"
-#include "unicode/ustring.h"
-
-#include "layout/ParagraphLayout.h"
-
-#include "RenderingSurface.h"
-#include "ScriptCompositeFontInstance.h"
-
-#include "paragraph.h"
-#include "UnicodeReader.h"
-#include "FontMap.h"
-
-#define MARGIN 10
-#define LINE_GROW 32
-#define PARA_GROW 8
-
-#define CH_LF 0x000A
-#define CH_CR 0x000D
-#define CH_LSEP 0x2028
-#define CH_PSEP 0x2029
-
-static LEUnicode *skipLineEnd(LEUnicode *ptr)
-{
- if (ptr[0] == CH_CR && ptr[1] == CH_LF) {
- ptr += 1;
- }
-
- return ptr + 1;
-}
-
-static le_int32 findRun(const RunArray *runArray, le_int32 offset)
-{
- le_int32 runCount = runArray->getCount();
-
- for (le_int32 run = 0; run < runCount; run += 1) {
- if (runArray->getLimit(run) > offset) {
- return run;
- }
- }
-
- return -1;
-}
-
-static void subsetFontRuns(const FontRuns *fontRuns, le_int32 start, le_int32 limit, FontRuns *sub)
-{
- le_int32 startRun = findRun(fontRuns, start);
- le_int32 endRun = findRun(fontRuns, limit - 1);
-
- sub->reset();
-
- for (le_int32 run = startRun; run <= endRun; run += 1) {
- const LEFontInstance *runFont = fontRuns->getFont(run);
- le_int32 runLimit = fontRuns->getLimit(run) - start;
-
- if (run == endRun) {
- runLimit = limit - start;
- }
-
- sub->add(runFont, runLimit);
- }
-}
-
-Paragraph::Paragraph(const LEUnicode chars[], int32_t charCount, const FontRuns *fontRuns, LEErrorCode &status)
- : fParagraphLayout(NULL), fParagraphCount(0), fParagraphMax(PARA_GROW), fParagraphGrow(PARA_GROW),
- fLineCount(0), fLinesMax(LINE_GROW), fLinesGrow(LINE_GROW), fLines(NULL), fChars(NULL),
- fLineHeight(-1), fAscent(-1), fWidth(-1), fHeight(-1), fParagraphLevel(UBIDI_DEFAULT_LTR)
-{
- static const LEUnicode separators[] = {CH_LF, CH_CR, CH_LSEP, CH_PSEP};
-
- if (LE_FAILURE(status)) {
- return;
- }
-
- le_int32 ascent = 0;
- le_int32 descent = 0;
- le_int32 leading = 0;
-
- LocaleRuns *locales = NULL;
- FontRuns fr(0);
-
- fLines = LE_NEW_ARRAY(const ParagraphLayout::Line *, fLinesMax);
- fParagraphLayout = LE_NEW_ARRAY(ParagraphLayout *, fParagraphMax);
-
- fChars = LE_NEW_ARRAY(LEUnicode, charCount + 1);
- LE_ARRAY_COPY(fChars, chars, charCount);
- fChars[charCount] = 0;
-
- LEUnicode *pStart = &fChars[0];
-
- while (*pStart != 0) {
- LEUnicode *pEnd = u_strpbrk(pStart, separators);
- le_int32 pAscent, pDescent, pLeading;
- ParagraphLayout *paragraphLayout = NULL;
-
- if (pEnd == NULL) {
- pEnd = &fChars[charCount];
- }
-
- if (pEnd != pStart) {
- subsetFontRuns(fontRuns, pStart - fChars, pEnd - fChars, &fr);
-
- paragraphLayout = new ParagraphLayout(pStart, pEnd - pStart, &fr, NULL, NULL, locales, fParagraphLevel, FALSE, status);
-
- if (LE_FAILURE(status)) {
- break; // return? something else?
- }
-
- if (fParagraphLevel == UBIDI_DEFAULT_LTR) {
- fParagraphLevel = paragraphLayout->getParagraphLevel();
- }
-
- pAscent = paragraphLayout->getAscent();
- pDescent = paragraphLayout->getDescent();
- pLeading = paragraphLayout->getLeading();
-
- if (pAscent > ascent) {
- ascent = pAscent;
- }
-
- if (pDescent > descent) {
- descent = pDescent;
- }
-
- if (pLeading > leading) {
- leading = pLeading;
- }
- }
-
- if (fParagraphCount >= fParagraphMax) {
- fParagraphLayout = (ParagraphLayout **) LE_GROW_ARRAY(fParagraphLayout, fParagraphMax + fParagraphGrow);
- fParagraphMax += fParagraphGrow;
- }
-
- fParagraphLayout[fParagraphCount++] = paragraphLayout;
-
- if (*pEnd == 0) {
- break;
- }
-
- pStart = skipLineEnd(pEnd);
- }
-
- fLineHeight = ascent + descent + leading;
- fAscent = ascent;
-}
-
-Paragraph::~Paragraph()
-{
- for (le_int32 line = 0; line < fLineCount; line += 1) {
- delete /*(LineInfo *)*/ fLines[line];
- }
-
- LE_DELETE_ARRAY(fLines);
- delete fParagraphLayout;
- LE_DELETE_ARRAY(fChars);
-}
-
-void Paragraph::addLine(const ParagraphLayout::Line *line)
-{
- if (fLineCount >= fLinesMax) {
- fLines = (const ParagraphLayout::Line **) LE_GROW_ARRAY(fLines, fLinesMax + fLinesGrow);
- fLinesMax += fLinesGrow;
- }
-
- fLines[fLineCount++] = line;
-}
-
-void Paragraph::breakLines(le_int32 width, le_int32 height)
-{
- fHeight = height;
-
- // don't re-break if the width hasn't changed
- if (fWidth == width) {
- return;
- }
-
- fWidth = width;
-
- float lineWidth = (float) (width - 2 * MARGIN);
- const ParagraphLayout::Line *line;
-
- // Free the old LineInfo's...
- for (le_int32 li = 0; li < fLineCount; li += 1) {
- delete fLines[li];
- }
-
- fLineCount = 0;
-
- for (le_int32 p = 0; p < fParagraphCount; p += 1) {
- ParagraphLayout *paragraphLayout = fParagraphLayout[p];
-
- if (paragraphLayout != NULL) {
- paragraphLayout->reflow();
- while ((line = paragraphLayout->nextLine(lineWidth)) != NULL) {
- addLine(line);
- }
- } else {
- addLine(NULL);
- }
- }
-}
-
-void Paragraph::draw(RenderingSurface *surface, le_int32 firstLine, le_int32 lastLine)
-{
- le_int32 li, x, y;
-
- x = MARGIN;
- y = fAscent;
-
- for (li = firstLine; li <= lastLine; li += 1) {
- const ParagraphLayout::Line *line = fLines[li];
-
- if (line != NULL) {
- le_int32 runCount = line->countRuns();
- le_int32 run;
-
- if (fParagraphLevel == UBIDI_RTL) {
- le_int32 lastX = line->getWidth();
-
- x = (fWidth - lastX - MARGIN);
- }
-
-
- for (run = 0; run < runCount; run += 1) {
- const ParagraphLayout::VisualRun *visualRun = line->getVisualRun(run);
- le_int32 glyphCount = visualRun->getGlyphCount();
- const LEFontInstance *font = visualRun->getFont();
- const LEGlyphID *glyphs = visualRun->getGlyphs();
- const float *positions = visualRun->getPositions();
-
- surface->drawGlyphs(font, glyphs, glyphCount, positions, x, y, fWidth, fHeight);
- }
- }
-
- y += fLineHeight;
- }
-}
-
-Paragraph *Paragraph::paragraphFactory(const char *fileName, const LEFontInstance *font, GUISupport *guiSupport)
-{
- LEErrorCode status = LE_NO_ERROR;
- le_int32 charCount;
- const UChar *text = UnicodeReader::readFile(fileName, guiSupport, charCount);
- Paragraph *result = NULL;
-
- if (text == NULL) {
- return NULL;
- }
-
- FontRuns fontRuns(0);
-
- fontRuns.add(font, charCount);
-
- result = new Paragraph(text, charCount, &fontRuns, status);
-
- if (LE_FAILURE(status)) {
- delete result;
- result = NULL;
- }
-
- LE_DELETE_ARRAY(text);
-
- return result;
-}
-
diff --git a/Build/source/libs/icu-xetex/samples/layout/paragraph.h b/Build/source/libs/icu-xetex/samples/layout/paragraph.h
deleted file mode 100644
index 6972fac3572..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/paragraph.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- *******************************************************************************
- *
- * Copyright (C) 1999-2005, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- *******************************************************************************
- * file name: Paragraph.h
- *
- * created on: 09/06/2000
- * created by: Eric R. Mader
- */
-#ifndef __PARAGRAPH_H
-#define __PARAGRAPH_H
-
-#include "unicode/utypes.h"
-#include "unicode/ubidi.h"
-
-#include "layout/LEFontInstance.h"
-#include "layout/ParagraphLayout.h"
-
-#include "GUISupport.h"
-#include "RenderingSurface.h"
-//#include "FontMap.h"
-
-U_NAMESPACE_USE
-
-#define MARGIN 10
-
-#if 0
-class LineInfo;
-#endif
-
-class Paragraph
-{
-public:
- Paragraph(const LEUnicode chars[], le_int32 charCount, const FontRuns *fontRuns, LEErrorCode &status);
-
- ~Paragraph();
-
- le_int32 getAscent();
- le_int32 getLineHeight();
- le_int32 getLineCount();
- void breakLines(le_int32 width, le_int32 height);
- void draw(RenderingSurface *surface, le_int32 firstLine, le_int32 lastLine);
-
- static Paragraph *paragraphFactory(const char *fileName, const LEFontInstance *font, GUISupport *guiSupport);
-
-private:
- void addLine(const ParagraphLayout::Line *line);
-
- ParagraphLayout **fParagraphLayout;
-
- le_int32 fParagraphCount;
- le_int32 fParagraphMax;
- le_int32 fParagraphGrow;
-
- le_int32 fLineCount;
- le_int32 fLinesMax;
- le_int32 fLinesGrow;
-
- const ParagraphLayout::Line **fLines;
- LEUnicode *fChars;
-
- le_int32 fLineHeight;
- le_int32 fAscent;
- le_int32 fWidth;
- le_int32 fHeight;
- UBiDiLevel fParagraphLevel;
-};
-
-inline le_int32 Paragraph::getLineHeight()
-{
- return fLineHeight;
-}
-
-inline le_int32 Paragraph::getLineCount()
-{
- return fLineCount;
-}
-
-inline le_int32 Paragraph::getAscent()
-{
- return fAscent;
-}
-
-#endif
-
-
diff --git a/Build/source/libs/icu-xetex/samples/layout/readme.html b/Build/source/libs/icu-xetex/samples/layout/readme.html
deleted file mode 100644
index fd108cca17e..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/readme.html
+++ /dev/null
@@ -1,186 +0,0 @@
-<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
-<html>
- <head>
- <!--
-Copyright (c) 2001-2005 International Business Machines
-Corporation and others. All Rights Reserved.
--->
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="Author" content="Eric Mader">
- <meta name="GENERATOR" content="Mozilla/4.72 [en] (Windows NT 5.0; U) [Netscape]">
- <title>Readme file for the ICU LayoutEngine demo</title>
- </head>
- <body>
- <h2>
- What is the layout demo?</h2>
- The layout demo displays a paragraph of text that is laid out using the
- LayoutEngine. There are two versions of this demo, "layout.exe" which runs on
- Windows 2000, and "gnomelayout" which runs on Linux. Both programs read a file
- containing the Unicode text to display, and a file that says which font to use
- to display each script.
- <br>
- &nbsp;
- <h2>
- How do I build the layout demo?</h2>
- First, you need to build ICU, including the LayoutEngine.
- <p>On Windows, the layout project should be listed as a dependency of all, so
- layout will build when you build all. If it doesn't for some reason, just
- select the layout project in the project toolbar and build it.
- </p>
- <p>On Linux systems, you need to add the "--enable-layout=yes" option when you
- invoke the runConfigureICU script. When you've done that, layout should build
- when you do "make all install"
- </p>
- <p>To build the demo on Windows, just open the layout project in
- &lt;icu&gt;\source\samples\layout and build it.</p>
- <p>On Linux systems, connect to &lt;top-build-dir&gt;/samples/layout and do "make
- all" &nbsp;To build the layout demo on Linux, you'll need the gnome-libs-devel
- and freetype-devel packages, which should be part of your Linux distribution.
- The demo uses the FreeType 1 library, and the make files assume that the
- FreeType header files are in /usr/include/freetype1, and that the freetype
- library is /usr/lib/libttf.so. This is how RedHat Linux 7.2 installs FreeType
- 1. If your system is different, you may need to add sym links to where the
- files are stored on your system, or&nbsp; modify
- &lt;top-src-dir&gt;/samples/layout/Makefile.in to reference the files correctly
- for your system.<br>
- &nbsp;
- </p>
- <h2>
- How do I run the demo?</h2>
- Before you can run the demo, you'll need to get the fonts it uses. For legal
- reasons, we can't include these fonts with ICU, but you can download them from
- the web. To do this, you'll need access to a computer running Windows. Here's
- how to get the fonts:
- <p>First, 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 On Windows, copy this
- font file to your Fonts folder, on Linux, copy this font file to the directory
- from which you'll run the layout demo.</p>
- <p>Next is the Hindi font. Go to the&nbsp; NCST site and download&nbsp;<a href="http://rohini.ncst.ernet.in/indix/download/font/raghu.ttf">
- raghu.ttf</a>. Be sure to look at the&nbsp;<a href="http://rohini.ncst.ernet.in/indix/download/font/README">
- README</a> file before you download the font. On Linux, you can download
- raghu.ttf into the directory from which you'll run the layout demo. On Windows,
- you'll need to install it in your Fonts folder.</p>
- <p>There's still one more font to get, the Code2000 Unicode font.Go to James Kass'
- &nbsp;<a href="http://home.att.net/%7Ejameskass/">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. If you're going to run the layout demo
- on Linux, put the CODE2000.TTF file in the directory from which you'll run the
- demo. On Windows, copy the font to your fonts folder.</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>That's it! Now all you have to do is run letest (CTRL+F5 in Visual C++, or
- "./gnomelayout" in Linux)
- </p>
- <h2>
- How can I customize the layout demo?</h2>
- The text that the layout demo displays is read from the file "Sample.txt." You
- can change the text by editing this file using a Unicode-aware text editor. (it
- is in UTF8 format with a BOM as the first character; the demo can also read
- UTF16 and UTF32 format files) Remember that the text will be displayed in a
- single paragraph; you can include CR and LF characters in the text, but they
- will be ignored.
- <p>If you add scripts to the text other than Arabic, Devanagari, Latin or Thai,
- you'll need to find a font which contains the characters in that script, and
- add an entry to the FontMap file ("FontMap.GDI" on Windows, "FontMap.Gnome" on
- Linux) This file contains a single entry per line. Each entry contains a script
- name followed by a colon, and then a font name.
- </p>
- <p>Here is the list of legal script names:
- </p>
- <blockquote><tt>ARABIC</tt>
- <br>
- <tt>ARMENIAN</tt>
- <br>
- <tt>BENGALI</tt>
- <br>
- <tt>BOPOMOFO</tt>
- <br>
- <span style="font-family: monospace;">BUHID</span><br>
- <tt>CANADIAN_ABORIGINAL</tt>
- <br>
- <tt>CHEROKEE</tt>
- <br>
- <tt>CYRILLIC</tt>
- <br>
- <tt>DESERET</tt>
- <br>
- <tt>DEVANAGARI</tt>
- <br>
- <tt>ETHIOPIC</tt>
- <br>
- <tt>GEORGIAN</tt>
- <br>
- <tt>GOTHIC</tt>
- <br>
- <tt>GREEK</tt>
- <br>
- <tt>GUJARATI</tt>
- <br>
- <tt>GURMUKHI</tt>
- <br>
- <tt>HAN</tt>
- <br>
- <tt>HANGUL</tt>
- <br>
- <span style="font-family: monospace;">HANUNOO</span><br>
- <tt>HEBREW</tt>
- <br>
- <tt>HIRAGANA</tt>
- <br>
- <span style="font-family: monospace;"></span><tt>KANNADA</tt>
- <br>
- <tt>KATAKANA</tt>
- <br>
- <tt>KHMER</tt>
- <br>
- <tt>LATIN</tt>
- <br>
- <tt>MALAYALAM</tt>
- <br>
- <tt>MONGOLIAN</tt>
- <br>
- <tt>MYANMAR</tt>
- <br>
- <tt>OGHAM</tt>
- <br>
- <tt>OLD_ITALIC</tt>
- <br>
- <tt>ORIYA</tt>
- <br>
- <tt>RUNIC</tt>
- <br>
- <tt>SINHALA</tt>
- <br>
- <tt>SYRIAC</tt>
- <br>
- <span style="font-family: monospace;">TAGALOG<br>
-TAGBANWA</span><br>
- <tt>TAMIL</tt>
- <br>
- <tt>TELUGU</tt>
- <br>
- <tt>THAANA</tt>
- <br>
- <tt>THAI</tt>
- <br>
- <tt>TIBETAN</tt>
- <br>
- <tt>YI<br>
- </tt></blockquote>You can also use the script name "DEFAULT" to represent
- all scripts which you don't explicitly list in the FontMap file.<br>
- <br>
- On Windows use the full name of the font as it appears in the Windows Fonts
- folder (eg. "Times New Roman") On Linux, use the file name of the font file
- (e.g. "Times.TTF") If you're running on Windows, you'll need to install the new
- fonts in your Fonts folder. If you're running on Linux, put them in the
- directory from which you'll run the demo.
- <br>
- &nbsp;
- <br>
- &nbsp;
- </body>
-</html>
diff --git a/Build/source/libs/icu-xetex/samples/layout/resource.h b/Build/source/libs/icu-xetex/samples/layout/resource.h
deleted file mode 100644
index f582d8ebbac..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/resource.h
+++ /dev/null
@@ -1,22 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Developer Studio generated include file.
-// Copyright (c) 2001-2003 International Business Machines
-// Corporation and others. All Rights Reserved.
-// Used by LayoutSample.rc
-//
-#define IDM_FILE_NEWSAMPLE 40001
-#define IDM_FILE_OPEN 40002
-#define IDM_FILE_CLOSE 40003
-#define IDM_FILE_EXIT 40004
-#define IDM_HELP_ABOUTLAYOUTSAMPLE 40005
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 104
-#define _APS_NEXT_COMMAND_VALUE 40006
-#define _APS_NEXT_CONTROL_VALUE 1000
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
diff --git a/Build/source/libs/icu-xetex/samples/layout/sfnt.h b/Build/source/libs/icu-xetex/samples/layout/sfnt.h
deleted file mode 100644
index 3b3d991adcc..00000000000
--- a/Build/source/libs/icu-xetex/samples/layout/sfnt.h
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- ****************************************************************************** *
- *
- * Copyright (C) 1999-2001, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- ****************************************************************************** *
- * file name: sfnt.h
- *
- * created on: ??/??/2001
- * created by: Eric R. Mader
- */
-
-#ifndef __SFNT_H
-#define __SFNT_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];
-};
-
-struct CMAPEncodingSubtable32
-{
- le_uint32 format;
- le_uint32 length;
- le_uint32 language;
-};
-
-struct CMAPGroup
-{
- le_uint32 startCharCode;
- le_uint32 endCharCode;
- le_uint32 startGlyphCode;
-};
-
-struct CMAPFormat8Encoding : CMAPEncodingSubtable32
-{
- le_uint32 is32[65536/32];
- le_uint32 nGroups;
- CMAPGroup groups[ANY_NUMBER];
-};
-
-struct CMAPFormat10Encoding : CMAPEncodingSubtable32
-{
- le_uint32 startCharCode;
- le_uint32 numCharCodes;
- le_uint16 glyphs[ANY_NUMBER];
-};
-
-struct CMAPFormat12Encoding : CMAPEncodingSubtable32
-{
- le_uint32 nGroups;
- CMAPGroup groups[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
-};
-
-#endif
-