diff options
author | Jonathan Kew <jfkthame@googlemail.com> | 2008-02-08 17:28:24 +0000 |
---|---|---|
committer | Jonathan Kew <jfkthame@googlemail.com> | 2008-02-08 17:28:24 +0000 |
commit | d930e60f53da36d97d91f77e00d01c242f4aba37 (patch) | |
tree | 10508a97e179a73aaca1fcc9d79a3de24026bfd4 /Build/source/libs/graphite-engine/test | |
parent | fcfc8e4880e9573c7c7e54476667079a8269f0fb (diff) |
graphite update (synch with XeTeX repository rev.562)
git-svn-id: svn://tug.org/texlive/trunk@6568 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/graphite-engine/test')
26 files changed, 2767 insertions, 90 deletions
diff --git a/Build/source/libs/graphite-engine/test/Makefile.am b/Build/source/libs/graphite-engine/test/Makefile.am index 4a5422f014f..96570ad125a 100644 --- a/Build/source/libs/graphite-engine/test/Makefile.am +++ b/Build/source/libs/graphite-engine/test/Makefile.am @@ -1,2 +1,2 @@ -SUBDIRS = RegressionTest +SUBDIRS = ProfileHarness RegressionTest EXTRA_DIST = fonterrors diff --git a/Build/source/libs/graphite-engine/test/Makefile.in b/Build/source/libs/graphite-engine/test/Makefile.in index 4c74fbb3979..29d0d87eeb5 100644 --- a/Build/source/libs/graphite-engine/test/Makefile.in +++ b/Build/source/libs/graphite-engine/test/Makefile.in @@ -110,6 +110,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ REL_CODENAME = @REL_CODENAME@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZEOF_WCHAR_T = @SIZEOF_WCHAR_T@ @@ -162,7 +163,7 @@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -SUBDIRS = RegressionTest +SUBDIRS = ProfileHarness RegressionTest EXTRA_DIST = fonterrors all: all-recursive diff --git a/Build/source/libs/graphite-engine/test/ProfileHarness/GrUtfTextSrc.cpp b/Build/source/libs/graphite-engine/test/ProfileHarness/GrUtfTextSrc.cpp new file mode 100644 index 00000000000..7904b1c6653 --- /dev/null +++ b/Build/source/libs/graphite-engine/test/ProfileHarness/GrUtfTextSrc.cpp @@ -0,0 +1,310 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: NPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.1 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is sila.mozdev.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Keith Stribley.
+ * Portions created by the Initial Developer are Copyright (C) 2004
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the NPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the NPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+#include <graphite/GrClient.h>
+#include <graphite/ITextSource.h>
+#include <graphite/IGrJustifier.h>
+#include <graphite/IGrEngine.h>
+#include <graphite/SegmentAux.h>
+#include <graphite/Font.h>
+#include <graphite/Segment.h>
+#include <graphite/GraphiteProcess.h>
+#include <graphite/FileFont.h>
+
+#include "GrUtfTextSrc.h"
+
+
+
+GrUtfTextSrc::GrUtfTextSrc()
+: mLength(0),
+ mBufferLength8(64), mBufferLength16(64), mBufferLength32(64),
+ mData8(NULL), mData16(NULL), mData32(NULL),
+ mType(gr::kutf16),
+ mForeground(gr::kclrBlack), mBackground(gr::kclrTransparent),
+ mSelectForeground(0), mSelectBackground(0),
+ mIsSelected(false),
+ mFont(NULL),
+ mRtl(false)
+{
+
+}
+
+GrUtfTextSrc::~GrUtfTextSrc()
+{
+ if (mData8) delete [] mData8;
+ if (mData16) delete [] mData16;
+ if (mData32) delete [] mData32;
+ mSelectionVector.clear();
+}
+
+bool GrUtfTextSrc::setText(const char * pszText, int len)
+{
+ return setText((gr::utf8*)pszText, len);
+}
+
+bool GrUtfTextSrc::setText(const gr::utf8 * pszText, int len)
+{
+ mType = gr::kutf8;
+ mLength = len;
+ if (!checkBuffer8()) return false;
+
+ for(size_t i = 0; i < mLength; i++)
+ {
+ mData8[i] = pszText[i];
+ // stray line feeds and other control characters from the html file
+ // cause artificial truncation of segments
+ if (mData8[i] < 0x0020)//(pszText[i] == '\n' || pszText[i] == '\r')
+ mData8[i] = 0x20; // ZWSP
+ }
+ mData8[mLength] = '\0'; // zero-terminate
+ mSelectionVector.clear();
+ mIsSelected = false;
+ return true;
+}
+
+
+bool GrUtfTextSrc::setText(const gr::utf16 * pszText, int len)
+{
+ mType = gr::kutf16;
+ mLength = len;
+ if (!checkBuffer16()) return false;
+
+ for(size_t i = 0; i < mLength; i++)
+ {
+ mData16[i] = pszText[i];
+ // stray line feeds and other control characters from the html file
+ // cause artificial truncation of segments
+ if (mData16[i] < 0x0020)//(pszText[i] == '\n' || pszText[i] == '\r')
+ mData16[i] = 0x200B; // ZWSP
+ }
+ mData16[mLength] = '\0'; // zero-terminate
+ mSelectionVector.clear();
+ mIsSelected = false;
+ return true;
+}
+
+bool GrUtfTextSrc::setText(const gr::utf32 * pszText, int len)
+{
+ mType = gr::kutf32;
+ mLength = len;
+ if (!checkBuffer32()) return false;
+
+ for(size_t i = 0; i < mLength; i++)
+ {
+ mData32[i] = pszText[i];
+ }
+ mData32[mLength] = '\0'; // zero-terminate
+ mSelectionVector.clear();
+ mIsSelected = false;
+ return true;
+}
+
+bool GrUtfTextSrc::checkBuffer8(void)
+{
+ if (!mData8 || mBufferLength8 < mLength + 1)
+ {
+ do
+ {
+ mBufferLength8 *= 2;
+ } while (mBufferLength8 < mLength + 1);
+ if (mData8) delete [] mData8;
+ mData8 = new gr::utf8[mBufferLength8];
+ }
+ return (mData8) ? true : false;
+}
+
+bool GrUtfTextSrc::checkBuffer16(void)
+{
+ if (!mData16 || mBufferLength16 < mLength + 1)
+ {
+ do
+ {
+ mBufferLength16 *= 2;
+ } while (mBufferLength16 < mLength + 1);
+ if (mData16) delete [] mData16;
+ mData16 = new gr::utf16[mBufferLength16];
+ }
+ return (mData16) ? true : false;
+}
+
+bool GrUtfTextSrc::checkBuffer32(void)
+{
+ if (!mData32 || mBufferLength32 < mLength + 1)
+ {
+ do
+ {
+ mBufferLength32 *= 2;
+ } while (mBufferLength32 < mLength + 1);
+ if (mData32) delete [] mData32;
+ mData32 = new gr::utf32[mBufferLength32];
+ }
+ return (mData32) ? true : false;
+}
+
+size_t GrUtfTextSrc::fetch(gr::toffset ichMin, size_t cch, gr::utf8 * prgchwBuffer)
+{
+ assert(cch <= mLength);
+ if (cch > mLength)
+ {
+ return 0;
+ }
+ std::copy(mData8 + ichMin, mData8 + ichMin + cch, prgchwBuffer);
+ return (cch - ichMin);
+}
+
+size_t GrUtfTextSrc::fetch(gr::toffset ichMin, size_t cch, gr::utf16 * prgchwBuffer)
+{
+ assert(cch <= mLength);
+ if (cch > mLength)
+ {
+ return 0;
+ }
+ std::copy(mData16 + ichMin, mData16 + ichMin + cch, prgchwBuffer);
+ return (cch - ichMin);
+}
+
+size_t GrUtfTextSrc::fetch(gr::toffset ichMin, size_t cch, gr::utf32 * prgchwBuffer)
+{
+ assert(cch <= mLength);
+ if (cch > mLength)
+ {
+ return 0;
+ }
+ std::copy(mData32 + ichMin, mData32 + ichMin + cch, prgchwBuffer);
+ return (cch - ichMin);
+}
+
+
+bool GrUtfTextSrc::getRightToLeft(gr::toffset ich)
+{
+ return mRtl; // assumes src only contains one direction
+}
+
+unsigned int GrUtfTextSrc::getDirectionDepth(gr::toffset ich)
+{
+ return (mRtl) ? 1 : 0; // TBD
+}
+
+std::pair<gr::toffset, gr::toffset> GrUtfTextSrc::propertyRange(gr::toffset ich)
+{
+ std::pair<gr::toffset, gr::toffset> range(0, mLength);
+ if (mIsSelected)
+ {
+ bool selectState = mSelectionVector[ich];
+ // find start
+ int s = ich - 1;
+ int e = ich + 1;
+ if (s > -1)
+ for ( ; s >= 0; s--)
+ {
+ if (mSelectionVector[s] != selectState)
+ {
+ s++; // backup
+ break;
+ }
+ }
+ if (s < 0) s = 0;
+ // find end
+ for ( ; e < static_cast<int>(mLength); e++)
+ {
+ if (mSelectionVector[e] != selectState)
+ {
+ // don't need to backup for end
+ break;
+ }
+ }
+ range.first = s;
+ range.second = e;
+ }
+ return range;
+}
+
+size_t GrUtfTextSrc::getFontFeatures(gr::toffset ich, gr::FeatureSetting * prgfset)
+{
+ return 0;
+}
+
+void GrUtfTextSrc::getColors(gr::toffset ich, int * pclrFore, int * pclrBack)
+{
+ // selections are handled here
+ if (mIsSelected && mSelectionVector[ich])
+ {
+ *pclrFore = mSelectForeground;
+ *pclrBack = mSelectBackground;
+ }
+ else
+ {
+ *pclrFore = mForeground;
+ *pclrBack = mBackground;
+ }
+}
+
+
+// these should be called I hope
+float
+GrUtfTextSrc::getFontSize(gr::toffset ich)
+{
+ assert(mFont);
+ return mPointSize;
+}
+
+bool
+GrUtfTextSrc::getBold(gr::toffset ich)
+{
+ assert(mFont);
+// NS_ASSERTION(false, "unexpected call to getBold");
+// return false;
+ return mFont->bold();
+}
+
+bool
+GrUtfTextSrc::getItalic(gr::toffset ich)
+{
+ assert(mFont);
+ //NS_ASSERTION(false, "unexpected call to getItalic");
+ //return false;
+ return mFont->italic();
+}
+
+gr::isocode GrUtfTextSrc::getLanguage(gr::toffset ich)
+{
+ gr::isocode unknown;
+ std::fill_n(unknown.rgch, 4, '\0');
+ return unknown;
+}
+
diff --git a/Build/source/libs/graphite-engine/test/ProfileHarness/GrUtfTextSrc.h b/Build/source/libs/graphite-engine/test/ProfileHarness/GrUtfTextSrc.h new file mode 100644 index 00000000000..bdcd5fd6caf --- /dev/null +++ b/Build/source/libs/graphite-engine/test/ProfileHarness/GrUtfTextSrc.h @@ -0,0 +1,146 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: NPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.1 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is sila.mozdev.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Keith Stribley.
+ * Portions created by the Initial Developer are Copyright (C) 2004
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the NPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the NPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef GRUTFTXTSRC_INCLUDED
+#define GRUTFTXTSRC_INCLUDED
+
+#include <vector>
+#include <assert.h>
+
+#include <graphite/GrAppData.h>
+#include <graphite/GrStructs.h>
+#include <graphite/ITextSource.h>
+
+class nsIGrSegWrapper;
+
+/*-----------------------------------------------------------------------------
+ Class: ITextSource
+ This class provides an interface of a text source for the Graphite engine.
+------------------------------------------------------------------------------*/
+class GrUtfTextSrc : public gr::IColorTextSource
+{
+public:
+ GrUtfTextSrc();
+ ~GrUtfTextSrc();
+ bool setText(const gr::utf8 * pszText, int len);
+ bool setText(const char * pszText, int len);
+ bool setText(const gr::utf16 * pszText, int len);
+ bool setText(const gr::utf32 * pszText, int len);
+ void setColors(int foreground, int background)
+ {
+ mForeground = foreground;
+ mBackground = background;
+ };
+ //void setSelectionDetails(nsIGrSegWrapper * wrapper);
+ void setFont(gr::Font * font) { mFont = font; };
+ void setPointSize(float & pointSize) { mPointSize = pointSize; };
+ // --------------------------------------------------------------------------
+ // New V2 interface:
+
+ virtual gr::UtfType utfEncodingForm() { return mType; };
+ virtual size_t getLength() { return mLength; };
+ virtual size_t fetch(gr::toffset ichMin, size_t cch, gr::utf32 * prgchBuffer);
+ virtual size_t fetch(gr::toffset ichMin, size_t cch, gr::utf16 * prgchwBuffer);
+ virtual size_t fetch(gr::toffset ichMin, size_t cch, gr::utf8 * prgchsBuffer);
+ virtual gr::GrResult getFaceName(int ich, unsigned int cchMax,
+ gr::utf16 * prgchFaceName, unsigned int * pcchLen)
+ {
+ prgchFaceName[0] = 0;
+ *pcchLen = 0;
+ return gr::kresNotImpl;
+ };
+ //virtual std::wstring getFaceName(int ich) { return mFont->getFaceName(); };
+ virtual float getFontSize(gr::toffset ich);
+ virtual bool getBold(gr::toffset ich);
+ virtual bool getItalic(gr::toffset ich);
+ virtual bool getRightToLeft(gr::toffset ich);
+ virtual unsigned int getDirectionDepth(gr::toffset ich);
+ virtual float getVerticalOffset(gr::toffset ich) { return 0;};
+ virtual gr::isocode getLanguage(gr::toffset ich);
+
+ virtual std::pair<gr::toffset, gr::toffset> propertyRange(gr::toffset ich);
+ virtual size_t getFontFeatures(gr::toffset ich, gr::FeatureSetting * prgfset);
+ virtual bool sameSegment(gr::toffset ich1, gr::toffset ich2) { return true; };
+
+protected:
+ bool checkBuffer8();
+ bool checkBuffer16();
+ bool checkBuffer32();
+
+private:
+ size_t mLength;
+ size_t mBufferLength8;
+ size_t mBufferLength16;
+ size_t mBufferLength32;
+ gr::utf8 * mData8;
+ gr::utf16 * mData16;
+ gr::utf32 * mData32;
+ gr::UtfType mType;
+ int mForeground;
+ int mBackground;
+ int mSelectForeground;
+ int mSelectBackground;
+ bool mIsSelected;
+ std::wstring mFaceName;
+ std::vector<bool> mSelectionVector;
+ gr::Font * mFont;
+ bool mRtl;
+ float mPointSize;
+
+public: // methods that will go
+ // Temporary--eventually these will be of interest only to SegmentPainter.
+ virtual void getColors(gr::toffset ich, int * pclrFore, int * pclrBack);
+
+ // Shouldn't be here!
+ virtual gr::GrResult Fetch(int ichMin, int ichLim, gr::utf16 * prgchBuf) { return gr::kresNotImpl; };
+ virtual gr::GrResult get_Length(int * pcch) { return gr::kresNotImpl; };
+ virtual gr::GrResult GetFontVariations(int ich,
+ wchar_t * prgchFontVar, int ichMax, int * pich,
+ int * pichMin, int * pichLim) { return gr::kresNotImpl; };
+
+};
+
+
+#if !defined(GR_NAMESPACE)
+using namespace gr;
+#endif
+
+#endif // !GRUTFTXTSRC_INCLUDED
+
diff --git a/Build/source/libs/graphite-engine/test/ProfileHarness/Makefile.am b/Build/source/libs/graphite-engine/test/ProfileHarness/Makefile.am new file mode 100644 index 00000000000..07d07348eff --- /dev/null +++ b/Build/source/libs/graphite-engine/test/ProfileHarness/Makefile.am @@ -0,0 +1,14 @@ +AUTOMAKE_OPTIONS = 1.6 + +noinst_PROGRAMS = profile-graphite + +AM_CPPFLAGS = -I$(top_srcdir)/include + +profile_graphite_LDFLAGS = -L$(top_builddir)/src -lgraphite + +profile_graphite_SOURCES = \ + GrUtfTextSrc.cpp GrUtfTextSrc.h \ + ProfileHarness.cpp + +#dist-hook: +# rm -f grregtest.log tracelog.txt diff --git a/Build/source/libs/graphite-engine/test/ProfileHarness/Makefile.in b/Build/source/libs/graphite-engine/test/ProfileHarness/Makefile.in new file mode 100644 index 00000000000..a9d264683b2 --- /dev/null +++ b/Build/source/libs/graphite-engine/test/ProfileHarness/Makefile.in @@ -0,0 +1,447 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +noinst_PROGRAMS = profile-graphite$(EXEEXT) +subdir = test/ProfileHarness +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +PROGRAMS = $(noinst_PROGRAMS) +am_profile_graphite_OBJECTS = GrUtfTextSrc.$(OBJEXT) \ + ProfileHarness.$(OBJEXT) +profile_graphite_OBJECTS = $(am_profile_graphite_OBJECTS) +profile_graphite_LDADD = $(LDADD) +DEFAULT_INCLUDES = -I. -I$(srcdir) +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(profile_graphite_SOURCES) +DIST_SOURCES = $(profile_graphite_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LSB_RELEASE = @LSB_RELEASE@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +REL_CODENAME = @REL_CODENAME@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIZEOF_WCHAR_T = @SIZEOF_WCHAR_T@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +AUTOMAKE_OPTIONS = 1.6 +AM_CPPFLAGS = -I$(top_srcdir)/include +profile_graphite_LDFLAGS = -L$(top_builddir)/src -lgraphite +profile_graphite_SOURCES = \ + GrUtfTextSrc.cpp GrUtfTextSrc.h \ + ProfileHarness.cpp + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/ProfileHarness/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/ProfileHarness/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +profile-graphite$(EXEEXT): $(profile_graphite_OBJECTS) $(profile_graphite_DEPENDENCIES) + @rm -f profile-graphite$(EXEEXT) + $(CXXLINK) $(profile_graphite_LDFLAGS) $(profile_graphite_OBJECTS) $(profile_graphite_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GrUtfTextSrc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ProfileHarness.Po@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstPROGRAMS ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-info-am + + +#dist-hook: +# rm -f grregtest.log tracelog.txt +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/Build/source/libs/graphite-engine/test/ProfileHarness/ProfileHarness.cpp b/Build/source/libs/graphite-engine/test/ProfileHarness/ProfileHarness.cpp new file mode 100644 index 00000000000..bf1f874e9bc --- /dev/null +++ b/Build/source/libs/graphite-engine/test/ProfileHarness/ProfileHarness.cpp @@ -0,0 +1,475 @@ +/*-----------------------------------------------------------------------------
+Copyright (C) 2007 SIL International
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File:
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+A simple console app that creates a segment using FileFont and dumps a
+diagnostic table of the resulting glyph vector to the console.
+If graphite has been built with -DTRACING then it will also produce a
+diagnostic log of the segment creation in grSegmentLog.txt
+-----------------------------------------------------------------------------*/
+
+//#include <stdlib.h>
+#include <stdio.h>
+#include <assert.h>
+#include <iostream>
+#include <iomanip>
+#include <string>
+#include <sstream>
+
+#include <graphite/GrClient.h>
+#include <graphite/ITextSource.h>
+///#include <graphite/IGrJustifier.h>
+#include <graphite/IGrEngine.h>
+#include <graphite/SegmentAux.h>
+#include <graphite/Font.h>
+#include <graphite/Segment.h>
+#include <graphite/GraphiteProcess.h>
+#include <graphite/FileFont.h>
+
+#include "GrUtfTextSrc.h"
+
+typedef std::pair< gr::GlyphIterator, gr::GlyphIterator > GlyphRange;
+
+#ifndef HAVE_STRTOF
+float strtof(char * text, char ** ignore)
+{
+ return static_cast<float>(atof(text));
+}
+#endif
+
+#ifndef HAVE_STRTOL
+long strtol(char * text, char ** ignore)
+{
+ return atol(text);
+}
+#endif
+
+struct Parameters
+{
+ const char * textFile;
+ const char * fontFile;
+ float pointSize;
+ int dpi;
+ bool lineStart;
+ bool lineEnd;
+ bool useLineFill;
+ bool useCodes;
+ float width;
+ int textArgIndex;
+ gr::utf16 * pText16;
+ gr::utf32 * pText32;
+ size_t charLength;
+ size_t offset;
+};
+
+#ifdef HAVE_ICONV
+void
+convertUtf8ToUtf32(char* pText, Parameters & parameters)
+{
+ int length = strlen(reinterpret_cast<char*>(pText));
+ //gr::utf8 * pText = reinterpret_cast<gr::utf8*>(argv[2]);
+ // convert text to utf32 using iconv because its easier to debug string placements
+ size_t bytesLeft = length;
+ size_t outBytesLeft = (length + 1) * sizeof(gr::utf32);
+ size_t outBufferSize = outBytesLeft;
+ gr::utf32 * text32 = new gr::utf32[length + 1];
+ iconv_t utf8to32 = iconv_open("utf32","utf8");
+ assert(utf8to32 != (iconv_t)(-1));
+ char * pText32 = reinterpret_cast<char*>(&text32[0]);
+ size_t convertLength = iconv(utf8to32, &pText, &bytesLeft, &pText32, &outBytesLeft);
+ if (convertLength == size_t(-1)) perror("iconv failed:");
+ size_t charLength = (outBufferSize - outBytesLeft) / sizeof(gr::utf32);
+ assert(convertLength != size_t(-1));
+ // size_t offset = 0;
+ // offset by 1 to avoid bom
+ if (text32[0] == 0xfeff)
+ {
+ parameters.offset = 1;
+ charLength--;
+ }
+ std::cout << "String has " << charLength << " characters (" << length << " bytes)" << std::endl;
+ size_t ci;
+ for (ci = 0; ci < 10 && ci < charLength; ci++)
+ {
+ std::cout << std::setw(4) << ci << '\t';
+ }
+ std::cout << std::endl;
+ for (ci = 0; ci < charLength; ci++)
+ {
+ std::cout << std::setw(4) << std::hex
+ << text32[ci+parameters.offset] << '\t';
+ if (((ci + 1) % 10) == 0) std::cout << std::endl;
+ }
+ std::cout << std::endl;
+ parameters.charLength = charLength;
+ parameters.pText32 = text32;
+ iconv_close(utf8to32);
+}
+#endif
+
+bool parseArgs(int argc, char *argv[], Parameters & parameters)
+{
+ int mainArgOffset = 0;
+ bool argError = false;
+ char* pText = NULL;
+ typedef enum
+ {
+ NONE,
+ POINT_SIZE,
+ DPI,
+ LINE_START,
+ LINE_END,
+ LINE_FILL,
+ CODES
+ } TestOptions;
+ TestOptions option = NONE;
+ char * pIntEnd = NULL;
+ char * pFloatEnd = NULL;
+ long lTestSize = 0;
+ float fTestSize = 0.0f;
+ for (int a = 1; a < argc; a++)
+ {
+ switch (option)
+ {
+ case DPI:
+ pIntEnd = NULL;
+ lTestSize = strtol(argv[a],&pIntEnd, 10);
+ if (lTestSize > 0 && lTestSize < INT_MAX && lTestSize != LONG_MAX)
+ {
+ parameters.dpi = lTestSize;
+ }
+ else
+ {
+ fprintf(stderr,"Invalid dpi %s\n", argv[a]);
+ }
+ option = NONE;
+ break;
+ case POINT_SIZE:
+ pFloatEnd = NULL;
+ fTestSize = strtof(argv[a],&pFloatEnd);
+ // what is a reasonable maximum here
+ if (fTestSize > 0 && fTestSize < 5000.0f)
+ {
+ parameters.pointSize = fTestSize;
+ }
+ else
+ {
+ fprintf(stderr,"Invalid point size %s\n", argv[a]);
+ argError = true;
+ }
+ option = NONE;
+ break;
+ case LINE_FILL:
+ pFloatEnd = NULL;
+ fTestSize = strtof(argv[a],&pFloatEnd);
+ // what is a good max width?
+ if (fTestSize > 0 && fTestSize < 10000)
+ {
+ parameters.width = fTestSize;
+ }
+ else
+ {
+ fprintf(stderr,"Invalid line width %s\n", argv[a]);
+ argError = true;
+ }
+ option = NONE;
+ break;
+ default:
+ option = NONE;
+ if (argv[a][0] == '-')
+ {
+ if (strcmp(argv[a], "-pt") == 0)
+ {
+ option = POINT_SIZE;
+ }
+ else if (strcmp(argv[a], "-dpi") == 0)
+ {
+ option = DPI;
+ }
+ else if (strcmp(argv[a], "-ls") == 0)
+ {
+ option = NONE;
+ parameters.lineStart = true;
+ }
+ else if (strcmp(argv[a], "-le") == 0)
+ {
+ option = NONE;
+ parameters.lineEnd = true;
+ }
+ else if (strcmp(argv[a], "-linefill") == 0)
+ {
+ option = LINE_FILL;
+ parameters.useLineFill = true;
+ }
+ else if (strcmp(argv[a], "-codes") == 0)
+ {
+ option = NONE;
+ parameters.useCodes = true;
+ // must be less than argc
+ parameters.pText32 = new gr::utf32[argc];
+ printf("\nText codes\n");
+ }
+ else
+ {
+ argError = true;
+ fprintf(stderr,"Unknown option %s\n",argv[a]);
+ }
+ }
+ else if (mainArgOffset == 0)
+ {
+ parameters.textFile = argv[a];
+ mainArgOffset++;
+ }
+ else if (mainArgOffset == 1)
+ {
+ parameters.fontFile = argv[a];
+ mainArgOffset++;
+ }
+ else if (parameters.useCodes)
+ {
+ pIntEnd = NULL;
+ mainArgOffset++;
+ gr::utf32 code = strtol(argv[a],&pIntEnd, 16);
+ if (code > 0)
+ {
+ parameters.pText32[parameters.charLength++] = code;
+ if (parameters.charLength % 10 == 0)
+ printf("%4x\n",code);
+ else
+ printf("%4x\t",code);
+ }
+ else
+ {
+ fprintf(stderr,"Invalid dpi %s\n", argv[a]);
+ }
+ }
+ else if (mainArgOffset == 1)
+ {
+ mainArgOffset++;
+ pText = argv[a];
+ parameters.textArgIndex = a;
+ }
+ else
+ {
+ argError = true;
+ fprintf(stderr,"too many arguments %s\n",argv[a]);
+ }
+ }
+ }
+ if (mainArgOffset < 2) argError = true;
+ else
+ {
+ if (!parameters.useCodes && pText != NULL)
+ {
+#ifdef HAVE_ICONV
+ convertUtf8ToUtf32(pText, parameters);
+#else
+ fprintf(stderr,"Only the -codes option is supported on Win32\r\n");
+ argError = true;
+#endif
+ }
+ else
+ {
+ ///parameters.pText32[parameters.charLength] = 0;
+ printf("\n");
+ }
+ }
+ return (argError) ? false : true;
+}
+
+
+void initParameters(Parameters & parameters)
+{
+ parameters.textFile = "";
+ parameters.fontFile = "";
+ parameters.pointSize = 12.0f;
+ parameters.dpi = 72;
+ parameters.lineStart = false;
+ parameters.lineEnd = false;
+ parameters.useLineFill = false;
+ parameters.useCodes = false;
+ parameters.width = 100.0f;
+ parameters.pText16 = NULL;
+ parameters.pText32 = NULL;
+ parameters.textArgIndex = 0;
+ parameters.charLength = 0;
+ parameters.offset = 0;
+}
+
+
+
+int runGraphite(Parameters parameters)
+{
+ int returnCode = 0;
+ FILE * file = fopen(parameters.fontFile, "rb");
+ gr::FileFont * fileFont = NULL;
+
+ // Put the text into an array of string, each string is one paragraph.
+ std::ifstream textFileStrm(parameters.textFile);
+ std::cout << "FILE: " << parameters.textFile << "\n";
+ std::string stringArray[100];
+ + std::stringbuf buf; + textFileStrm >> &buf; + std::cout << "read " << buf.str().length() << " characters" << std::endl; + std::cout << "====BEGIN===" << buf.str() << "====END====" << std::endl; + const std::string strTemp = buf.str();
+ stringArray[0] = strTemp;
+ int cpara = 1;
+
+ try
+ {
+ if (file)
+ {
+ fileFont = new gr::FileFont(file, parameters.pointSize, parameters.dpi);
+ if (!fileFont || !fileFont->isValid())
+ {
+ fprintf(stderr,"graphitejni:Invalid font!");
+ delete fileFont;
+ fileFont = NULL;
+ return 2;
+ }
+ printf("Font: %s bold=%d italic=%d %4.1fpt dpi %d\n",
+ parameters.fontFile,
+ fileFont->bold(), fileFont->italic(),
+ parameters.pointSize, parameters.dpi);
+ bool isGraphite = fileFont->fontHasGraphiteTables();
+ if (!isGraphite)
+ {
+ fprintf(stderr,"graphitejni: %s does not have graphite tables",
+ parameters.fontFile);
+ delete fileFont;
+ fileFont = NULL;
+ return 3;
+ }
+ }
+ else
+ {
+ fprintf(stderr, "Failed to open %s\n", parameters.fontFile);
+ return 4;
+ }
+
+ for (int ipara = 0; ipara < cpara; ipara++)
+ {
+ GrUtfTextSrc textSrc;
+ gr::LayoutEnvironment layout;
+
+ textSrc.setText(stringArray[ipara].data(), stringArray[ipara].length());
+ textSrc.setPointSize(parameters.pointSize);
+ textSrc.setFont(fileFont);
+
+ layout.setStartOfLine(parameters.lineStart);
+ layout.setEndOfLine(parameters.lineEnd);
+ layout.setDumbFallback(true);
+ layout.setJustifier(NULL);
+
+ gr::Segment * pSegment = NULL;
+ //try
+ //{
+ if (parameters.useLineFill)
+ {
+ pSegment = new gr::LineFillSegment(fileFont, &textSrc, &layout,
+ 0, stringArray[ipara].length(),
+ parameters.width);
+ printf("LineFillSegment overing char %d - %d\nline start=%d line end=%d\n",
+ pSegment->startCharacter(), pSegment->stopCharacter(),
+ parameters.lineStart, parameters.lineEnd);
+ }
+ else
+ {
+ pSegment = new gr::RangeSegment(fileFont, &textSrc, &layout,
+ 0, stringArray[ipara].length());
+ printf("RangeSegment covering char %d - %d\nline start=%d line end=%d\n",
+ pSegment->startCharacter(), pSegment->stopCharacter(),
+ parameters.lineStart, parameters.lineEnd);
+ }
+ //}
+ //catch (...)
+ //{
+ // printf("Exception occurred while creating segment\n");
+ // returnCode = 5;
+ // throw;
+ //}
+
+ if (!pSegment) return returnCode;
+
+ // for justifier testing
+ /*
+ gr::GrJustifier justifier;
+ pSegment->SetJustifier(&justifier);
+ gr::Segment * justified = gr::Segment::JustifiedSegment(*pSegment, 2.0f * advanceWidth);
+ delete justified;
+ */
+
+ delete pSegment;
+ }
+ }
+ catch (...)
+ {
+ printf("Exception occurred\n");
+ returnCode = 5;
+ }
+
+ delete fileFont;
+
+ return returnCode;
+}
+
+#ifdef WIN32
+
+int _tmain(int argc, _TCHAR* argv[])
+{
+ Parameters parameters;
+ initParameters(parameters);
+
+ if (!parseArgs(argc, argv, parameters))
+ {
+ fprintf(stderr,"Usage: %s [options] textfile fontfile \n",argv[0]);
+ return 1;
+ }
+ // UTF16 arguments
+ //if (parameters.textArgIndex > 0)
+ //{
+ // parameters.pText16 = reinterpret_cast<wchar_t*>(argv[parameters.textArgIndex]);
+ // std::wstring text(parameters.pText16);
+ // parameters.charLength = text.size();
+ // for (int i = 0; i < text.size(); i++)
+ // {
+ // if (i % 10 == 0)
+ // printf("\r\n%4x", text[i]);
+ // else
+ // printf("\t%4x", text[i]);
+ // }
+ //}
+ //else
+ //{
+ // assert(parameters.pText32);
+ //}
+
+ return runGraphite(parameters);
+}
+
+#else
+
+int main(int argc, char *argv[])
+{
+
+ Parameters parameters;
+ initParameters(parameters);
+
+ if (!parseArgs(argc, argv, parameters))
+ {
+ fprintf(stderr,"Usage: %s [options] textfile fontfile \n",argv[0]);
+ return 1;
+ }
+ return runGraphite(parameters);
+}
+
+#endif
diff --git a/Build/source/libs/graphite-engine/test/ProfileHarness/makefile.vc b/Build/source/libs/graphite-engine/test/ProfileHarness/makefile.vc new file mode 100644 index 00000000000..dadff7cd363 --- /dev/null +++ b/Build/source/libs/graphite-engine/test/ProfileHarness/makefile.vc @@ -0,0 +1,111 @@ +!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE
+NULL=nul
+!ENDIF
+
+!IF "$(CFG)" == ""
+CFG=DEBUG
+!ENDIF
+
+!IF "$(CFG)" == "RELEASE"
+
+OUTDIR=.\release
+INTDIR=.\release_temp
+
+all : "$(OUTDIR)\ProfileHarness.exe"
+
+clean :
+ @- rd /s/q .\release_temp
+
+realclean : clean
+ @- rd /s/q .\release
+
+CPP_PROJ=/nologo /MT /W3 /GR /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /c
+LINK32_FLAGS=kernel32.lib user32.lib advapi32.lib shell32.lib uuid.lib graphite.lib /nologo /subsystem:console /incremental:no /machine:I386 /out:"$(OUTDIR)\ProfileHarness.exe" /libpath:"..\..\release"
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\ProfileHarness.bsc"
+
+!ELSEIF "$(CFG)" == "DEBUG"
+
+OUTDIR=.\debug
+INTDIR=.\debug_temp
+
+all : "$(OUTDIR)\ProfileHarness.exe" "$(OUTDIR)\ProfileHarness.bsc"
+
+clean :
+ @- rd /s/q .\debug_temp
+
+realclean : clean
+ @- rd /s/q .\debug
+
+CPP_PROJ=/nologo /MTd /W3 /Gm /GR /GX /GZ /ZI /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FR"$(INTDIR)\\" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /c
+LINK32_FLAGS=kernel32.lib user32.lib advapi32.lib shell32.lib uuid.lib graphite.lib /nologo /subsystem:console /incremental:yes /pdb:"$(OUTDIR)\ProfileHarness.pdb" /debug /machine:I386 /out:"$(OUTDIR)\ProfileHarness.exe" /libpath:"..\..\debug"
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\ProfileHarness.bsc"
+
+!ENDIF
+
+"$(OUTDIR)" :
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+"$(INTDIR)" :
+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
+
+.cpp{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+{$(APPLIB)}.cpp{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+{$(APPLIB)}.cpp{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+{$(TEXTSRCDIR)}.cpp{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+{$(TEXTSRCDIR)}.cpp{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+
+CPP=cl.exe
+RSC=rc.exe
+BSC32=bscmake.exe
+LINK32=link.exe
+
+LINK32_OBJS= \
+ "$(INTDIR)\ProfileHarness.obj" \
+ "$(INTDIR)\GrUtfTextSrc.obj" \
+
+"$(OUTDIR)\ProfileHarness.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+BSC32_SBRS= \
+ "$(INTDIR)\ProfileHarness.sbr" \
+ "$(INTDIR)\GrUtfTextSrc.sbr"
+
+"$(OUTDIR)\ProfileHarness.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+
+"$(INTDIR)\ProfileHarness.obj" "$(INTDIR)\ProfileHarness.sbr" : ".\ProfileHarness.cpp" "$(INTDIR)"
+"$(INTDIR)\GrTxtSrc.obj" "$(INTDIR)\GrUtfTextSrc.sbr" : ".\GrUtfTextSrc.cpp" "$(INTDIR)"
+
+
diff --git a/Build/source/libs/graphite-engine/test/RegressionTest/Makefile.am b/Build/source/libs/graphite-engine/test/RegressionTest/Makefile.am index 4d5c989e451..fe59b65fbaa 100644 --- a/Build/source/libs/graphite-engine/test/RegressionTest/Makefile.am +++ b/Build/source/libs/graphite-engine/test/RegressionTest/Makefile.am @@ -5,10 +5,15 @@ EXTRA_DIST = \ romanText.wpx \ xlineText.wpx \ grtest_arabic.ttf \ + grtest_badVersion.ttf \ + grtest_badCmap.ttf \ grtest_burmese.ttf \ grtest_roman.ttf \ - grtest_xline.ttf xline.gdl \ - Makefile.vc makedebug.bat \ + grtest_taiviet.ttf \ + grtest_xline.ttf \ + xline.gdl \ + Makefile.vc \ + makedebug.bat \ readme.txt noinst_PROGRAMS = regression-test diff --git a/Build/source/libs/graphite-engine/test/RegressionTest/Makefile.in b/Build/source/libs/graphite-engine/test/RegressionTest/Makefile.in index 0bd860db975..547e7dfa408 100644 --- a/Build/source/libs/graphite-engine/test/RegressionTest/Makefile.in +++ b/Build/source/libs/graphite-engine/test/RegressionTest/Makefile.in @@ -130,6 +130,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ REL_CODENAME = @REL_CODENAME@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZEOF_WCHAR_T = @SIZEOF_WCHAR_T@ @@ -188,10 +189,14 @@ EXTRA_DIST = \ romanText.wpx \ xlineText.wpx \ grtest_arabic.ttf \ + grtest_badVersion.ttf \ + grtest_badCmap.ttf \ grtest_burmese.ttf \ grtest_roman.ttf \ - grtest_xline.ttf xline.gdl \ - Makefile.vc makedebug.bat \ + grtest_xline.ttf \ + xline.gdl \ + Makefile.vc \ + makedebug.bat \ readme.txt AM_CPPFLAGS = -I$(top_srcdir)/include/graphite diff --git a/Build/source/libs/graphite-engine/test/RegressionTest/RegressionTest.cpp b/Build/source/libs/graphite-engine/test/RegressionTest/RegressionTest.cpp index 187437d7f3e..33c95da5683 100644 --- a/Build/source/libs/graphite-engine/test/RegressionTest/RegressionTest.cpp +++ b/Build/source/libs/graphite-engine/test/RegressionTest/RegressionTest.cpp @@ -13,12 +13,14 @@ Description: -------------------------------------------------------------------------------*//*:End Ignore*/
#include "main.h"
+#include "MemoryUsage.h"
//:>********************************************************************************************
//:> Global variables
//:>********************************************************************************************
std::ofstream g_strmLog; // log file output stream
std::ofstream g_strmTrace; // debugger trace for selected tests
+std::ofstream g_strmMemUsage;
int g_errorCount;
@@ -29,6 +31,9 @@ bool g_silentMode = false; int g_itcaseStart = 0; // adjust to skip to a certain test
+SegmentMemoryUsage g_smu;
+FontMemoryUsage g_fmu;
+
std::string g_fontPath = ".";
#ifdef _WIN32
#define PATH_SEP "\\"
@@ -119,6 +124,11 @@ int main(int argc, char* argv[]) // ::ReleaseDC(NULL, g_hdc);
+ // Output segment memory usage information.
+ //g_strmMemUsage.open("SegMemoryUsage.log");
+ //g_smu.prettyPrint(g_strmMemUsage);
+ //g_strmMemUsage.close();
+
return g_errorCount;
}
@@ -161,12 +171,22 @@ void RunTests(int numberOfTests, TestCase * ptcaseList) Run a single test case.
----------------------------------------------------------------------------------------------*/
int RunOneTestCase(TestCase * ptcase, Segment * psegPrev, Segment ** ppsegRet, RtTextSrc ** pptsrcRet)
-{
+{ +#ifdef _WIN32
+ if (ptcase->Skip())
+ {
+ std::cout << "\nskipped\n";
+ g_strmLog << "skipping\n";
+ *ppsegRet = NULL;
+ return 0;
+ }
+
// Break into the debugger if requested.
- //if (ptcase->RunDebugger() && ::IsDebuggerPresent())
- //{
- // ::DebugBreak();
- //}
+ if (ptcase->RunDebugger() && ::IsDebuggerPresent())
+ {
+ ::DebugBreak();
+ } +#endif
int errorCount = 0;
@@ -209,7 +229,7 @@ int RunOneTestCase(TestCase * ptcase, Segment * psegPrev, Segment ** ppsegRet, R // Generate a segment.
LayoutEnvironment layout;
- layout.setDumbFallback(true);
+ layout.setDumbFallback(ptcase->DumbFallback());
layout.setStartOfLine(true);
layout.setRightToLeft(ptcase->ParaRtl());
if (ptcase->InitWithPrevSeg())
@@ -241,9 +261,21 @@ int RunOneTestCase(TestCase * ptcase, Segment * psegPrev, Segment ** ppsegRet, R }
catch (...)
{
- OutputError(ptcase, "ERROR: generating segment; remaining tests skipped");
+ if (!ptcase->NoSegment())
+ {
+ if (ptcase->BadFont() && !ptcase->DumbFallback())
+ // Weird situation.
+ OutputError(ptcase, "ERROR: bad font with no fallback, yet a segment was expected???");
+ else
+ OutputError(ptcase, "ERROR: generating segment; remaining tests skipped");
+ errorCount++;
+ }
+ // else segment creation failed as expected
+
+ // NB: failure to create a segment due to throwing an exception seems to result in a memory
+ // leak--the FontCache object FontFace::s_pFontCache does not get deleted.
+
*ppsegRet = NULL;
- errorCount++;
return WriteLog(errorCount);
}
@@ -253,7 +285,7 @@ int RunOneTestCase(TestCase * ptcase, Segment * psegPrev, Segment ** ppsegRet, R g_strmTrace.close();
}
- if ((*ppsegRet)->segmentTermination() == kestNothingFit)
+ if ((*ppsegRet) && (*ppsegRet)->segmentTermination() == kestNothingFit)
{
delete *ppsegRet;
*ppsegRet = NULL;
@@ -279,6 +311,14 @@ int RunOneTestCase(TestCase * ptcase, Segment * psegPrev, Segment ** ppsegRet, R Segment * pseg = *ppsegRet;
+ pseg->calculateMemoryUsage(g_smu);
+
+ // Calculate and output font memory usage.
+ //g_fmu = Font::calculateMemoryUsage();
+ //g_strmMemUsage.open("fontMemoryUsage.log");
+ //g_fmu.prettyPrint(g_strmMemUsage);
+ //g_strmMemUsage.close();
+
// Test results.
int segMin = pseg->startCharacter();
int segLim = pseg->stopCharacter();
@@ -336,6 +376,34 @@ int RunOneTestCase(TestCase * ptcase, Segment * psegPrev, Segment ** ppsegRet, R int((*gitThis).advanceWidth()), ptcase->AdvWidth(iglyph));
errorCount++;
}
+ if (ptcase->BbTests())
+ {
+ gr::Rect rectBb = (*gitThis).bb();
+ if (int(rectBb.left) != ptcase->BbLeft(iglyph))
+ {
+ OutputErrorWithValues(ptcase, "ERROR: bb left ", iglyph,
+ int(rectBb.left), ptcase->BbLeft(iglyph));
+ errorCount++;
+ }
+ if (int(rectBb.right) != ptcase->BbRight(iglyph))
+ {
+ OutputErrorWithValues(ptcase, "ERROR: bb right ", iglyph,
+ int(rectBb.right), ptcase->BbRight(iglyph));
+ errorCount++;
+ }
+ if (int(rectBb.top) != ptcase->BbTop(iglyph))
+ {
+ OutputErrorWithValues(ptcase, "ERROR: bb top ", iglyph,
+ int(rectBb.top), ptcase->BbTop(iglyph));
+ errorCount++;
+ }
+ if (int(rectBb.bottom) != ptcase->BbBottom(iglyph))
+ {
+ OutputErrorWithValues(ptcase, "ERROR: bb bottom ", iglyph,
+ int(rectBb.bottom), ptcase->BbBottom(iglyph));
+ errorCount++;
+ }
+ }
}
}
@@ -356,9 +424,91 @@ int RunOneTestCase(TestCase * ptcase, Segment * psegPrev, Segment ** ppsegRet, R }
}
+ int c2gi = 0;
+ while (c2gi < ptcase->CharToGlyphCount())
+ {
+ int ichar = ptcase->CharToGlyphItem(c2gi++);
+ int glyphCount = ptcase->CharToGlyphItem(c2gi++);
+ std::pair<gr::GlyphSetIterator, gr::GlyphSetIterator> glyphSet = pseg->charToGlyphs(ichar);
+ gr::GlyphSetIterator gitStart = glyphSet.first;
+ gr::GlyphSetIterator gitStop = glyphSet.second;
+ if ((gitStop - gitStart) != glyphCount)
+ {
+ OutputErrorWithValues(ptcase, "ERROR: number of glyphs for char ", ichar,
+ gitStop - gitStart, glyphCount);
+ errorCount++;
+ c2gi += glyphCount;
+ }
+ else
+ {
+ GlyphSetIterator glyphLp = glyphSet.first;
+ for (int ig = 0; ig < glyphCount; ig++)
+ {
+ if (static_cast<int>((*glyphLp).logicalIndex()) != ptcase->CharToGlyphItem(c2gi))
+ {
+ OutputErrorWithValues(ptcase, "ERROR: glyph for char ", ichar,
+ (*glyphLp).logicalIndex(), ptcase->CharToGlyphItem(c2gi));
+ errorCount++;
+ }
+ c2gi++;
+ glyphLp++;
+ }
+ }
+ }
+
+ int att = 0;
+ while (att < ptcase->AttachedGlyphCount())
+ {
+ int iglyph = ptcase->AttachedGlyphItem(att++);
+ if (iglyph > cGlyphs)
+ {
+ OutputError(ptcase, "ERROR: non-existent glyph in attachment test ", iglyph);
+ errorCount++;
+ att++;
+ att += ptcase->AttachedGlyphItem(att) + 1;
+ continue;
+ }
+
+ GlyphIterator gitThis = gitBegin + iglyph;
+ GlyphIterator gitBase = gitThis->attachedClusterBase();
+ int ibase = gitBase->logicalIndex();
+ if (ibase != ptcase->AttachedGlyphItem(att))
+ {
+ OutputErrorWithValues(ptcase, "ERROR: attachment base for glyph ", iglyph,
+ ibase, ptcase->AttachedGlyphItem(att));
+ errorCount++;
+ }
+ att++;
+ std::pair<gr::GlyphSetIterator, gr::GlyphSetIterator> glyphSet = gitThis->attachedClusterGlyphs();
+ gr::GlyphSetIterator gitStart = glyphSet.first;
+ gr::GlyphSetIterator gitStop = glyphSet.second;
+ int glyphCount = ptcase->AttachedGlyphItem(att++);
+ if ((gitStop - gitStart) != glyphCount)
+ {
+ OutputErrorWithValues(ptcase, "ERROR: number of attachments for glyph ", iglyph,
+ gitStop - gitStart, glyphCount);
+ errorCount++;
+ att += glyphCount;
+ }
+ else
+ {
+ GlyphSetIterator glyphLp = glyphSet.first;
+ for (int ig = 0; ig < glyphCount; ig++)
+ {
+ if (static_cast<int>((*glyphLp).logicalIndex()) != ptcase->AttachedGlyphItem(att))
+ {
+ OutputErrorWithValues(ptcase, "ERROR: attachment for glyph ", iglyph,
+ (*glyphLp).logicalIndex(), ptcase->AttachedGlyphItem(att));
+ errorCount++;
+ }
+ att++;
+ glyphLp++;
+ }
+ }
+ }
+
for (int iclicktest = 0; iclicktest < ptcase->NumberOfClickTests(); iclicktest++)
{
-// POINT ptClick;
gr::Point ptClick;
ptClick.x = static_cast<float>(ptcase->XClick(iclicktest));
ptClick.y = static_cast<float>(ptcase->YClick(iclicktest));
diff --git a/Build/source/libs/graphite-engine/test/RegressionTest/TestCase.cpp b/Build/source/libs/graphite-engine/test/RegressionTest/TestCase.cpp index a0068672bb5..080d2f92dcd 100644 --- a/Build/source/libs/graphite-engine/test/RegressionTest/TestCase.cpp +++ b/Build/source/libs/graphite-engine/test/RegressionTest/TestCase.cpp @@ -19,7 +19,7 @@ How to add a test: and data.
Things that still need testing:
- Ligatures
+ Ligatures (there is one small test of this)
Justification
Fake italic
-------------------------------------------------------------------------------*//*:End Ignore*/
@@ -30,7 +30,7 @@ Things that still need testing: //:> Test constants and methods
//:>********************************************************************************************
-const int g_numberOfTests = 17; // *** increment as tests are added ***
+const int g_numberOfTests = 23; // *** increment as tests are added ***
TestCase * g_ptcaseList; // list of test cases
@@ -45,27 +45,36 @@ typedef unsigned char byte; int TestCase::SetupTests(TestCase ** pptcaseList)
{
g_ptcaseList = new TestCase[g_numberOfTests];
+ int cptcase = 0;
// The number of methods called here should equal g_numberOfTests above.
- g_ptcaseList[0].SetupSimpleTest();
- g_ptcaseList[1].SetupSimpleBacktrackTest();
- g_ptcaseList[2].SetupBurmese1();
- g_ptcaseList[3].SetupBurmese2();
- g_ptcaseList[4].SetupBurmese3();
- g_ptcaseList[5].SetupBurmese4();
- g_ptcaseList[6].SetupRoman();
- g_ptcaseList[7].SetupRomanFeatures();
- g_ptcaseList[8].SetupNoWhiteSpace();
- g_ptcaseList[9].SetupNoWhiteSpaceFailure();
- g_ptcaseList[10].SetupOnlyWhiteSpace();
- g_ptcaseList[11].SetupCrossLine1();
- g_ptcaseList[12].SetupCrossLine2();
- g_ptcaseList[13].SetupCrossLine3();
- g_ptcaseList[14].SetupCrossLine4();
- g_ptcaseList[15].SetupArabic1();
- g_ptcaseList[16].SetupArabic2();
+ g_ptcaseList[0].SetupSimpleTest(); cptcase++;
+ g_ptcaseList[1].SetupSimpleBacktrackTest(); cptcase++;
+ g_ptcaseList[2].SetupBurmese1(); cptcase++;
+ g_ptcaseList[3].SetupBurmese2(); cptcase++;
+ g_ptcaseList[4].SetupBurmese3(); cptcase++;
+ g_ptcaseList[5].SetupBurmese4(); cptcase++;
+ g_ptcaseList[6].SetupRoman(); cptcase++;
+ g_ptcaseList[7].SetupRomanFeatures(); cptcase++;
+ g_ptcaseList[8].SetupStackingAndBridging(); cptcase++;
+ g_ptcaseList[9].SetupNoWhiteSpace(); cptcase++;
+ g_ptcaseList[10].SetupNoWhiteSpaceNoSeg(); cptcase++;
+ g_ptcaseList[11].SetupOnlyWhiteSpace(); cptcase++;
+ g_ptcaseList[12].SetupCrossLine1(); cptcase++;
+ g_ptcaseList[13].SetupCrossLine2(); cptcase++;
+ g_ptcaseList[14].SetupCrossLine3(); cptcase++;
+ g_ptcaseList[15].SetupCrossLine4(); cptcase++;
+ g_ptcaseList[16].SetupArabic1(); cptcase++;
+ g_ptcaseList[17].SetupArabic2(); cptcase++;
+ g_ptcaseList[18].SetupTaiViet1(); cptcase++;
+ g_ptcaseList[19].SetupTaiViet2(); cptcase++;
+ g_ptcaseList[20].SetupDumbFallback1(); cptcase++;
+ g_ptcaseList[21].SetupDumbFallback2(); cptcase++;
+ g_ptcaseList[22].SetupBadFont(); cptcase++;
// *** Add more method calls here. ***
+ assert(cptcase == g_numberOfTests);
+
*pptcaseList = g_ptcaseList;
return g_numberOfTests;
@@ -77,8 +86,9 @@ int TestCase::SetupTests(TestCase ** pptcaseList) void TestCase::SetupSimpleTest()
{
m_testName = "Simple";
- m_debug = false;
- m_traceLog = false;
+ //m_debug = true;
+ //m_traceLog = false;
+ //m_skip = true;
// Input:
m_fontName = L"Graphite Test Roman";
@@ -106,20 +116,31 @@ void TestCase::SetupSimpleTest() const int glyphCnt = 15; // number of glyphs in the segment
// need glyphCnt elements in these arrays:
- gid16 glyphList[] = {55, 77, 78, 90, 3, 78, 90, 3, 68, 3, 91, 73, 90, 91, 17};
+ gid16 glyphList[] = {55, 75, 76, 86, 3, 76, 86, 3, 68, 3, 87, 72, 86, 87, 17};
int xPositions[] = { 0, 9, 17, 22, 28, 33, 37, 43, 48, 55, 60, 64, 71, 77, 82};
int yPositions[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int advWidths[] = { 9, 8, 4, 6, 4, 4, 6, 4, 7, 4, 4, 7, 6, 4, 4};
+ int bbLefts[] = { 0, 9, 18, 22, 28, 33, 38, 43, 48, 55, 60, 65, 72, 78, 83};
+ int bbRights[] = { 9, 17, 21, 27, 33, 37, 43, 48, 55, 60, 64, 71, 77, 82, 85};
+ int bbTops[] = {10, 11, 10, 7, 0, 10, 7, 0, 7, 0, 9, 7, 7, 9, 1};
+ int bbBottoms[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+
+ int charsToGlyphs[] = {
+ 1, 1, 1, 2, 1, 2, 3, 1, 3, 4, 1, 4, 5, 1, 5, 6, 1, 6, 7, 1, 7
+ };
+ int c2gCount = 21;
+
// Each line in clickStuff represents one click test with the following items:
// click x-coord, click y-coord, char index, assoc-prev,
// prim sel Top, prim sel bottom, prim sel left,
- // sec sel Top, sec sel bottom, sec sel left,
+ // sec sel Top, sec sel bottom, sec sel left
+ // Y-coordinates are offsets from segment top; ie, (0,0) is segment top-left.
const int clickTestCnt = 3;
int clickStuff[] = {
- 11, 25, 1, false, 0, 24, 8, kAbsent, kAbsent, kAbsent,
- 42, 5, 7, true, 0, 24, 42, kAbsent, kAbsent, kAbsent,
- 90, 40, 15, true, 0, 24, 85, kAbsent, kAbsent, kAbsent
+ 11, 25, 1, false, 0, 24, 8, kAbsent, kAbsent, kAbsent, // below baseline
+ 42, 5, 7, true, 0, 24, 42, kAbsent, kAbsent, kAbsent, // near top of text
+ 90, 16, 15, true, 0, 24, 85, kAbsent, kAbsent, kAbsent // near baseline
};
// Finish setting up test case.
@@ -129,7 +150,9 @@ void TestCase::SetupSimpleTest() SetXPositions(xPositions);
SetYPositions(yPositions);
SetAdvWidths(advWidths);
+ SetBBs(bbLefts, bbRights, bbTops, bbBottoms);
SetInsPtFlags(insPtFlags);
+ SetCharsToGlyphs(charsToGlyphs, c2gCount);
SetClickTests(clickTestCnt, clickStuff);
}
@@ -139,6 +162,7 @@ void TestCase::SetupSimpleTest() void TestCase::SetupSimpleBacktrackTest()
{
m_testName = "Simple Backtrack";
+ //m_skip = true;
// Input:
m_fontName = L"Graphite Test Roman";
@@ -165,7 +189,7 @@ void TestCase::SetupSimpleBacktrackTest() const int glyphCnt = 10; // number of glyphs in the segment
// need glyphCnt elements in these arrays:
- gid16 glyphList[] = {55, 77, 78, 90, 3, 78, 90, 3, 68, 3};
+ gid16 glyphList[] = {55, 75, 76, 86, 3, 76, 86, 3, 68, 3};
int xPositions[] = { 0, 9, 17, 22, 28, 33, 37, 43, 48, 55};
int yPositions[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int advWidths[] = { 9, 8, 4, 6, 4, 4, 6, 4, 7, 4};
@@ -180,6 +204,7 @@ void TestCase::SetupSimpleBacktrackTest() SetXPositions(xPositions);
SetYPositions(yPositions);
SetAdvWidths(advWidths);
+ SetBBs(NULL, NULL, NULL, NULL);
SetInsPtFlags(insPtFlags);
SetOutputContextBlock(contextBlockOutSize, contextBlockOut);
}
@@ -192,7 +217,8 @@ void TestCase::SetupBurmese1() {
m_testName = "Burmese 1";
m_debug = false;
- m_traceLog = false;
+ //m_traceLog = true;
+ //m_skip = true;
// Input:
m_fontName = L"Graphite Test Burmese";
@@ -213,6 +239,16 @@ void TestCase::SetupBurmese1() 45, // glyph count
5); // number of click-tests
+ // Each group = glyph-index, base, number of attached, glyphs, attached-glyph-indices
+ int attachments[] = {
+ 0,0,0, 1,1,0, 2,2,2,3,4, 3,2,0, 4,2,0, 5,5,1,6, 6,5,0, 7,7,3,8,9,10,
+ 8,7,0, 9,7,0, 10,7,0, 11,11,0, 12,12,0, 13,13,0, 14,14,0, 15,15,0,
+ 16,16,1,17, 17,16,0, 18,18,1,19, 19,18,0, 20,20,1,21, 21,20,0, 22,22,1,23,
+ 23,22,0, 24,24,0, 25,25,0
+ };
+ int attCount = sizeof(attachments) / sizeof(int);
+ SetAttachedClusters(attachments, attCount);
+
const int contextBlockOutSize = 11;
gr::byte contextBlockOut[] = { 20, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
SetOutputContextBlock(contextBlockOutSize, contextBlockOut);
@@ -221,6 +257,9 @@ void TestCase::SetupBurmese1() void TestCase::SetupBurmese2()
{
m_testName = "Burmese 2";
+ //m_debug = true;
+ //m_traceLog = true;
+ //m_skip = true;
// Input:
m_fontName = L"Graphite Test Burmese";
@@ -251,6 +290,8 @@ void TestCase::SetupBurmese3() {
m_testName = "Burmese 3";
//m_debug = true;
+ //m_traceLog = true;
+ //m_skip = true;
// Input:
m_fontName = L"Graphite Test Burmese";
@@ -282,6 +323,7 @@ void TestCase::SetupBurmese4() m_testName = "Burmese 4";
//m_traceLog = true;
//m_debug = true;
+ //m_skip = true;
// Input:
m_fontName = L"Graphite Test Burmese";
@@ -328,10 +370,23 @@ void TestCase::SetupBurmeseAux(int charCnt, int glyphCnt, int clickTestCnt) int yPositions[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int advWidths[] = { 17, 2, 9, 4, 0, 10, 0, 17, 2, 0, 0, 15, 6, 10, 10, 2, 7, 0, 10, 9, 9, 0, 10, 7, 2, 6, 17, 7, 17, 7, 6, 10, 6, 10, 2, 10, 7, 10, 7, 9, 4, 9, 0, 0, 6};
+ int bbLefts[] = { 0, 10, 21, 23, 23, 30, 33, 41, 51, 49, 53, 58, 73, 80, 90, 96,100,103,111,109,121,123,131,132,141,143,150,165,175,189,198,206,215,223,233,235,243,253,254,263,265,272,275,275,281};
+ int bbRights[] = { 16, 19, 28, 25, 28, 39, 38, 56, 54, 55, 56, 72, 79, 88, 98,101,109,109,119,119,129,129,139,138,142,149,166,173,190,197,205,214,222,231,244,244,251,261,260,271,267,280,280,278,288};
+ int bbTops[] = { 7, 7, 7, -1, 15, 7, 15, 7, -1, 15, -2, 15, 0, 7, 7, 7, 7, 15, 7, -1, 7, 15, 7, -1, 7, 0, 7, 7, 7, 7, 0, 7, 0, 7, 16, 7, 7, 7, -1, 7, -1, 7, 15, -2, 0};
+ int bbBottoms[] = { 0, -7, -1, -7, 9, 0, 9, 0, -7, 9, -5, 0, 0, 0, 0, -7, 0, 9, -4, -7, 0, 9, 0, -7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -7, 0, 0, 0, -7, -1, -7, 0, 9, -5, 0};
+
+ // Each group = char-index, number of glyphs, glyph-indices.
+ int charsToGlyphs[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1, 1, 3, 1, 1, 4, 1, 1, 5, 1, 2, 6, 1, 3, 7, 1, 3,
+ 8, 1, 4, 9, 1, 4, 10, 1, 5, 11, 1, 6, 12, 1, 6, 13, 1, 7
+ };
+ int c2gCount = sizeof(charsToGlyphs) / sizeof(int);
+
// Each line in clickStuff represents one click test with the following items:
// click x-coord, click y-coord, char index, assoc-prev,
// prim sel Top, prim sel bottom, prim sel left,
- // sec sel Top, sec sel bottom, sec sel left,
+ // sec sel Top, sec sel bottom, sec sel left
+ // Y-coordinates are offsets from segment top; ie, (0,0) is segment top-left.
int clickStuff[] = {
10, 25, 1, true, 0, 25, 16, kAbsent, kAbsent, kAbsent,
40, 5, 13, false, 0, 25, 39, kAbsent, kAbsent, kAbsent,
@@ -347,6 +402,8 @@ void TestCase::SetupBurmeseAux(int charCnt, int glyphCnt, int clickTestCnt) SetXPositions(xPositions);
SetYPositions(yPositions);
SetAdvWidths(advWidths);
+ SetCharsToGlyphs(charsToGlyphs, c2gCount);
+ SetBBs(bbLefts, bbRights, bbTops, bbBottoms);
SetInsPtFlags(insPtFlags);
SetClickTests(clickTestCnt, clickStuff);
}
@@ -380,6 +437,7 @@ void TestCase::SetupRoman() m_testName = "Roman";
//m_traceLog = true;
//m_debug = true;
+ //m_skip = true;
// Input:
m_fontName = L"Graphite Test Roman";
@@ -394,35 +452,47 @@ void TestCase::SetupRoman() m_backtrack = false;
// Output:
- m_segWidth = 236; // physical width of segment
+ m_segWidth = 278; // physical width of segment
- const int charCnt = 23; // number of characters in the segment
+ const int charCnt = 26; // number of characters in the segment
// need charCnt elements in this array:
bool insPtFlags[] = {
- true, false, false, true, true, true, true, false, false, true,
- true, true, false, false, true, false, true, false, true, false,
- false, false, false
+ true, true, true, true, true, true, true, true, true, true,
+ true, true, true, true, true, true, true, true, true, true,
+ true, true, true, true, true, true
};
- const int glyphCnt = 21; // number of glyphs in the segment
+ const int glyphCnt = 24; // number of glyphs in the segment
// need glyphCnt elements in these arrays:
- // 0 10 20
- gid16 glyphList[] = {73,752,749, 87,833, 90, 75,2181,296, 68,751,750, 79,752, 44,752, 84,806,749,759,753};
- int xPositions[] = { 0, 23, 23, 21, 41, 45, 64, 88,116,148,170,170,169,188,183,203,199,229,229,229,229};
- int yPositions[] = { 0, 0, 10, 0, -6, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0, 10, 20};
- int advWidths[] = {21, 0, 0, 24, 0, 18, 24, 28, 31, 21, 0, 0, 13, 0, 15, 0, 37, 0, 0, 0, 0};
+ // 0 10 20
+ gid16 glyphList[] = {72,1815,1768, 83,1789, 86, 74,1943,1956,1926,1061, 68,1777,1755,805,1815, 44,1815, 80,1833,1768,1855,1838,637};
+ int xPositions[] = { 0, 23, 23, 21, 41, 45, 64, 88, 98, 112, 116,148, 171, 171,170, 188,183, 203, 199, 230, 230, 230, 230,236};
+ int yPositions[] = { 0, 0, 10, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0, 10, 20, 0};
+ int advWidths[] = {21, 0, 0, 24, 0, 18, 24, 13, 13, 4, 31, 21, 0, 0, 13, 0, 15, 0, 37, 0, 0, 0, 0, 41};
+
+ // Each group = glyph-index, base, number of attached, glyphs, attached-glyph-indices
+ int attachments[] = {
+ 0,0,2,1,2, 1,0,0, 2,0,0, 3,3,0, 4,4,0, 5,5,0, 6,6,0, 7,7,2,8,9,
+ 8,7,0, 9,7,0, 10,10,0, 11,11,2,12,13, 12,11,0, 13,11,0, 14,14,1,15, 15,14,0,
+ 16,16,1,17, 17,16,0, 18,18,4,19,20,21,22, 19,18,0, 20,18,0, 21,18,0, 22,18,0,
+ 23,23,0
+ };
+ int attCount = sizeof(attachments) / sizeof(int);
// Each line in clickStuff represents one click test with the following items:
// click x-coord, click y-coord, char index, assoc-prev,
// prim sel Top, prim sel bottom, prim sel left,
- // sec sel Top, sec sel bottom, sec sel left,
- const int clickTestCnt = 3;
+ // sec sel Top, sec sel bottom, sec sel left
+ // Y-coordinates are offsets from segment top; ie, (0,0) is segment top-left.
+ const int clickTestCnt = 5;
int clickStuff[] = {
- 10, 15, 3, true, 0, 72, 20, kAbsent, kAbsent, kAbsent,
+ 10, 15, 2, false, 9, 21, 1, 20, 30, 18,
61, 50, 6, true, 0, 72, 63, kAbsent, kAbsent, kAbsent,
- 90, 40, 9, false, 0, 72, 87, kAbsent, kAbsent, kAbsent
+ 90, 40, 7, false, 0, 72, 87, kAbsent, kAbsent, kAbsent,
+ 260, 40, 25, true, 0, 73,263, kAbsent, kAbsent, kAbsent, // ligature
+ 267, 40, 25, false, 0, 73,263, kAbsent, kAbsent, kAbsent, // ligature
};
// Finish setting up test case.
@@ -432,6 +502,8 @@ void TestCase::SetupRoman() SetXPositions(xPositions);
SetYPositions(yPositions);
SetAdvWidths(advWidths);
+ SetBBs(NULL, NULL, NULL, NULL);
+ SetAttachedClusters(attachments, attCount);
SetInsPtFlags(insPtFlags);
SetClickTests(clickTestCnt, clickStuff);
}
@@ -441,6 +513,7 @@ void TestCase::SetupRomanFeatures() m_testName = "Roman Features";
//m_traceLog = true;
//m_debug = true;
+ //m_skip = true;
// Input:
m_fontName = L"Graphite Test Roman";
@@ -459,33 +532,35 @@ void TestCase::SetupRomanFeatures() m_fset[2].id = 1029; m_fset[2].value = 1; // vietnamese diacritics
m_fset[3].id = 1032; m_fset[3].value = 1; // literacy alternates
m_fset[4].id = 1034; m_fset[4].value = 1; // y-hook alternate (default)
- m_fset[5].id = 0;
+ m_fset[5].id = 1051; m_fset[5].value = 0; // diacritic selection
+ m_fset[6].id = 0;
// Output:
- m_segWidth = 265; // physical width of segment
+ m_segWidth = 307; // physical width of segment
- const int charCnt = 23; // number of characters in the segment
+ const int charCnt = 26; // number of characters in the segment
// need charCnt elements in this array:
bool insPtFlags[] = {
true, false, false, true, true, true, true, true, true, true,
true, true, false, false, true, false, true, false, true, false,
- false, false, false
+ false, false, false, true, true, true
};
- const int glyphCnt = 22; // number of glyphs in the segment
+ const int glyphCnt = 23; // number of glyphs in the segment
// need glyphCnt elements in these arrays:
- // 0 10 20
- gid16 glyphList[] = {73,752,749, 87,833, 90, 76,1581,128,122,298, 69,1964, 79,752, 44,752, 84,806,749,759,753};
- int xPositions[] = { 0, 23, 23, 21, 41, 45, 64, 87,104,121,138,173, 174,198,217,211,231,227,258,258,258,258};
- int yPositions[] = { 0, 0, 10, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 10, 20};
- int advWidths[] = {21, 0, 0, 24, 0, 18, 23, 17, 17, 17, 34, 24, 24, 13, 0, 15, 0, 37, 0, 0, 0, 0};
+ // 0 10 20
+ gid16 glyphList[] = {72,1815,1768, 83,1789, 86,681,1659,1667,1662,1056,274,1778, 805,1815, 44,1815, 80,1833,1768,1855,1838,637};
+ int xPositions[] = { 0, 23, 23, 21, 41, 45, 64, 87, 104, 121, 138,173, 174, 198, 217, 211, 231, 227, 258, 258, 258, 258,265};
+ int yPositions[] = { 0, 0, 10, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 10, 20, 0};
+ int advWidths[] = {21, 0, 0, 24, 0, 18, 23, 17, 17, 17, 34, 24, 24, 13, 0, 15, 0, 37, 0, 0, 0, 0, 41};
// Each line in clickStuff represents one click test with the following items:
// click x-coord, click y-coord, char index, assoc-prev,
// prim sel Top, prim sel bottom, prim sel left,
- // sec sel Top, sec sel bottom, sec sel left,
+ // sec sel Top, sec sel bottom, sec sel left
+ // Y-coordinates are offsets from segment top; ie, (0,0) is segment top-left.
const int clickTestCnt = 3;
int clickStuff[] = {
10, 15, 3, true, 0, 72, 20, kAbsent, kAbsent, kAbsent,
@@ -500,6 +575,7 @@ void TestCase::SetupRomanFeatures() SetXPositions(xPositions);
SetYPositions(yPositions);
SetAdvWidths(advWidths);
+ SetBBs(NULL, NULL, NULL, NULL);
SetInsPtFlags(insPtFlags);
SetClickTests(clickTestCnt, clickStuff);
}
@@ -510,18 +586,122 @@ std::wstring TestCase::RomanText() wchar_t charData[] = {
0x0065, 0x0303, 0x0300, 0x0070, 0x0361, 0x0073, 0x0067, 0x02e8, 0x02e5, 0x02e7,
0x014a, 0x0061, 0x0302, 0x0301, 0x0069, 0x0303, 0x0049, 0x0303, 0x006d, 0x033c,
- 0x0300, 0x0308, 0x0304, 0x0000
+ 0x0300, 0x0308, 0x0304, 0x0066, 0x0066, 0x0069, 0x0000
};
strRet.assign(charData);
return strRet;
}
/*----------------------------------------------------------------------------------------------
+ A set of tests for handling complex diacritic stacking and bridging.
+----------------------------------------------------------------------------------------------*/
+void TestCase::SetupStackingAndBridging()
+{
+ m_testName = "Roman Stacking and Bridging";
+ //m_traceLog = true;
+ //m_debug = true;
+ //m_skip = true;
+
+ // Input:
+ m_fontName = L"Graphite Test Roman";
+ m_fontFile = "grtest_roman.ttf";
+ m_fontSize = 36; // font size in points
+ m_prefBreak = klbWordBreak; // preferred break-weight
+ m_availWidth = 500; // width available for segment
+ m_bold = false;
+ m_italic = false;
+ m_rtl = false;
+ m_backtrack = false;
+
+ // text to render
+ wchar_t charData[] = {
+ 0x0061,0x035d,0x0061,0x0020,0x0074,0x035d,0x0061,0x0020,0x0061,0x0300,
+ 0x0300,0x035d,0x0061,0x0020,0x0283,0x0300,0x0300,0x035d,0x0061,0x0020,
+ 0x0061,0x0316,0x0316,0xf176,0x0061,0x0020,0x0283,0x0300,0x0300,0xf176,
+ 0x0061,0x0020,0x0061,0x0316,0x0316,0xf176,0x0061,0x0020,0x0283,0x035d,
+ 0xf176,0x0061,0x0000
+ };
+ m_text.assign(charData);
+
+ // Output:
+ m_segWidth = 414; // physical width of segment
+
+ const int charCnt = 42; // number of characters in the segment
+
+ // need charCnt elements in this array:
+ bool insPtFlags[] = {
+ true, true, true, true, true, true, true, true, true, true,
+ true, true, true, true, true, true, true, true, true, true,
+ true, true, true, true, true, true, true, true, true, true,
+ true, true, true, true, true, true, true, true, true, true,
+ true, true,
+ };
+
+ const int glyphCnt = 42; // number of glyphs in the segment
+
+ // 68 = a, 97 = t, 1305 = esh, 1768 = upper grave, 1765 = lower grave, 1802 = upper bridge,
+ // 1801 = lower bridge
+
+ // need glyphCnt elements in these arrays:
+ // 0 10 20 30 40
+ gid16 glyphList[] = {68,1802, 68, 3, 87,1802, 68, 3, 68,1768,1768,1802, 68, 3,1305,1768,1768,1802, 68, 3, 68,1765,1765,1801, 68, 3,1305,1768,1768,1801, 68, 3, 68,1765,1765,1801, 68, 3,1305,1802,1801, 68};
+ int xPositions[] = { 0, 21, 21, 42, 56, 73, 69, 91, 105, 127, 127, 126, 126,147, 161, 181, 181, 178,177,199,212, 235, 235, 234,234,255, 269, 289, 289, 286,285,307,320, 343, 343, 342,342,363, 377, 393, 393,393};
+ int yPositions[] = { 0, -7, 0, 0, 0, -1, 0, 0, 0, 0, 10, 12, 0, 0, 0, 10, 20, 23, 0, 0, 0, 0, -9, -17, 0, 0, 0, 10, 20, -6, 0, 0, 0, 0, -9, -17, 0, 0, 0, 3, -6, 0};
+ int advWidths[] = {21, 0, 21, 13, 13, 0, 21, 13, 21, 0, 0, 0, 21, 13, 16, 0, 0, 0, 21, 13, 21, 0, 0, 0, 21, 13, 16, 0, 0, 0, 21, 13, 21, 0, 0, 0, 21, 13, 16, 0, 0, 21};
+
+ int bbLefts[] = { 1, 0, 23, 42, 56, 52, 71, 91, 106, 108, 108, 105, 128,147, 159, 162, 162, 157,179,199,214, 217, 217, 213,235,255, 267, 270, 270, 265,287,307,322, 325, 325, 321,343,363, 375, 373, 373,395};
+ int bbRights[] = {21, 41, 42, 56, 69, 93, 91,105, 126, 119, 119, 146, 147,161, 178, 173, 173, 198,199,212,234, 228, 228, 254,255,269, 286, 281, 281, 306,306,320,342, 336, 336, 362,363,377, 394, 413, 414,414};
+ int bbTops [] = {22, 33, 22, 0, 28, 40, 22, 0, 22, 32, 42, 54, 22, 0, 33, 42, 53, 64, 22, 0, 22, -3, -13, -26, 22, 0, 33, 42, 53, -15, 22, 0, 22, -3, -13, -26, 22, 0, 33, 44, -15, 22};
+ int bbBottoms [] = { 0, 26, 0, 0, 0, 33, 0, 0, 0, 24, 34, 47, 0, 0, -10, 34, 44, 57, 0, 0, 0, -11, -21, -32, 0, 0, -10, 34, 44, -21, 0, 0, 0, -11, -21, -32, 0, 0, -10, 38, -21, 0};
+
+ // Each group = glyph-index, base, number of attached, glyphs, attached-glyph-indices
+ int attachments[] = {
+ 0,0,0, 1,1,0, 2,2,0, 3,3,0, 4,4,0, 5,5,0, 6,6,0, 7,7,0,
+ 8,8,2,9,10, 9,8,0, 10,8,0, 11,11,0, 12,12,0, 13,13,0, 14,14,2,15,16,
+ 15,14,0, 16,14,0, 17,17,0, 18,18,0, 19,19,0, 20,20,2,21,22, 21,20,0,
+ 22,20,0, 23,23,0, 24,24,0, 25,25,0, 26,26,2,27,28, 27,26,0, 28,26,0,
+ 29,29,0, 30,30,0, 31,31,0, 32,32,2,33,34, 33,32,0, 34,32,0, 35,35,0,
+ 36,36,0, 37,37,0, 38,38,0, 39,39,0, 40,40,0, 41,41,0
+ };
+ int attCount = sizeof(attachments) / sizeof(int);
+
+ // Each line in clickStuff represents one click test with the following items:
+ // click x-coord, click y-coord, char index, assoc-prev,
+ // prim sel Top, prim sel bottom, prim sel left,
+ // sec sel Top, sec sel bottom, sec sel left
+ // Y-coordinates are offsets from segment top; ie, (0,0) is segment top-left.
+ const int clickTestCnt = 6;
+ int clickStuff[] = {
+ 109, 25, 9, false, 19, 32, 105, 30, 56, 125, // first grave on 4th a
+ 178, 26, 15, true, 19, 66, 176, 9, 21, 159, // top of 1st esh, right side
+ 220, 84, 23, false, 78, 89, 210, 65, 77, 228, // first lower bridge diac
+ 271, 40, 26, false, 0, 72, 266, kAbsent, kAbsent, kAbsent, // second esh, left side
+ 271, 65, 26, false, 0, 72, 266, kAbsent, kAbsent, kAbsent, // just below second esh, left side
+ 271, 68, 29, false, 67, 78, 262, 0, 11, 280 // lower bridge diac under esh, left side
+ };
+
+ // Finish setting up test case.
+ SetCharCount(charCnt);
+ SetGlyphCount(glyphCnt);
+ SetGlyphList(glyphList);
+ SetXPositions(xPositions);
+ SetYPositions(yPositions);
+ SetAdvWidths(advWidths);
+ SetBBs(bbLefts, bbRights, bbTops, bbBottoms);
+ SetInsPtFlags(insPtFlags);
+ SetAttachedClusters(attachments, attCount);
+ SetClickTests(clickTestCnt, clickStuff);
+}
+
+/*----------------------------------------------------------------------------------------------
A set of tests for handling trailing whitespace.
----------------------------------------------------------------------------------------------*/
void TestCase::SetupNoWhiteSpace()
{
m_testName = "No white space";
+ //m_debug = true;
+ //m_traceLog = true;
+ //m_skip = true;
// Input:
m_fontName = L"Graphite Test Roman";
@@ -551,7 +731,7 @@ void TestCase::SetupNoWhiteSpace() const int glyphCnt = 16; // number of glyphs in the segment
// need glyphCnt elements in these arrays:
- gid16 glyphList[] = {55, 77, 73, 3, 3, 88, 92, 78, 71, 82, 3, 70, 89, 86, 94, 85};
+ gid16 glyphList[] = {55, 75, 72, 3, 3, 84, 88, 76, 70, 78, 3, 69, 85, 82, 90, 81};
int xPositions[] = { 0, 9, 17, 24, 29, 34, 42, 50, 54, 61, 69, 74, 82, 87, 95,107};
int yPositions[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int advWidths[] = { 9, 8, 7, 4, 4, 8, 8, 4, 7, 8, 4, 8, 5, 8, 11, 8};
@@ -566,14 +746,16 @@ void TestCase::SetupNoWhiteSpace() SetXPositions(xPositions);
SetYPositions(yPositions);
SetAdvWidths(advWidths);
+ SetBBs(NULL, NULL, NULL, NULL);
SetInsPtFlags(insPtFlags);
SetClickTests(0, NULL);
SetOutputContextBlock(contextBlockOutSize, contextBlockOut);
}
-void TestCase::SetupNoWhiteSpaceFailure()
+void TestCase::SetupNoWhiteSpaceNoSeg()
{
- m_testName = "No white space - failure";
+ m_testName = "No white space - no segment";
+ //m_skip = true;
// Input:
m_fontName = L"Graphite Test Roman";
@@ -606,6 +788,7 @@ void TestCase::SetupNoWhiteSpaceFailure() void TestCase::SetupOnlyWhiteSpace()
{
m_testName = "Only white space";
+ //m_skip = true;
// Input:
m_fontName = L"Graphite Test Roman";
@@ -639,7 +822,8 @@ void TestCase::SetupOnlyWhiteSpace() // Each line in clickStuff represents one click test with the following items:
// click x-coord, click y-coord, char index, assoc-prev,
// prim sel Top, prim sel bottom, prim sel left,
- // sec sel Top, sec sel bottom, sec sel left,
+ // sec sel Top, sec sel bottom, sec sel left
+ // Y-coordinates are offsets from segment top; ie, (0,0) is segment top-left.
const int clickTestCnt = 6;
int clickStuff[] = {
2, 25, 0, false, 0, 24, -1, kAbsent, kAbsent, kAbsent,
@@ -657,6 +841,7 @@ void TestCase::SetupOnlyWhiteSpace() SetXPositions(xPositions);
SetYPositions(yPositions);
SetAdvWidths(advWidths);
+ SetBBs(NULL, NULL, NULL, NULL);
SetInsPtFlags(insPtFlags);
SetClickTests(clickTestCnt, clickStuff);
}
@@ -667,6 +852,7 @@ void TestCase::SetupOnlyWhiteSpace() void TestCase::SetupCrossLine1()
{
m_testName = "Cross-line 1";
+ //m_skip = true;
// Input:
m_fontName = L"Graphite Test CrossLine";
@@ -702,7 +888,8 @@ void TestCase::SetupCrossLine1() // Each line in clickStuff represents one click test with the following items:
// click x-coord, click y-coord, char index, assoc-prev,
// prim sel Top, prim sel bottom, prim sel left,
- // sec sel Top, sec sel bottom, sec sel left,
+ // sec sel Top, sec sel bottom, sec sel left
+ // Y-coordinates are offsets from segment top; ie, (0,0) is segment top-left.
const int clickTestCnt = 0;
int * clickStuff = NULL;
//int clickStuff[] = ;
@@ -720,6 +907,7 @@ void TestCase::SetupCrossLine1() SetXPositions(xPositions);
SetYPositions(yPositions);
SetAdvWidths(advWidths);
+ SetBBs(NULL, NULL, NULL, NULL);
SetInsPtFlags(insPtFlags);
SetClickTests(clickTestCnt, clickStuff);
SetOutputContextBlock(contextBlockOutSize, contextBlockOut);
@@ -730,6 +918,7 @@ void TestCase::SetupCrossLine2() m_testName = "Cross-line 2";
//m_traceLog = true;
//m_debug = true;
+ //m_skip = true;
// Input:
m_fontName = L"Graphite Test CrossLine";
@@ -770,7 +959,8 @@ void TestCase::SetupCrossLine2() // Each line in clickStuff represents one click test with the following items:
// click x-coord, click y-coord, char index, assoc-prev,
// prim sel Top, prim sel bottom, prim sel left,
- // sec sel Top, sec sel bottom, sec sel left,
+ // sec sel Top, sec sel bottom, sec sel left
+ // Y-coordinates are offsets from segment top; ie, (0,0) is segment top-left.
const int clickTestCnt = 0;
int * clickStuff = NULL;
//int clickStuff[] = ;
@@ -788,6 +978,7 @@ void TestCase::SetupCrossLine2() SetXPositions(xPositions);
SetYPositions(yPositions);
SetAdvWidths(advWidths);
+ SetBBs(NULL, NULL, NULL, NULL);
SetInsPtFlags(insPtFlags);
SetClickTests(clickTestCnt, clickStuff);
SetInputContextBlock(contextBlockInSize, contextBlockIn);
@@ -797,6 +988,7 @@ void TestCase::SetupCrossLine2() void TestCase::SetupCrossLine3()
{
m_testName = "Cross-line 3";
+ //m_skip = true;
// Input:
m_fontName = L"Graphite Test CrossLine";
@@ -837,7 +1029,8 @@ void TestCase::SetupCrossLine3() // Each line in clickStuff represents one click test with the following items:
// click x-coord, click y-coord, char index, assoc-prev,
// prim sel Top, prim sel bottom, prim sel left,
- // sec sel Top, sec sel bottom, sec sel left,
+ // sec sel Top, sec sel bottom, sec sel left
+ // Y-coordinates are offsets from segment top; ie, (0,0) is segment top-left.
const int clickTestCnt = 0;
int * clickStuff = NULL;
//int clickStuff[] = ;
@@ -855,6 +1048,7 @@ void TestCase::SetupCrossLine3() SetXPositions(xPositions);
SetYPositions(yPositions);
SetAdvWidths(advWidths);
+ SetBBs(NULL, NULL, NULL, NULL);
SetInsPtFlags(insPtFlags);
SetClickTests(clickTestCnt, clickStuff);
SetInputContextBlock(contextBlockInSize, contextBlockIn);
@@ -864,6 +1058,7 @@ void TestCase::SetupCrossLine3() void TestCase::SetupCrossLine4()
{
m_testName = "Cross-line 4";
+ //m_skip = true;
// Input:
m_fontName = L"Graphite Test CrossLine";
@@ -904,7 +1099,8 @@ void TestCase::SetupCrossLine4() // Each line in clickStuff represents one click test with the following items:
// click x-coord, click y-coord, char index, assoc-prev,
// prim sel Top, prim sel bottom, prim sel left,
- // sec sel Top, sec sel bottom, sec sel left,
+ // sec sel Top, sec sel bottom, sec sel left
+ // Y-coordinates are offsets from segment top; ie, (0,0) is segment top-left.
const int clickTestCnt = 0;
int * clickStuff = NULL;
//int clickStuff[] = ;
@@ -922,6 +1118,7 @@ void TestCase::SetupCrossLine4() SetXPositions(xPositions);
SetYPositions(yPositions);
SetAdvWidths(advWidths);
+ SetBBs(NULL, NULL, NULL, NULL);
SetInsPtFlags(insPtFlags);
SetClickTests(clickTestCnt, clickStuff);
SetInputContextBlock(contextBlockInSize, contextBlockIn);
@@ -942,8 +1139,9 @@ std::wstring TestCase::CrossLineText() void TestCase::SetupArabic1()
{
m_testName = "Arabic 1";
- m_debug = true;
+ //m_debug = true;
m_traceLog = false;
+ //m_skip = true;
// Input:
m_fontName = L"Graphite Test Arabic";
@@ -963,10 +1161,20 @@ void TestCase::SetupArabic1() 61, // character count
61); // glyph count
+ // Each group = glyph-index, base, number of attached, glyphs, attached-glyph-indices
+ int attachments[] = {
+ 0,0,0, 1,1,1,2, 2,1,0, 3,3,4,4,5,6,7, 4,3,0, 5,3,0, 6,3,0, 7,3,0,
+ 8,8,0, 9,9,4,10,11,12,13, 10,9,0, 11,9,0, 12,9,0, 13,9,0, 14,14,0,
+ 15,15,0, 16,16,1,17, 17,16,0, 18,18,1,19, 19,18,0 // etc
+ };
+ int attCount = sizeof(attachments) / sizeof(int);
+ SetAttachedClusters(attachments, attCount);
+
// Each line in clickStuff represents one click test with the following items:
// click x-coord, click y-coord, char index, assoc-prev,
// prim sel Top, prim sel bottom, prim sel left,
- // sec sel Top, sec sel bottom, sec sel left,
+ // sec sel Top, sec sel bottom, sec sel left
+ // Y-coordinates are offsets from segment top; ie, (0,0) is segment top-left.
int clickStuff[] = {
199, 13, 37, true, 0, 35,196, kAbsent, kAbsent, kAbsent,
396, 13, 3, false, 8, 26,399, 10, 17, 397,
@@ -982,6 +1190,7 @@ void TestCase::SetupArabic2() m_testName = "Arabic 2";
m_debug = false;
m_traceLog = false;
+ //m_skip = true;
// Input:
m_fontName = L"Graphite Test Arabic";
@@ -1036,6 +1245,7 @@ void TestCase::SetupArabicAux(int charCnt, int glyphCnt) SetXPositions(xPositions);
SetYPositions(yPositions);
SetAdvWidths(advWidths);
+ SetBBs(NULL, NULL, NULL, NULL);
SetInsPtFlags(insPtFlags);
}
@@ -1055,7 +1265,340 @@ std::wstring TestCase::ArabicText() return strRet;
}
+/*----------------------------------------------------------------------------------------------
+ A set of tests that uses Tai Viet script to test positioning.
+----------------------------------------------------------------------------------------------*/
+void TestCase::SetupTaiViet1()
+{
+ m_testName = "Tai Viet Collisions";
+ //m_traceLog = true;
+ //m_debug = true;
+ //m_skip = true;
+ // Input:
+ m_fontName = L"Graphite Test TaiViet";
+ m_fontFile = "grtest_taiviet.ttf";
+ m_fontSize = 36; // font size in points
+ m_prefBreak = klbWordBreak; // preferred break-weight
+ m_availWidth = 2000; // width available for segment
+ m_bold = false;
+ m_italic = false;
+ m_rtl = false;
+ m_backtrack = false;
+ m_text = TaiVietText();
+
+ m_fset[0].id = 2001; m_fset[0].value = 2; // vowel position = final consonant
+ m_fset[1].id = 1051; m_fset[1].value = 0; // diacritic selection = off
+ m_fset[2].id = 2102; m_fset[2].value = 0; // collision avoidance = off
+ m_fset[3].id = 0;
+
+ // Output:
+ m_segWidth = 946; // physical width of segment
+
+ const int charCnt = 46; // number of characters in the segment
+
+ // need charCnt elements in this array:
+ bool insPtFlags[] = {
+ true, true, false, true, true, true, false, true, true, true,
+ false, false, true, true, false, true, true, false, false, true,
+ true, false, false, true, true, false, false, true, true, false,
+ false, true, true, false, true, true, false, false, true, true,
+ false, true, true, true, false, false
+ };
+
+ const int glyphCnt = 46; // number of glyphs in the segment
+
+ // need glyphCnt elements in these arrays:
+ // 0 10 20 30 40
+ gid16 glyphList[] = {59, 70, 71, 65, 59, 70, 71, 23, 32, 175, 70, 65, 55, 70, 73, 55, 175, 184,185, 55, 76, 184,185, 55, 77, 70, 185, 41, 77, 70, 23, 56,175, 65, 27, 93, 70,185, 53, 69, 81, 50, 27,175, 70, 23};
+ int xPositions[] = { 0, 72, 47, 72,101, 174,149,174, 206, 281, 283, 251, 283,352, 316, 352, 418, 425,386,425,493, 495,458, 495,556,559, 528, 559, 623, 623,591,623,706, 676, 706, 776,777,738, 777, 836, 816,843,880,944,946,912};
+ int yPositions[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 5, 13, 0, 0, 5, 22, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 19, 0, 0, 8, 0, 0, 0, 5, 21, 0};
+ int advWidths[] = {47, 0, 24, 29, 47, 0, 24, 32, 44, 0, 0, 29, 33, 0, 36, 33, 0, 0, 26, 33, 0, 0, 26, 33, 0, 0, 26, 32, 0, 0, 32, 52, 0, 29, 32, 0, 0, 26, 39, 0, 26, 36, 32, 0, 0, 32};
+
+ int bbLefts[] = { 5, 45, 52, 73,106, 147,154,177, 209, 254, 257, 252, 286,326, 322, 355, 391, 414,390,428,463, 484, 462,498,540,532, 532, 562, 607, 597,594,627,679, 677, 709, 744,751,742, 784, 825, 820,849,883,917,919,915};
+ int bbRights[] = {72, 72, 63, 97,174, 174,165,211, 277, 281, 283, 276, 349,352, 355, 419, 418, 422,409,491,494, 491, 481,561,553,559, 551, 621, 620, 623,628,681,706, 701, 756, 776,777,761, 835, 833, 840,882,930,944,946,949};
+ int bbTops [] = {60, 50, 25, 25, 60, 50, 25, 41, 60, 49, 66, 25, 60, 50, 40, 60, 55, 65, 36, 60, 56, 74, 36, 60, -5, 55, 36, 60, -5, 50, 41, 40, 49, 25, 55, 56, 69, 36, 55, 61, 41, 40, 55, 55, 71, 41};
+ int bbBottoms [] = { 0, 35, 0, 0, 0, 35, 0, 0, 0, 34, 50, 0, 0, 35, 0, 0, 39, 51, 0, 0, 40, 60, 0, 0,-27, 40, 0, 0, -27, 35, 0, 0, 34, 0, 0, 40, 54, 0, 0, 45, 0, 0, 0, 39, 56, 0};
+
+ // Each group = glyph-index, base, number of attached, glyphs, attached-glyph-indices
+ int attachments[] = {
+ 0,0,0, 1,2,0, 2,2,1,1, 3,3,0, 4,4,0, 5,6,0, 6,6,1,5, 7,7,0,
+ 8,8,0, 9,11,0, 10,11,0, 11,11,2,9,10, 12,12,0, 13,14,0, 14,14,1,13,
+ 15,15,0, 16,18,0, 17,18,0, 18,18,2,16,17, 19,19,0, 20,22,0, 21,22,0,
+ 22,22,2,20,21, 23,23,0, 24,26,0, 25,26,0, 26,26,2,24,25, 27,27,0, 28,30,0,
+ 29,30,0, 30,30,2,28,29, 31,31,0, 32,33,0, 33,33,1,32, 34,34,0, 35,37,0,
+ 36,37,0, 37,37,2,35,36, 38,38,0, 39,40,0, 40,40,1,39, 41,41,0, 42,42,0,
+ 43,45,0, 44,45,0, 45,45,2,43,44
+ };
+ int attCount = sizeof(attachments) / sizeof(int);
+
+ // Each line in clickStuff represents one click test with the following items:
+ // click x-coord, click y-coord, char index, assoc-prev,
+ // prim sel Top, prim sel bottom, prim sel left,
+ // sec sel Top, sec sel bottom, sec sel left
+ // Y-coordinates are offsets from segment top; ie, (0,0) is segment top-left.
+ const int clickTestCnt = 4;
+ int clickStuff[] = {
+ 55, 40, 1, true, 0,100, 46, kAbsent, kAbsent, kAbsent,
+ 65, 20, 1, false, 0,100, 46, kAbsent, kAbsent, kAbsent, // adjust to the left to get a valid IP?
+ 95, 84, 4, true, 0,100, 100, kAbsent, kAbsent, kAbsent,
+ 104, 40, 4, false, 0,100, 100, kAbsent, kAbsent, kAbsent
+ };
+
+ // Finish setting up test case.
+ SetCharCount(charCnt);
+ SetGlyphCount(glyphCnt);
+ SetGlyphList(glyphList);
+ SetXPositions(xPositions);
+ SetYPositions(yPositions);
+ SetAdvWidths(advWidths);
+ SetBBs(bbLefts, bbRights, bbTops, bbBottoms);
+ SetInsPtFlags(insPtFlags);
+ SetAttachedClusters(attachments, attCount);
+ SetClickTests(clickTestCnt, clickStuff);
+}
+
+/*----------------------------------------------------------------------------------------------
+ A set of tests that uses Tai Viet script to test positioning.
+----------------------------------------------------------------------------------------------*/
+void TestCase::SetupTaiViet2()
+{
+ m_testName = "Tai Viet No Collisions";
+ //m_traceLog = true;
+ //m_debug = true;
+ //m_skip = true;
+
+ // Input:
+ m_fontName = L"Graphite Test TaiViet";
+ m_fontFile = "grtest_taiviet.ttf";
+ m_fontSize = 36; // font size in points
+ m_prefBreak = klbWordBreak; // preferred break-weight
+ m_availWidth = 2000; // width available for segment
+ m_bold = false;
+ m_italic = false;
+ m_rtl = false;
+ m_backtrack = false;
+ m_text = TaiVietText();
+
+ m_fset[0].id = 2001; m_fset[0].value = 2; // vowel position = final consonant
+ m_fset[1].id = 1051; m_fset[1].value = 1; // diacritic selection = on
+ m_fset[2].id = 2102; m_fset[2].value = 1; // collision avoidance = off
+ m_fset[3].id = 0;
+
+ // Output:
+ m_segWidth = 947; // physical width of segment
+
+ const int charCnt = 46; // number of characters in the segment
+
+ // need charCnt elements in this array:
+ bool insPtFlags[] = {
+ true, true, true, true, true, true, true, true, true, true,
+ true, true, true, true, true, true, true, true, true, true,
+ true, true, true, true, true, true, true, true, true, true,
+ true, true, true, true, true, true, true, true, true, true,
+ true, true, true, true, true, true
+ };
+
+ const int glyphCnt = 46; // number of glyphs in the segment
+
+ // need glyphCnt elements in these arrays:
+ // 0 10 20 30 40
+ gid16 glyphList[] = {59, 70, 71, 65, 59, 70, 71, 23, 32, 175, 70, 65, 55, 70, 73, 55, 175, 184,185, 55, 76, 184,185, 55, 77, 70, 185, 41, 77, 70, 23, 56,175, 65, 27, 93, 70,185, 53, 69, 81, 50, 27,175, 70, 23};
+ int xPositions[] = { 0, 82, 47, 72,101, 184,149,174, 206, 281, 283, 251, 283,359, 316, 352, 418, 431,386,425,496, 508,458, 497,559,578, 530, 561, 626, 635,593,626,709, 678, 708, 778,780,740, 780, 853, 819,846,882,942,947,914};
+ int yPositions[] = { 0, -3, 0, 0, 0, -3, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 9, 0, 0, 2, 20, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, -4, 0, 0, 5, 25, 0, 0, 8, 0, 0, 0, 0, 23, 0};
+ int advWidths[] = {47, 0, 24, 29, 47, 0, 24, 32, 44, 0, 0, 29, 33, 0, 36, 33, 0, 0, 26, 33, 0, 0, 26, 33, 0, 0, 26, 32, 0, 0, 32, 52, 0, 29, 32, 0, 0, 26, 39, 0, 26, 36, 32, 0, 0, 32};
+
+ int bbLefts[] = { 5, 56, 52, 73,106, 158,154,177, 209, 254, 257, 252, 286,333, 322, 355, 391, 420,390,428,466, 497, 462,500,542,552, 534, 564, 609, 609,597,629,682, 679, 711, 747,753,744, 786, 842, 823,851,885,916,921,918};
+ int bbRights[] = {72, 82, 63, 97,174, 184,165,211, 277, 281, 283, 276, 349,359, 355, 419, 418, 427,409,491,496, 504, 481,564,555,578, 553, 624, 622, 635,630,684,709, 703, 758, 778,780,763, 837, 850, 842,885,932,942,947,951};
+ int bbTops [] = {60, 46, 25, 25, 60, 46, 25, 41, 60, 49, 73, 25, 60, 50, 40, 60, 50, 60, 36, 60, 54, 72, 36, 60, -5, 52, 36, 60, -5, 50, 41, 40, 45, 25, 55, 56, 75, 36, 55, 61, 41, 40, 55, 50, 73, 41};
+ int bbBottoms [] = { 0, 31, 0, 0, 0, 31, 0, 0, 0, 34, 57, 0, 0, 35, 0, 0, 34, 46, 0, 0, 37, 57, 0, 0,-27, 36, 0, 0, -27, 35, 0, 0, 29, 0, 0, 40, 60, 0, 0, 45, 0, 0, 0, 34, 58, 0};
+
+ // Each group = glyph-index, base, number of attached, glyphs, attached-glyph-indices
+ int attachments[] = {
+ 0,0,0, 1,2,0, 2,2,1,1, 3,3,0, 4,4,0, 5,6,0, 6,6,1,5, 7,7,0,
+ 8,8,0, 9,11,0, 10,11,0, 11,11,2,9,10, 12,12,0, 13,14,0, 14,14,1,13,
+ 15,15,0, 16,18,0, 17,18,0, 18,18,2,16,17, 19,19,0, 20,22,0, 21,22,0,
+ 22,22,2,20,21, 23,23,0, 24,26,0, 25,26,0, 26,26,2,24,25, 27,27,0, 28,30,0,
+ 29,30,0, 30,30,2,28,29, 31,31,0, 32,33,0, 33,33,1,32, 34,34,0, 35,37,0,
+ 36,37,0, 37,37,2,35,36, 38,38,0, 39,40,0, 40,40,1,39, 41,41,0, 42,42,0,
+ 43,45,0, 44,45,0, 45,45,2,43,44
+ };
+ int attCount = sizeof(attachments) / sizeof(int);
+
+ // Each line in clickStuff represents one click test with the following items:
+ // click x-coord, click y-coord, char index, assoc-prev,
+ // prim sel top, prim sel bottom, prim sel left,
+ // sec sel top, sec sel bottom, sec sel left
+ // Y-coordinates are offsets from segment top; ie, (0,0) is segment top-left.
+ const int clickTestCnt = 4;
+ int clickStuff[] = {
+ 55, 40, 2, false, 35, 65, 49, 14, 33, 82,
+ 65, 20, 1, false, 0,100, 50, kAbsent, kAbsent, kAbsent,
+ 95, 84, 4, true, 0,100, 100, kAbsent, kAbsent, kAbsent,
+ 104, 40, 4, false, 0,100, 100, kAbsent, kAbsent, kAbsent
+ };
+
+ // Finish setting up test case.
+ SetCharCount(charCnt);
+ SetGlyphCount(glyphCnt);
+ SetGlyphList(glyphList);
+ SetXPositions(xPositions);
+ SetYPositions(yPositions);
+ SetAdvWidths(advWidths);
+ SetBBs(bbLefts, bbRights, bbTops, bbBottoms);
+ SetInsPtFlags(insPtFlags);
+ SetAttachedClusters(attachments, attCount);
+ SetClickTests(clickTestCnt, clickStuff);
+}
+
+std::wstring TestCase::TaiVietText()
+{
+ std::wstring strRet;
+ wchar_t charData[] = {
+ 0xe00f,0xe042,0xe031,0xe02b,0xe00f,0xe042,0xe031,0xe025,0xe021,0xe033,
+ 0xe042,0xe02b,0xe01c,0xe042,0xe03e,0xe01c,0xe033,0xe040,0xe009,0xe01c,
+ 0xe039,0xe040,0xe009,0xe01c,0xe035,0xe042,0xe009,0xe024,0xe035,0xe042,
+ 0xe025,0xe01b,0xe033,0xe02b,0xe00a,0xe030,0xe042,0xe009,0xe01e,0xe040,
+ 0xe03b,0xe019,0xe00a,0xe033,0xe042,0xe025,0x0000
+ };
+ strRet.assign(charData);
+ return strRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Set up a test where the font is bad and we revert to dumb rendering
+----------------------------------------------------------------------------------------------*/
+void TestCase::SetupDumbFallback1()
+{
+ m_testName = "Dumb Fallback 1";
+ //m_debug = true;
+ m_traceLog = false;
+ //m_skip = true;
+
+ // Input:
+ m_fontName = L"GrErr BadVersion";
+ m_fontFile = "grtest_badVersion.ttf";
+ m_text = RomanText(); // text to render
+ m_fontSize = 12; // font size in points
+ m_prefBreak = klbWordBreak; // preferred break-weight
+ m_availWidth = 500; // width available for segment
+ m_bold = false;
+ m_italic = false;
+ m_rtl = false;
+ m_backtrack = false;
+ m_dumbFallback = true;
+
+ // Output:
+ m_badFont = true;
+ m_segWidth = 196; // physical width of segment
+
+ const int charCnt = 26; // number of characters in the segment
+
+ // need charCnt elements in this array:
+ bool insPtFlags[] = {
+ true, true, true, true, true, true, true, true, true, true,
+ true, true, true, true, true, true, true, true, true, true,
+ true, true, true, true, true, true
+ };
+
+ const int glyphCnt = 26; // number of glyphs in the segment
+
+ // need glyphCnt elements in these arrays:
+ // 0 10 20
+ gid16 glyphList[] = {71, 0, 0, 82, 0, 85, 73, 0, 0, 0, 0, 67, 0, 0, 75, 0, 43, 0, 79, 0, 0, 0, 0, 72, 72, 75};
+ int xPositions[] = { 0, 7, 15, 23, 31, 39, 46, 54, 62, 70, 78, 86, 93,101,109,114,122,128,136,149,157,165,173,181,186,192};
+ int yPositions[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+ int advWidths[] = { 7, 8, 8, 8, 8, 6, 8, 8, 8, 8, 8, 7, 8, 8, 4, 8, 5, 8, 12, 8, 8, 8, 8, 5, 5, 4};
+
+ const int clickTestCnt = 0;
+ int * clickStuff = NULL;
+
+ // Finish setting up test case.
+ SetCharCount(charCnt);
+ SetGlyphCount(glyphCnt);
+ SetGlyphList(glyphList);
+ SetXPositions(xPositions);
+ SetYPositions(yPositions);
+ SetAdvWidths(advWidths);
+ SetBBs(NULL, NULL, NULL, NULL);
+ SetInsPtFlags(insPtFlags);
+ SetClickTests(clickTestCnt, clickStuff);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Now make sure we will get a crash when we turn dumb rendering off for the same font.
+----------------------------------------------------------------------------------------------*/
+void TestCase::SetupDumbFallback2()
+{
+ m_testName = "Dumb Fallback 2";
+ //m_debug = true;
+ m_traceLog = false;
+ //m_skip = true;
+
+ // Input:
+ m_fontName = L"GrErr BadVersion";
+ m_fontFile = "grtest_badVersion.ttf";
+ m_text = L"This is a test."; // text to render
+ m_fontSize = 12; // font size in points
+ m_prefBreak = klbWordBreak; // preferred break-weight
+ m_availWidth = 500; // width available for segment
+ m_bold = false;
+ m_italic = false;
+ m_rtl = false;
+ m_backtrack = false;
+ m_dumbFallback = false;
+
+ // Output:
+ m_badFont = true;
+ m_noSegment = true;
+ m_segWidth = 0; // physical width of segment
+
+ const int charCnt = 0; // number of characters in the segment
+
+ const int glyphCnt = 0; // number of glyphs in the segment
+
+ // Finish setting up test case.
+ SetCharCount(charCnt);
+ SetGlyphCount(glyphCnt);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Now make sure we will get a crash when we turn dumb rendering off for the same font.
+----------------------------------------------------------------------------------------------*/
+void TestCase::SetupBadFont()
+{
+ m_testName = "Bad Font";
+ //m_debug = true;
+ m_traceLog = false;
+ //m_skip = true;
+
+ // Input:
+ // The font has been corrupted so that the size of the cmap in the directory is invalid.
+ m_fontName = L"Graphite Test Roman";
+ m_fontFile = "grtest_badCmap.ttf";
+ m_text = L"This is a test."; // text to render
+ m_fontSize = 12; // font size in points
+ m_prefBreak = klbWordBreak; // preferred break-weight
+ m_availWidth = 500; // width available for segment
+ m_bold = false;
+ m_italic = false;
+ m_rtl = false;
+ m_backtrack = false;
+ m_dumbFallback = true; // wants to do dumb fall-back, but can't because the font is totally invalid
+
+ // Output:
+ m_badFont = true;
+ m_noSegment = true;
+ m_segWidth = 0; // physical width of segment
+
+ const int charCnt = 0; // number of characters in the segment
+
+ const int glyphCnt = 0; // number of glyphs in the segment
+
+ // Finish setting up test case.
+ SetCharCount(charCnt);
+ SetGlyphCount(glyphCnt);
+}
// *** Add more methods here. ***
@@ -1079,6 +1622,7 @@ TestCase::TestCase() m_testName = "Unknown";
m_debug = false;
m_traceLog = false;
+ m_skip = false;
m_fontName.erase();
m_fontFile.erase();
@@ -1097,7 +1641,9 @@ TestCase::TestCase() m_contextBlockIn = NULL;
m_initWithPrev = false;
memset(m_fset, 0, MAXFEAT * sizeof(FeatureSetting));
+ m_dumbFallback = true;
+ m_badFont = false;
m_noSegment = false; // yes, a segment should be generated
m_charCount = 0;
m_glyphCount = 0;
@@ -1105,7 +1651,15 @@ TestCase::TestCase() m_xPositions = NULL;
m_yPositions = NULL;
m_advWidths = NULL;
+ m_bbLefts = NULL;
+ m_bbRights = NULL;
+ m_bbTops = NULL;
+ m_bbBottoms = NULL;
m_insPointFlags = NULL;
+ m_charsToGlyphs = NULL;
+ m_c2gCount = 0;
+ m_attGlyphs = NULL;
+ m_attGCount = 0;
m_contextBlockOutSize = 0;
m_contextBlockOut = NULL;
@@ -1122,7 +1676,13 @@ TestCase::~TestCase() delete[] m_xPositions;
delete[] m_yPositions;
delete[] m_advWidths;
+ delete[] m_bbLefts;
+ delete[] m_bbRights;
+ delete[] m_bbTops;
+ delete[] m_bbBottoms;
delete[] m_insPointFlags;
+ delete[] m_charsToGlyphs;
+ delete[] m_attGlyphs;
delete[] m_clickTests;
delete[] m_contextBlockIn;
delete[] m_contextBlockOut;
@@ -1144,6 +1704,10 @@ void TestCase::SetGlyphCount(int glyphCount) m_xPositions = new int[glyphCount];
m_yPositions = new int[glyphCount];
m_advWidths = new int[glyphCount];
+ m_bbLefts = new int[glyphCount];
+ m_bbRights = new int[glyphCount];
+ m_bbTops = new int[glyphCount];
+ m_bbBottoms = new int[glyphCount];
}
void TestCase::SetGlyphList(gid16 * glyphList)
@@ -1170,12 +1734,52 @@ void TestCase::SetAdvWidths(int * advWidths) m_advWidths[i] = advWidths[i];
}
+void TestCase::SetBBs(int * bbLefts, int * bbRights, int * bbTops, int * bbBottoms)
+{
+ if (bbLefts == NULL) // no bb tests
+ {
+ delete[] m_bbLefts;
+ delete[] m_bbRights;
+ delete[] m_bbTops;
+ delete[] m_bbBottoms;
+ m_bbLefts = NULL;
+ m_bbRights = NULL;
+ m_bbTops = NULL;
+ m_bbBottoms = NULL;
+ return;
+ }
+
+ for (int i = 0; i < m_glyphCount; i++)
+ {
+ m_bbLefts[i] = bbLefts[i];
+ m_bbRights[i] = bbRights[i];
+ m_bbTops[i] = bbTops[i];
+ m_bbBottoms[i] = bbBottoms[i];
+ }
+}
+
void TestCase::SetInsPtFlags(bool * flags)
{
for (int i = 0; i < m_charCount; i++)
m_insPointFlags[i] = flags[i];
}
+void TestCase::SetCharsToGlyphs(int * stuff, int count)
+{
+ m_c2gCount = count;
+ m_charsToGlyphs = new int[count];
+ for (int i = 0; i < count; i++)
+ m_charsToGlyphs[i] = stuff[i];
+}
+
+void TestCase::SetAttachedClusters(int * stuff, int count)
+{
+ m_attGCount = count;
+ m_attGlyphs = new int[count];
+ for (int i = 0; i < count; i++)
+ m_attGlyphs[i] = stuff[i];
+}
+
void TestCase::SetClickTests(int clickTestCount, int * clickStuff)
{
const int fc = ClickTest::fieldCnt;
diff --git a/Build/source/libs/graphite-engine/test/RegressionTest/TestCase.h b/Build/source/libs/graphite-engine/test/RegressionTest/TestCase.h index 811a7e2c455..d18fd22b126 100644 --- a/Build/source/libs/graphite-engine/test/RegressionTest/TestCase.h +++ b/Build/source/libs/graphite-engine/test/RegressionTest/TestCase.h @@ -32,8 +32,9 @@ public: void SetupBurmese4();
void SetupRoman();
void SetupRomanFeatures();
+ void SetupStackingAndBridging();
void SetupNoWhiteSpace();
- void SetupNoWhiteSpaceFailure();
+ void SetupNoWhiteSpaceNoSeg();
void SetupOnlyWhiteSpace();
void SetupCrossLine1();
void SetupCrossLine2();
@@ -41,6 +42,11 @@ public: void SetupCrossLine4();
void SetupArabic1();
void SetupArabic2();
+ void SetupTaiViet1();
+ void SetupTaiViet2();
+ void SetupDumbFallback1();
+ void SetupDumbFallback2();
+ void SetupBadFont();
// *** Add more methods here. ***
protected:
@@ -51,6 +57,7 @@ protected: std::wstring RomanText();
std::wstring CrossLineText();
std::wstring ArabicText();
+ std::wstring TaiVietText();
public:
const static int kAbsent = -100; // not present in data
@@ -68,6 +75,7 @@ public: std::string TestName() { return m_testName; }
bool RunDebugger() { return m_debug; }
bool TraceLog() { return m_traceLog; }
+ bool Skip() { return m_skip; }
std::wstring Text() { return m_text; }
std::wstring FontName() { return m_fontName; }
@@ -84,6 +92,7 @@ public: bool Rtl() { return m_rtl; }
bool ParaRtl() { return m_paraRtl; }
size_t FirstChar() { return m_firstChar; }
+ bool DumbFallback() { return m_dumbFallback; }
size_t InputContextBlock(gr::byte ** ppContextBlock)
{
*ppContextBlock = m_contextBlockIn;
@@ -91,16 +100,29 @@ public: }
bool InitWithPrevSeg() { return m_initWithPrev; }
+ bool BadFont() { return m_badFont; }
bool NoSegment() { return m_noSegment; }
int SegWidth() { return m_segWidth; }
int CharCount() { return m_charCount; }
int GlyphCount() { return m_glyphCount; }
+
int GlyphID(int i) { return m_glyphArray[i]; }
int XPos(int i) { return m_xPositions[i]; }
int YPos(int i) { return m_yPositions[i]; }
int AdvWidth(int i) { return m_advWidths[i]; }
+ int BbLeft(int i) { return m_bbLefts[i]; }
+ int BbRight(int i) { return m_bbRights[i]; }
+ int BbTop(int i) { return m_bbTops[i]; }
+ int BbBottom(int i) { return m_bbBottoms[i]; }
+ bool BbTests() { return (m_bbLefts != NULL); }
+
int InsPtFlag(int i) { return m_insPointFlags[i]; }
+ int CharToGlyphCount() { return m_c2gCount; }
+ int CharToGlyphItem(int i) { return m_charsToGlyphs[i]; }
+ int AttachedGlyphCount() { return m_attGCount; } // that is, the lenght of the data
+ int AttachedGlyphItem(int i) { return m_attGlyphs[i]; }
+
int NumberOfClickTests() { return m_clickTestCount; }
int XClick(int i) { return m_clickTests[i].xClick; }
int YClick(int i) { return m_clickTests[i].yClick; }
@@ -144,6 +166,7 @@ protected: bool m_debug; // break into the debugger when running this test
bool m_traceLog; // generate a logging file (tracelog.txt) for this test; if this is turned on for
// more than one test, the tests will be appended
+ bool m_skip;
#define MAXFEAT 10
@@ -166,12 +189,14 @@ protected: size_t m_contextBlockInSize; // default: 0
gr::byte * m_contextBlockIn; // default: NULL -- DELETE
bool m_initWithPrev; // default: false
+ bool m_dumbFallback; // default: true
// start of line flag
// resolution
// justification
// Output:
- bool m_noSegment; // no segment should be generated
+ bool m_badFont; // default: false
+ bool m_noSegment; // no segment should be generated
int m_segWidth;
int m_charCount;
int m_glyphCount;
@@ -179,13 +204,20 @@ protected: int * m_xPositions;
int * m_yPositions;
int * m_advWidths;
+ int * m_bbLefts;
+ int * m_bbRights;
+ int * m_bbTops;
+ int * m_bbBottoms;
bool * m_insPointFlags;
+ int * m_charsToGlyphs; // char-to-glyph mappings
+ int m_c2gCount;
+ int * m_attGlyphs; // attachment clusters
+ int m_attGCount;
int m_clickTestCount;
ClickTest * m_clickTests;
size_t m_contextBlockOutSize;
gr::byte * m_contextBlockOut;
// glyphs-to-chars
- // chars-to-glyphs
// pdichwContext
// arrow key behavior
// etc.
@@ -197,7 +229,10 @@ protected: void SetXPositions(int * posList);
void SetYPositions(int * posList);
void SetAdvWidths(int * advWidths);
+ void SetBBs(int * bbLefts, int * bbRights, int * bbTops, int * bbBottoms);
void SetInsPtFlags(bool * flags);
+ void SetCharsToGlyphs(int * stuff, int count);
+ void SetAttachedClusters(int * stuff, int count);
void SetClickTests(int clickTestCount, int * clickStuff);
void SetInputContextBlock(int contextBlockInSize, gr::byte * contextBlockIn);
void SetOutputContextBlock(int contextBlockOutSize, gr::byte * contextBlockIn);
diff --git a/Build/source/libs/graphite-engine/test/RegressionTest/bridgingStackingText.wpx b/Build/source/libs/graphite-engine/test/RegressionTest/bridgingStackingText.wpx new file mode 100644 index 00000000000..2682bad84f6 --- /dev/null +++ b/Build/source/libs/graphite-engine/test/RegressionTest/bridgingStackingText.wpx @@ -0,0 +1,158 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE WpDoc SYSTEM "WorldPad.dtd">
+<WpDoc wpxVersion="2.0">
+
+<Languages>
+ <LgWritingSystem id="en" language="en" type="ISO-639-1">
+ <Name24>
+ <AUni ws="en">English</AUni>
+ </Name24>
+ <Abbr24>
+ <AUni ws="en">Eng</AUni>
+ </Abbr24>
+ <Description24>
+ <AStr ws="en">
+ <Run ws="en">The standard alphabetic representation of English (United States style).</Run>
+ </AStr>
+ </Description24>
+ <Locale24><Integer val="1033"/></Locale24>
+ <RightToLeft24><Boolean val="false"/></RightToLeft24>
+ <DefaultSerif24><Uni>Times New Roman</Uni></DefaultSerif24>
+ <DefaultSansSerif24><Uni>Arial</Uni></DefaultSansSerif24>
+ <DefaultBodyFont24><Uni>Charis SIL</Uni></DefaultBodyFont24>
+ <DefaultMonospace24><Uni>Courier New</Uni></DefaultMonospace24>
+ <ICULocale24><Uni>en</Uni></ICULocale24>
+ <KeyboardType24><Uni>standard</Uni></KeyboardType24>
+ <Collations24>
+ <LgCollation>
+ <Name30>
+ <AUni ws="en">Default Collation</AUni>
+ </Name30>
+ <WinLCID30><Integer val="1033"/></WinLCID30>
+ <WinCollation30><Uni>Latin1_General_CI_AI</Uni></WinCollation30>
+ </LgCollation>
+ <LgCollation>
+ <Name30>
+ <AUni ws="en">Case Sensitive</AUni>
+ </Name30>
+ <WinLCID30><Integer val="1033"/></WinLCID30>
+ <WinCollation30><Uni>Latin1_General_CS_AI</Uni></WinCollation30>
+ </LgCollation>
+ </Collations24>
+ </LgWritingSystem>
+</Languages>
+
+<Styles>
+ <StStyle>
+ <Name17><Uni>Normal</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni></Uni></BasedOn17>
+ <Next17><Uni>Normal</Uni></Next17>
+ <Rules17>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Bulleted List</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Bulleted List</Uni></Next17>
+ <Rules17>
+ <Prop firstIndent="-18000" bulNumScheme="101" bulNumStartAt="1"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Heading 1</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Heading 1</Uni></Next17>
+ <Rules17>
+ <Prop bold="invert" fontsize="14000" fontsizeUnit="mpt" spaceBefore="12000" spaceAfter="3000"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Heading 2</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Heading 2</Uni></Next17>
+ <Rules17>
+ <Prop italic="invert" fontsize="12000" fontsizeUnit="mpt" spaceBefore="12000" spaceAfter="3000"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Heading 3</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Heading 3</Uni></Next17>
+ <Rules17>
+ <Prop fontsize="12000" fontsizeUnit="mpt" spaceBefore="12000" spaceAfter="3000"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Numbered List</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Numbered List</Uni></Next17>
+ <Rules17>
+ <Prop firstIndent="-18000" bulNumScheme="10"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>External Link</Uni></Name17>
+ <Type17><Integer val="1"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>External Link</Uni></Next17>
+ <Rules17>
+ <Prop underline="single" forecolor="7f007f" undercolor="7f007f"/>
+ </Rules17>
+ </StStyle>
+</Styles>
+
+<Body docRightToLeft="false">
+ <StTxtPara>
+ <StyleRules15>
+ <Prop namedStyle="Normal"/>
+ </StyleRules15>
+ <Contents16>
+ <Str>
+ <Run ws="en" fontsize="48000" fontsizeUnit="mpt" fontFamily="Doulos SIL"></Run>
+ </Str>
+ </Contents16>
+ </StTxtPara>
+ <StTxtPara>
+ <StyleRules15>
+ <Prop namedStyle="Normal"/>
+ </StyleRules15>
+ <Contents16>
+ <Str>
+ <Run ws="en" fontsize="36000" fontsizeUnit="mpt" fontFamily="Graphite Test Roman">a͝a t͝a à̀͝a ʃ̀̀͝a a̖̖a ʃ̀̀a a̖̖a ʃ͝a</Run>
+ </Str>
+ </Contents16>
+ </StTxtPara>
+</Body>
+
+<PageSetup>
+ <PageInfo>
+ <TopMargin9999><Integer val="72000"/></TopMargin9999>
+ <BottomMargin9999><Integer val="72000"/></BottomMargin9999>
+ <LeftMargin9999><Integer val="90000"/></LeftMargin9999>
+ <RightMargin9999><Integer val="90000"/></RightMargin9999>
+ <HeaderMargin9999><Integer val="36000"/></HeaderMargin9999>
+ <FooterMargin9999><Integer val="36000"/></FooterMargin9999>
+ <PageSize9999><Integer val="0"/></PageSize9999>
+ <PageHeight9999><Integer val="792000"/></PageHeight9999>
+ <PageWidth9999><Integer val="612000"/></PageWidth9999>
+ <PageOrientation9999><Integer val="0"/></PageOrientation9999>
+ <Header9999>
+ <Str>
+ <Run ws="en">bridgingDiacTest.wpx</Run>
+ </Str>
+ </Header9999>
+ <Footer9999>
+ <Str>
+ <Run ws="en">&[page],&[date]</Run>
+ </Str>
+ </Footer9999>
+ </PageInfo>
+</PageSetup>
+
+</WpDoc>
diff --git a/Build/source/libs/graphite-engine/test/RegressionTest/grtest_arabic.ttf b/Build/source/libs/graphite-engine/test/RegressionTest/grtest_arabic.ttf Binary files differindex e40c668a03d..df25e54b3f3 100644 --- a/Build/source/libs/graphite-engine/test/RegressionTest/grtest_arabic.ttf +++ b/Build/source/libs/graphite-engine/test/RegressionTest/grtest_arabic.ttf diff --git a/Build/source/libs/graphite-engine/test/RegressionTest/grtest_badCmap.ttf b/Build/source/libs/graphite-engine/test/RegressionTest/grtest_badCmap.ttf Binary files differnew file mode 100644 index 00000000000..d66c725f12e --- /dev/null +++ b/Build/source/libs/graphite-engine/test/RegressionTest/grtest_badCmap.ttf diff --git a/Build/source/libs/graphite-engine/test/RegressionTest/grtest_badVersion.ttf b/Build/source/libs/graphite-engine/test/RegressionTest/grtest_badVersion.ttf Binary files differnew file mode 100644 index 00000000000..babe42e5352 --- /dev/null +++ b/Build/source/libs/graphite-engine/test/RegressionTest/grtest_badVersion.ttf diff --git a/Build/source/libs/graphite-engine/test/RegressionTest/grtest_roman.ttf b/Build/source/libs/graphite-engine/test/RegressionTest/grtest_roman.ttf Binary files differindex b0ced0a7752..2001ff6b5ac 100644 --- a/Build/source/libs/graphite-engine/test/RegressionTest/grtest_roman.ttf +++ b/Build/source/libs/graphite-engine/test/RegressionTest/grtest_roman.ttf diff --git a/Build/source/libs/graphite-engine/test/RegressionTest/grtest_taiviet.ttf b/Build/source/libs/graphite-engine/test/RegressionTest/grtest_taiviet.ttf Binary files differnew file mode 100644 index 00000000000..3bf4a662b11 --- /dev/null +++ b/Build/source/libs/graphite-engine/test/RegressionTest/grtest_taiviet.ttf diff --git a/Build/source/libs/graphite-engine/test/RegressionTest/romanText.wpx b/Build/source/libs/graphite-engine/test/RegressionTest/romanText.wpx index 674659fa7de..3f8342364c7 100644 --- a/Build/source/libs/graphite-engine/test/RegressionTest/romanText.wpx +++ b/Build/source/libs/graphite-engine/test/RegressionTest/romanText.wpx @@ -19,6 +19,7 @@ <RightToLeft24><Boolean val="false"/></RightToLeft24>
<DefaultSerif24><Uni>Times New Roman</Uni></DefaultSerif24>
<DefaultSansSerif24><Uni>Arial</Uni></DefaultSansSerif24>
+ <DefaultBodyFont24><Uni>Charis SIL</Uni></DefaultBodyFont24>
<DefaultMonospace24><Uni>Courier New</Uni></DefaultMonospace24>
<ICULocale24><Uni>en</Uni></ICULocale24>
<KeyboardType24><Uni>standard</Uni></KeyboardType24>
@@ -48,7 +49,7 @@ <BasedOn17><Uni></Uni></BasedOn17>
<Next17><Uni>Normal</Uni></Next17>
<Rules17>
- <Prop italic="off" bold="off" superscript="off" underline="none" fontsize="10000" fontsizeUnit="mpt" offset="0" offsetUnit="mpt" forecolor="black" backcolor="white" undercolor="black" align="leading" firstIndent="0" leadingIndent="0" trailingIndent="0" spaceBefore="0" spaceAfter="0" lineHeight="10000" lineHeightUnit="mpt" rightToLeft="0" borderTop="0" borderBottom="0" borderLeading="0" borderTrailing="0" borderColor="black" bulNumScheme="0" bulNumStartAt="1" fontFamily="<default serif>">
+ <Prop italic="off" bold="off" superscript="off" underline="none" fontsize="10000" fontsizeUnit="mpt" offset="0" offsetUnit="mpt" forecolor="black" backcolor="white" undercolor="black" align="leading" firstIndent="0" leadingIndent="0" trailingIndent="0" spaceBefore="0" spaceAfter="0" lineHeight="10000" lineHeightUnit="mpt" lineHeightType="atLeast" rightToLeft="0" borderTop="0" borderBottom="0" borderLeading="0" borderTrailing="0" borderColor="black" bulNumScheme="0" bulNumStartAt="1" fontFamily="<default serif>">
<BulNumFontInfo backcolor="white" bold="off" fontsize="10000mpt" forecolor="black" italic="off" offset="0mpt" superscript="off" undercolor="black" underline="none" fontFamily="Times New Roman"/>
</Prop>
</Rules17>
@@ -116,7 +117,7 @@ </StyleRules15>
<Contents16>
<Str>
- <Run ws="en" fontsize="36000" fontsizeUnit="mpt" fontFamily="Graphite Test Roman">ẽ̀p͡sg˨˥˧ŊấĩĨm̼̀̈̄</Run>
+ <Run ws="en" fontsize="36000" fontsizeUnit="mpt" fontFamily="Graphite Test Roman">ẽ̀p͡sg˨˥˧ŊấĩĨm̼̀̈̄ffi</Run>
</Str>
</Contents16>
</StTxtPara>
@@ -136,7 +137,7 @@ </StyleRules15>
<Contents16>
<Str>
- <Run ws="en" fontsize="36000" fontsizeUnit="mpt" fontFamily="Graphite Test Roman" fontVariations="1024=2,1026=1,1029=1,1032=1">ẽ̀p͡sg˨˥˧ŊấĩĨm̼̀̈̄</Run>
+ <Run ws="en" fontsize="36000" fontsizeUnit="mpt" fontFamily="Graphite Test Roman" fontVariations="1026=1,1029=1,1032=1,1024=2,1051=0">ẽ̀p͡sg˨˥˧ŊấĩĨm̼̀̈̄ffi</Run>
</Str>
</Contents16>
</StTxtPara>
@@ -150,6 +151,26 @@ </Str>
</Contents16>
</StTxtPara>
+ <StTxtPara>
+ <StyleRules15>
+ <Prop rightToLeft="0" namedStyle="Normal"/>
+ </StyleRules15>
+ <Contents16>
+ <Str>
+ <Run ws="en" fontsize="20000" fontsizeUnit="mpt" fontFamily="Graphite Test Roman">stacking and bridging:</Run>
+ </Str>
+ </Contents16>
+ </StTxtPara>
+ <StTxtPara>
+ <StyleRules15>
+ <Prop rightToLeft="0" namedStyle="Normal"/>
+ </StyleRules15>
+ <Contents16>
+ <Str>
+ <Run ws="en" fontsize="36000" fontsizeUnit="mpt" fontFamily="Graphite Test Roman">a͝a t͝a à̀͝a ʃ̀̀͝a a̖̖a ʃ̀̀a a̖̖a</Run>
+ </Str>
+ </Contents16>
+ </StTxtPara>
</Body>
<PageSetup>
diff --git a/Build/source/libs/graphite-engine/test/RegressionTest/taivietText.wpx b/Build/source/libs/graphite-engine/test/RegressionTest/taivietText.wpx new file mode 100644 index 00000000000..05532a9385a --- /dev/null +++ b/Build/source/libs/graphite-engine/test/RegressionTest/taivietText.wpx @@ -0,0 +1,162 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE WpDoc SYSTEM "WorldPad.dtd">
+<WpDoc wpxVersion="2.0">
+
+<Languages>
+ <LgWritingSystem id="blt_TV" language="blt" type="ISO-639-2">
+ <Name24>
+ <AUni ws="en">Tai Dam</AUni>
+ </Name24>
+ <Locale24><Integer val="1033"/></Locale24>
+ <RightToLeft24><Boolean val="false"/></RightToLeft24>
+ <FontVariation24><Uni>2001=0,2005=0,2101=1,1051=1,2102=1</Uni></FontVariation24>
+ <DefaultSerif24><Uni>Tai Heritage Graphite</Uni></DefaultSerif24>
+ <DefaultSansSerif24><Uni>Arial</Uni></DefaultSansSerif24>
+ <DefaultBodyFont24><Uni>Charis SIL</Uni></DefaultBodyFont24>
+ <DefaultMonospace24><Uni>Courier</Uni></DefaultMonospace24>
+ <ICULocale24><Uni>blt_TV</Uni></ICULocale24>
+ <KeyboardType24><Uni>standard</Uni></KeyboardType24>
+ <Collations24>
+ <LgCollation>
+ <WinLCID30><Integer val="1033"/></WinLCID30>
+ <WinCollation30><Uni>Latin1_General_CI_AI</Uni></WinCollation30>
+ </LgCollation>
+ </Collations24>
+ </LgWritingSystem>
+</Languages>
+
+<Styles>
+ <StStyle>
+ <Name17><Uni>Normal</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni></Uni></BasedOn17>
+ <Next17><Uni>Normal</Uni></Next17>
+ <Rules17>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Bulleted List</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Bulleted List</Uni></Next17>
+ <Rules17>
+ <Prop firstIndent="-18000" bulNumScheme="101" bulNumStartAt="1"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Heading 1</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Heading 1</Uni></Next17>
+ <Rules17>
+ <Prop bold="invert" fontsize="14000" fontsizeUnit="mpt" spaceBefore="12000" spaceAfter="3000"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Heading 2</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Heading 2</Uni></Next17>
+ <Rules17>
+ <Prop italic="invert" fontsize="12000" fontsizeUnit="mpt" spaceBefore="12000" spaceAfter="3000"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Heading 3</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Heading 3</Uni></Next17>
+ <Rules17>
+ <Prop fontsize="12000" fontsizeUnit="mpt" spaceBefore="12000" spaceAfter="3000"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Numbered List</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Numbered List</Uni></Next17>
+ <Rules17>
+ <Prop firstIndent="-18000" bulNumScheme="10"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>External Link</Uni></Name17>
+ <Type17><Integer val="1"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>External Link</Uni></Next17>
+ <Rules17>
+ <Prop underline="single" forecolor="7f007f" undercolor="7f007f"/>
+ </Rules17>
+ </StStyle>
+</Styles>
+
+<Body docRightToLeft="false">
+ <StTxtPara>
+ <StyleRules15>
+ <Prop namedStyle="Normal"/>
+ </StyleRules15>
+ <Contents16>
+ <Str>
+ <Run></Run>
+ </Str>
+ </Contents16>
+ </StTxtPara>
+ <StTxtPara>
+ <StyleRules15>
+ <Prop namedStyle="Normal"/>
+ </StyleRules15>
+ <Contents16>
+ <Str>
+ <Run ws="blt_TV" fontsize="36000" fontsizeUnit="mpt" forecolor="transparent" fontFamily="Graphite Test TaiViet" fontVariations="2001=2,1051=0,2102=0"></Run>
+ </Str>
+ </Contents16>
+ </StTxtPara>
+ <StTxtPara>
+ <StyleRules15>
+ <Prop namedStyle="Normal"/>
+ </StyleRules15>
+ <Contents16>
+ <Str>
+ <Run ws="blt_TV" fontsize="36000" fontsizeUnit="mpt" forecolor="transparent" fontFamily="Graphite Test TaiViet" fontVariations="2001=2,2102=0"></Run>
+ </Str>
+ </Contents16>
+ </StTxtPara>
+ <StTxtPara>
+ <StyleRules15>
+ <Prop namedStyle="Normal"/>
+ </StyleRules15>
+ <Contents16>
+ <Str>
+ <Run ws="blt_TV" fontsize="36000" fontsizeUnit="mpt" forecolor="transparent" fontFamily="Graphite Test TaiViet" fontVariations="2001=2,2102=1"></Run>
+ <Run ws="blt_TV" fontsize="36000" fontsizeUnit="mpt" forecolor="transparent" fontFamily="Graphite Test TaiViet" fontVariations="2001=2"></Run>
+ </Str>
+ </Contents16>
+ </StTxtPara>
+</Body>
+
+<PageSetup>
+ <PageInfo>
+ <TopMargin9999><Integer val="72000"/></TopMargin9999>
+ <BottomMargin9999><Integer val="72000"/></BottomMargin9999>
+ <LeftMargin9999><Integer val="90000"/></LeftMargin9999>
+ <RightMargin9999><Integer val="90000"/></RightMargin9999>
+ <HeaderMargin9999><Integer val="36000"/></HeaderMargin9999>
+ <FooterMargin9999><Integer val="36000"/></FooterMargin9999>
+ <PageSize9999><Integer val="0"/></PageSize9999>
+ <PageHeight9999><Integer val="792000"/></PageHeight9999>
+ <PageWidth9999><Integer val="612000"/></PageWidth9999>
+ <PageOrientation9999><Integer val="0"/></PageOrientation9999>
+ <Header9999>
+ <Str>
+ <Run ws="en">collision_examples.wpx</Run>
+ </Str>
+ </Header9999>
+ <Footer9999>
+ <Str>
+ <Run ws="en">&[page],&[date]</Run>
+ </Str>
+ </Footer9999>
+ </PageInfo>
+</PageSetup>
+
+</WpDoc>
diff --git a/Build/source/libs/graphite-engine/test/examples/burmese/Padauk.ttf b/Build/source/libs/graphite-engine/test/examples/burmese/Padauk.ttf Binary files differnew file mode 100644 index 00000000000..16a2ed864d9 --- /dev/null +++ b/Build/source/libs/graphite-engine/test/examples/burmese/Padauk.ttf diff --git a/Build/source/libs/graphite-engine/test/examples/burmese/bh1.utx b/Build/source/libs/graphite-engine/test/examples/burmese/bh1.utx new file mode 100644 index 00000000000..9dcaa5c3459 --- /dev/null +++ b/Build/source/libs/graphite-engine/test/examples/burmese/bh1.utx @@ -0,0 +1,4 @@ +ကျွနှ်ပ်တို့၏ ပျော်ရွှင်မှု၊ သာယာ ၀ ပြောမှုနှင့် အောင်မြင်မှုတို့သည် ကျွနု်ပ်တို့၏ ကျန်းမာခြင်းအပေါ်တွင် အများကြီး မှီခိုနေပါသည်။ ပညာတတ်ရန်၊ ကြွယ်၀ချမ်းသာရန်နှင့် ကြိုးပမ်း လုပ်ဆောင်မှုအားလုံး အောင်မြင်စေရန်အတွက် ကျန်းမာရေးသည် အထူးပင် အရေးကြီးပါသည်။ ကျန်းမာရေးမပြည့်စုံလျှင် ကျွနု်ပ်တို့၏ ပညာရေး၊ စီးပွားရေး မြှင့်တင်မှုလုပ်ငန်းများ လုပ်နိုင်လိမ့်မည် မဟုတ်ပါ။ သို့ဖြစ်၍ အစဥ်သဖြင့် ကျန်းမာနေရန် ကျွနု်ပ်တို့ ကြိုးစားကြရပါမည်။
+ကျွန်းမာရေးနှင့် ပြည့်စုံရန်အတွက် ဆောင်ရွက်ရန် နည်းလမ်းများကို သိရှိလိုက်နာရပါမည်။ အစားအသောက်၊ အအိပ်အနေ၊ လေ့ကျင့်ခန်းနှင့် သန့်ရှင်းမှုတို့သည် ကျန်းမာရေးအတွက် လိုအပ်ချက်များ ဖြစ်ပါသည်။ အစားအစာသည် အသက်ရှင်မှုအတွက် အထူးလိုအပ်ချက် ဖြစ်ပါသည်။ ကျွနု်ပ်တို့သည် အသက် ရှင်နေနိုင်ရန် အစာစားရခြင်းဖြစ်ပြီး စားသောက်ရန် အသက်ရှင်နေခြင်း မဟုတ််ပါ။ ကျန်းမာမှုအတွက် သင့်တော်သည့် ပရိုတိန်း၊ သတ္တုဓာတ်များနှင့် ဗီတာမင်များ များစွာပါ၀င်သည့် အစာများကို ရယူစားသုံးရန် လိုအပ်ပါသည်။ ကျွနု်ပ်တို့နှင့် လျှော်ကန်သင့် မြတ်မည့် အိပ်စက်အနားယူမှုမှာလည်း အရေးကြီးပါသည်။ ကျွနု်ပ်တို့၏ ခန္ဓာကိုယ်မှ ကြွက်သားများနှင့် အသားမျှင်များအား ထိန်းသိမ်းပြုပြင်မှုအတွက် အိပ်စက်ခြင်းနှင့် နားနေခြင်းတို့ အညီအမျှ လိုအပ်ပါသည်။ ထို့ကြောင့် လုံလောက်စွာ အိပ်စက်နားနေရပါမည်။
+ကိုယ်ကာယလေ့ကျင့်ခန်းများနှင့် သန့်ရှင်းမှုတို့လည်း အရေးကြီး လိုအပ်ပါသည်။ လမ်းလျှောက်ခြင်းနှင့် အိမ်တွင်း လေ့ကျင့်ခန်းများသည် အစားအသောက်စားလိုစိတ်နှင့် စိတ်ရွှင်လန်းမှုတို့ကို တိုးပွားစေပါသည်။ တစ်ကိုယ်ရေသန့်ရှင်းရေးက ကျန်းမာမှုကို အထောက်အကူပြုပါသည်။ နေ့စဥ် ရေချိုးခြင်း၊ အစာမစားမီနှင့် စားပြီးတိုင်း လက်များကို စနစ်တကျဆေးကြော ရပါမည်။
+အထက်ပါ ကျန်းမာရေး နည်းလမ်းများကို လိုက်နာဆောင်ရွက်ပါက ကျွနု်ပ်တို့ တစ်သက်တာအတွက် ကျန်းမာရေးနှင့်ပြည့်စုံနေမည်မှာ သေချာပါသည်။ ကျွနု်ပ်တို့ ကျန်းမာနေလျှင် စီးပွားဥစ္စာပြည့်စုံခြင်း၊ ပညာရေးပြည့်စုံခြင်းနှင့် အခြားအောင်မြင်မှုများကို စွမ်းဆောင်နိုင်ပါမည်။ သို့ပါ၍ ကျန်းမာခြင်းသည် ချမ်းသာခြင်းဖြစ်ကြောင်းနှင့် ကျန်းမာခြင်းသည် ချမ်းသာခြင်းထက် ပိုမိုကောင်းမွန်သည်ဟု ဆိုရမည် ဖြစ်ပါသည်။
diff --git a/Build/source/libs/graphite-engine/test/examples/khmer/cloudsku2.txt b/Build/source/libs/graphite-engine/test/examples/khmer/cloudsku2.txt new file mode 100755 index 00000000000..e9c75837a9a --- /dev/null +++ b/Build/source/libs/graphite-engine/test/examples/khmer/cloudsku2.txt @@ -0,0 +1,29 @@ +ពពក
+១-ពពកនៅលើមេឃគឺជាតំណក់ទឹកតូចៗជាច្រើន ។
+២-ពពកមើលទៅឃើញស្អាត ហើយមានប្រយោជន៍ចំញេះមនុស្សដែរ ។
+៣-ពពកគឺជាប្រភពនៃទឹកភ្លៀង ដែលរុក្ខជាតិ នឹងសត្វទាំងឡាយត្រូវការ ។
+៤-ទឹកភ្លៀងបង្អុរពីលើ "ពពក" ទៅក្នុងទន្លេដែលជាទីកន្លែងសំរាប់យើងរកត្រី ។
+៥-ទឹកអណ្ដូងរបស់យើងក៏មកពីទឹកភ្លៀងដែរ ។
+៦-យើងប្រើទឹកសំរាប់ហូប សំរាប់ដាំស្ល និងសំរាប់ងូតទឹកសំរាប់បោកគក់ ។
+៧-នៅពេលថ្ងៃ ពពកផ្ដល់ម្លប់អោយយើងពីកំដៅព្រះអាទិត្យ ។
+៨-ប្រសិនបើមានពពកនៅពេលយប់ នោះនឹង អាចការពារកំដៅពីចំហាយផែនដី ។ ហេតុដូច្នេះហើយទើបធ្វើអោយយើងមានអារម្មណ៍កក់ក្ដៅនៅពេលយប់ដែលមានពពកច្រើន ។
+៩-ពេលខ្លះពពកធ្វើអោយមានភ្លៀងធ្លាក់យ៉ាងខ្លាំង និងធ្វើអោយមានទឹកជំនន់ទឹកទន្លេជន់ឡើងយ៉ាងខ្លាំងហើយផ្ទះសំបែងជាច្រើនបានត្រូវលិចលង់ ។
+១០-ទឹកជំនន់បំផ្លិចបំផ្លាញផលដំណាំជាច្រើន ។
+១១-សត្វជាច្រើនបានលង់ទឹកស្លាប់ ។
+១២-មានផ្ទាំងដីធ្លាក់បាក់ចុះមកជាច្រើន ។
+១៣-ប៉ុន្ដែនៅទីណាដែលគ្មានពពកច្រើន ទីកន្លែងនោះខ្វះខាតទឹក និងក្លាយទៅជាវាលរហោស្ថាន ។ អត់មានដើមឈើរុក្ខជាតិរស់ ស្វតនិងមនុស្សក៏មិនអាចរស់នៅទីនោះបានដែរ ។
+
+CLOUDS
+1 The clouds in the sky are made up of little drops of water.
+2 Clouds are pretty to look at as well as useful to man.
+3 Clouds are the source of rain, which is needed by both plants and animals.
+4 Rain from the clouds fills the rivers where we get fish.
+5 Our wells are also filled by the rain that falls from the clouds.
+6 We use water for drinking, for cooking and for washing.
+7 During the day, the clouds provide shade from the heat of the sun.
+8 If there are clouds at night, they prevent the heat from the surface of the earth from rising. So that is why we feel warm on a cloudy night.
+9 Sometimes clouds bring heavy rains and floods. Rivers overflow and houses get flooded.
+10 The floods destroy crops.
+11 Animals are drowned.
+12 There are landslides.
+13 But in places where there are not many clouds, there is less water and the place becomes a desert in which no plants grow and no animals and people live.
diff --git a/Build/source/libs/graphite-engine/test/examples/khmer/mond40gr6.ttf b/Build/source/libs/graphite-engine/test/examples/khmer/mond40gr6.ttf Binary files differnew file mode 100755 index 00000000000..a4a784c9026 --- /dev/null +++ b/Build/source/libs/graphite-engine/test/examples/khmer/mond40gr6.ttf diff --git a/Build/source/libs/graphite-engine/test/fonterrors/readme.txt b/Build/source/libs/graphite-engine/test/fonterrors/readme.txt index d6f98f16347..943b2853cf6 100644 --- a/Build/source/libs/graphite-engine/test/fonterrors/readme.txt +++ b/Build/source/libs/graphite-engine/test/fonterrors/readme.txt @@ -2,7 +2,7 @@ FONTS FOR TESTING ERROR HANDLING This directory constains a set of fonts that have been deliberately corrupted in order to test Graphite's error recovery capabilities. -The "correct" behavior of the font is that vowel are rendered as lowercase, consonants as uppercase, and digits are raised vertically. For some of the fonts, recovery will be adequate to show some smart behaviors; for others the engine will revert to pure dumb rendering. +The "correct" behavior of the font is that vowels are rendered as lowercase, consonants as uppercase, and digits are raised vertically. For some of the fonts, recovery will be adequate to show some smart behaviors; for others the engine will revert to pure dumb rendering. * GrErr BadGloc - errBadGloc.ttf @@ -15,7 +15,7 @@ The "correct" behavior of the font is that vowel are rendered as lowercase, cons One of the offsets to the pass information points off to somewhere nonsensical. * GrErr BadStackMachine - errStackMachine.ttf - Extra bytes inserted into the stack machine commands for both of the substitution rules. The engine manages to recover and handle the rule correctly in this case. (Reproduce using lowercase consonants or uppercase vowels.) + Extra bytes have been inserted into the stack machine commands for both of the substitution rules. The engine manages to recover and handle the rule correctly in this case. (Reproduce using lowercase consonants or uppercase vowels.) * GrErr BadSubs - errSubs.ttf A PutSubs command references a non-existent replacement class. This causes the glyph to appear as a square box. (Reproduce using lowercase consonants or uppercase vowels.) |