2000-11-14 21:22:14 +00:00
|
|
|
/*
|
2013-02-06 07:01:19 +00:00
|
|
|
* (C) Copyright IBM Corp. and others 1998-2013 - All Rights Reserved
|
2000-11-14 21:22:14 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "LETypes.h"
|
2003-04-12 00:37:12 +00:00
|
|
|
#include "LEScripts.h"
|
|
|
|
#include "LELanguages.h"
|
2013-02-06 07:01:19 +00:00
|
|
|
#include "LESwaps.h"
|
2003-04-12 00:37:12 +00:00
|
|
|
|
2000-11-14 21:22:14 +00:00
|
|
|
#include "LayoutEngine.h"
|
|
|
|
#include "ArabicLayoutEngine.h"
|
2004-05-03 21:13:13 +00:00
|
|
|
#include "CanonShaping.h"
|
2003-04-12 00:37:12 +00:00
|
|
|
#include "HanLayoutEngine.h"
|
2006-02-21 17:13:48 +00:00
|
|
|
#include "HangulLayoutEngine.h"
|
2000-11-14 21:22:14 +00:00
|
|
|
#include "IndicLayoutEngine.h"
|
2004-12-21 19:15:07 +00:00
|
|
|
#include "KhmerLayoutEngine.h"
|
2000-11-14 21:22:14 +00:00
|
|
|
#include "ThaiLayoutEngine.h"
|
2005-09-02 21:08:38 +00:00
|
|
|
#include "TibetanLayoutEngine.h"
|
2000-11-14 21:22:14 +00:00
|
|
|
#include "GXLayoutEngine.h"
|
2013-02-06 07:01:19 +00:00
|
|
|
#include "GXLayoutEngine2.h"
|
|
|
|
|
2000-11-14 21:22:14 +00:00
|
|
|
#include "ScriptAndLanguageTags.h"
|
2004-05-03 21:13:13 +00:00
|
|
|
#include "CharSubstitutionFilter.h"
|
2000-11-14 21:22:14 +00:00
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
#include "LEGlyphStorage.h"
|
|
|
|
|
2000-11-14 21:22:14 +00:00
|
|
|
#include "OpenTypeUtilities.h"
|
|
|
|
#include "GlyphSubstitutionTables.h"
|
2007-06-22 03:57:45 +00:00
|
|
|
#include "GlyphDefinitionTables.h"
|
2000-11-14 21:22:14 +00:00
|
|
|
#include "MorphTables.h"
|
|
|
|
|
2001-09-20 00:37:55 +00:00
|
|
|
#include "DefaultCharMapper.h"
|
2000-11-14 21:22:14 +00:00
|
|
|
|
2005-01-14 19:22:53 +00:00
|
|
|
#include "KernTable.h"
|
|
|
|
|
2001-10-16 00:39:01 +00:00
|
|
|
U_NAMESPACE_BEGIN
|
|
|
|
|
2007-05-23 23:56:20 +00:00
|
|
|
/* Leave this copyright notice here! It needs to go somewhere in this library. */
|
|
|
|
static const char copyright[] = U_COPYRIGHT_STRING;
|
|
|
|
|
2013-02-06 07:01:19 +00:00
|
|
|
/* TODO: remove these? */
|
|
|
|
const le_int32 LayoutEngine::kTypoFlagKern = LE_Kerning_FEATURE_FLAG;
|
|
|
|
const le_int32 LayoutEngine::kTypoFlagLiga = LE_Ligatures_FEATURE_FLAG;
|
2011-03-21 20:48:42 +00:00
|
|
|
|
2002-03-27 00:34:56 +00:00
|
|
|
const LEUnicode32 DefaultCharMapper::controlChars[] = {
|
2000-11-14 21:22:14 +00:00
|
|
|
0x0009, 0x000A, 0x000D,
|
|
|
|
/*0x200C, 0x200D,*/ 0x200E, 0x200F,
|
|
|
|
0x2028, 0x2029, 0x202A, 0x202B, 0x202C, 0x202D, 0x202E,
|
|
|
|
0x206A, 0x206B, 0x206C, 0x206D, 0x206E, 0x206F
|
|
|
|
};
|
|
|
|
|
2005-08-06 00:48:27 +00:00
|
|
|
const le_int32 DefaultCharMapper::controlCharsCount = LE_ARRAY_SIZE(controlChars);
|
2000-11-14 21:22:14 +00:00
|
|
|
|
2000-12-21 01:18:44 +00:00
|
|
|
LEUnicode32 DefaultCharMapper::mapChar(LEUnicode32 ch) const
|
2000-11-14 21:22:14 +00:00
|
|
|
{
|
|
|
|
if (fFilterControls) {
|
2000-12-21 01:18:44 +00:00
|
|
|
le_int32 index = OpenTypeUtilities::search((le_uint32)ch, (le_uint32 *)controlChars, controlCharsCount);
|
2000-11-14 21:22:14 +00:00
|
|
|
|
|
|
|
if (controlChars[index] == ch) {
|
|
|
|
return 0xFFFF;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (fMirror) {
|
2005-07-20 18:42:47 +00:00
|
|
|
le_int32 index = OpenTypeUtilities::search((le_uint32) ch, (le_uint32 *)DefaultCharMapper::mirroredChars, DefaultCharMapper::mirroredCharsCount);
|
2000-11-14 21:22:14 +00:00
|
|
|
|
|
|
|
if (mirroredChars[index] == ch) {
|
2005-07-20 18:42:47 +00:00
|
|
|
return DefaultCharMapper::srahCderorrim[index];
|
2000-11-14 21:22:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return ch;
|
|
|
|
}
|
|
|
|
|
2003-09-03 18:27:07 +00:00
|
|
|
// This is here to get it out of LEGlyphFilter.h.
|
|
|
|
// No particular reason to put it here, other than
|
|
|
|
// this is a good central location...
|
|
|
|
LEGlyphFilter::~LEGlyphFilter()
|
|
|
|
{
|
2004-05-07 23:29:16 +00:00
|
|
|
// nothing to do
|
2003-09-03 18:27:07 +00:00
|
|
|
}
|
|
|
|
|
2004-05-03 21:13:13 +00:00
|
|
|
CharSubstitutionFilter::CharSubstitutionFilter(const LEFontInstance *fontInstance)
|
|
|
|
: fFontInstance(fontInstance)
|
|
|
|
{
|
|
|
|
// nothing to do
|
|
|
|
}
|
|
|
|
|
|
|
|
CharSubstitutionFilter::~CharSubstitutionFilter()
|
|
|
|
{
|
|
|
|
// nothing to do
|
|
|
|
}
|
|
|
|
|
2007-06-22 03:57:45 +00:00
|
|
|
class CanonMarkFilter : public UMemory, public LEGlyphFilter
|
|
|
|
{
|
|
|
|
private:
|
2013-04-18 21:24:51 +00:00
|
|
|
const LEReferenceTo<GlyphClassDefinitionTable> classDefTable;
|
2007-06-22 03:57:45 +00:00
|
|
|
|
|
|
|
CanonMarkFilter(const CanonMarkFilter &other); // forbid copying of this class
|
|
|
|
CanonMarkFilter &operator=(const CanonMarkFilter &other); // forbid copying of this class
|
|
|
|
|
|
|
|
public:
|
2013-04-18 21:24:51 +00:00
|
|
|
CanonMarkFilter(const LEReferenceTo<GlyphDefinitionTableHeader> &gdefTable, LEErrorCode &success);
|
2007-06-22 03:57:45 +00:00
|
|
|
virtual ~CanonMarkFilter();
|
|
|
|
|
|
|
|
virtual le_bool accept(LEGlyphID glyph) const;
|
|
|
|
};
|
|
|
|
|
2013-04-18 21:24:51 +00:00
|
|
|
CanonMarkFilter::CanonMarkFilter(const LEReferenceTo<GlyphDefinitionTableHeader> &gdefTable, LEErrorCode &success)
|
|
|
|
: classDefTable(gdefTable->getMarkAttachClassDefinitionTable(gdefTable, success))
|
2007-06-22 03:57:45 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
CanonMarkFilter::~CanonMarkFilter()
|
|
|
|
{
|
|
|
|
// nothing to do?
|
|
|
|
}
|
|
|
|
|
|
|
|
le_bool CanonMarkFilter::accept(LEGlyphID glyph) const
|
|
|
|
{
|
2013-04-18 21:24:51 +00:00
|
|
|
LEErrorCode success = LE_NO_ERROR;
|
|
|
|
le_int32 glyphClass = classDefTable->getGlyphClass(classDefTable, glyph, success);
|
|
|
|
if(LE_FAILURE(success)) return false;
|
|
|
|
return glyphClass != 0;
|
2007-06-22 03:57:45 +00:00
|
|
|
}
|
2004-05-03 21:13:13 +00:00
|
|
|
|
2004-10-19 06:25:41 +00:00
|
|
|
UOBJECT_DEFINE_RTTI_IMPLEMENTATION(LayoutEngine)
|
2002-06-29 00:04:16 +00:00
|
|
|
|
2005-08-06 00:48:27 +00:00
|
|
|
#define ccmpFeatureTag LE_CCMP_FEATURE_TAG
|
|
|
|
|
2005-08-15 23:35:16 +00:00
|
|
|
#define ccmpFeatureMask 0x80000000UL
|
2005-08-06 00:48:27 +00:00
|
|
|
|
|
|
|
#define canonFeatures (ccmpFeatureMask)
|
2004-05-03 21:13:13 +00:00
|
|
|
|
2005-08-06 00:48:27 +00:00
|
|
|
static const FeatureMap canonFeatureMap[] =
|
|
|
|
{
|
|
|
|
{ccmpFeatureTag, ccmpFeatureMask}
|
|
|
|
};
|
2004-05-03 21:13:13 +00:00
|
|
|
|
2005-08-06 00:48:27 +00:00
|
|
|
static const le_int32 canonFeatureMapCount = LE_ARRAY_SIZE(canonFeatureMap);
|
2004-05-03 21:13:13 +00:00
|
|
|
|
2013-02-06 07:01:19 +00:00
|
|
|
LayoutEngine::LayoutEngine(const LEFontInstance *fontInstance,
|
|
|
|
le_int32 scriptCode,
|
|
|
|
le_int32 languageCode,
|
2008-12-02 17:17:15 +00:00
|
|
|
le_int32 typoFlags,
|
|
|
|
LEErrorCode &success)
|
2005-01-14 19:22:53 +00:00
|
|
|
: fGlyphStorage(NULL), fFontInstance(fontInstance), fScriptCode(scriptCode), fLanguageCode(languageCode),
|
2008-03-14 23:18:26 +00:00
|
|
|
fTypoFlags(typoFlags), fFilterZeroWidth(TRUE)
|
2000-11-14 21:22:14 +00:00
|
|
|
{
|
2008-12-02 17:17:15 +00:00
|
|
|
if (LE_FAILURE(success)) {
|
|
|
|
return;
|
2013-02-06 07:01:19 +00:00
|
|
|
}
|
2000-11-14 21:22:14 +00:00
|
|
|
|
2008-12-02 17:17:15 +00:00
|
|
|
fGlyphStorage = new LEGlyphStorage();
|
|
|
|
if (fGlyphStorage == NULL) {
|
|
|
|
success = LE_MEMORY_ALLOCATION_ERROR;
|
|
|
|
}
|
2008-10-28 14:50:15 +00:00
|
|
|
}
|
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
le_int32 LayoutEngine::getGlyphCount() const
|
2000-11-14 21:22:14 +00:00
|
|
|
{
|
2004-04-12 18:51:31 +00:00
|
|
|
return fGlyphStorage->getGlyphCount();
|
2004-12-30 07:25:51 +00:00
|
|
|
}
|
2000-12-21 01:18:44 +00:00
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
void LayoutEngine::getCharIndices(le_int32 charIndices[], le_int32 indexBase, LEErrorCode &success) const
|
|
|
|
{
|
2004-05-07 23:29:16 +00:00
|
|
|
fGlyphStorage->getCharIndices(charIndices, indexBase, success);
|
2000-11-14 21:22:14 +00:00
|
|
|
}
|
|
|
|
|
2003-06-04 22:39:17 +00:00
|
|
|
void LayoutEngine::getCharIndices(le_int32 charIndices[], LEErrorCode &success) const
|
|
|
|
{
|
2004-05-07 23:29:16 +00:00
|
|
|
fGlyphStorage->getCharIndices(charIndices, success);
|
2003-06-04 22:39:17 +00:00
|
|
|
}
|
|
|
|
|
2000-11-14 21:22:14 +00:00
|
|
|
// Copy the glyphs into caller's (32-bit) glyph array, OR in extraBits
|
2000-12-21 01:18:44 +00:00
|
|
|
void LayoutEngine::getGlyphs(le_uint32 glyphs[], le_uint32 extraBits, LEErrorCode &success) const
|
2000-11-14 21:22:14 +00:00
|
|
|
{
|
2004-05-07 23:29:16 +00:00
|
|
|
fGlyphStorage->getGlyphs(glyphs, extraBits, success);
|
2003-06-04 22:39:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void LayoutEngine::getGlyphs(LEGlyphID glyphs[], LEErrorCode &success) const
|
|
|
|
{
|
2004-05-07 23:29:16 +00:00
|
|
|
fGlyphStorage->getGlyphs(glyphs, success);
|
2003-06-04 22:39:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void LayoutEngine::getGlyphPositions(float positions[], LEErrorCode &success) const
|
|
|
|
{
|
2004-05-07 23:29:16 +00:00
|
|
|
fGlyphStorage->getGlyphPositions(positions, success);
|
2003-06-04 22:39:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void LayoutEngine::getGlyphPosition(le_int32 glyphIndex, float &x, float &y, LEErrorCode &success) const
|
|
|
|
{
|
2004-05-07 23:29:16 +00:00
|
|
|
fGlyphStorage->getGlyphPosition(glyphIndex, x, y, success);
|
2003-06-04 22:39:17 +00:00
|
|
|
}
|
|
|
|
|
2004-05-03 21:13:13 +00:00
|
|
|
le_int32 LayoutEngine::characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,
|
2008-06-04 00:28:58 +00:00
|
|
|
LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success)
|
2004-05-03 21:13:13 +00:00
|
|
|
{
|
|
|
|
if (LE_FAILURE(success)) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (offset < 0 || count < 0 || max < 0 || offset >= max || offset + count > max) {
|
|
|
|
success = LE_ILLEGAL_ARGUMENT_ERROR;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2013-04-18 21:24:51 +00:00
|
|
|
LEReferenceTo<GlyphSubstitutionTableHeader> canonGSUBTable((GlyphSubstitutionTableHeader *) CanonShaping::glyphSubstitutionTable);
|
2004-05-03 21:13:13 +00:00
|
|
|
LETag scriptTag = OpenTypeLayoutEngine::getScriptTag(fScriptCode);
|
|
|
|
LETag langSysTag = OpenTypeLayoutEngine::getLangSysTag(fLanguageCode);
|
|
|
|
le_int32 i, dir = 1, out = 0, outCharCount = count;
|
|
|
|
|
2013-04-18 21:24:51 +00:00
|
|
|
if (canonGSUBTable->coversScript(canonGSUBTable,scriptTag, success) || LE_SUCCESS(success)) {
|
2004-05-03 21:13:13 +00:00
|
|
|
CharSubstitutionFilter *substitutionFilter = new CharSubstitutionFilter(fFontInstance);
|
2013-02-06 07:01:19 +00:00
|
|
|
if (substitutionFilter == NULL) {
|
2008-10-28 14:50:15 +00:00
|
|
|
success = LE_MEMORY_ALLOCATION_ERROR;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2013-04-18 21:24:51 +00:00
|
|
|
const LEUnicode *inChars = &chars[offset];
|
|
|
|
LEUnicode *reordered = NULL;
|
2005-11-18 01:37:28 +00:00
|
|
|
LEGlyphStorage fakeGlyphStorage;
|
|
|
|
|
|
|
|
fakeGlyphStorage.allocateGlyphArray(count, rightToLeft, success);
|
|
|
|
|
|
|
|
if (LE_FAILURE(success)) {
|
2008-10-28 14:50:15 +00:00
|
|
|
delete substitutionFilter;
|
2005-11-18 01:37:28 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2005-03-17 02:14:54 +00:00
|
|
|
|
2013-04-18 21:24:51 +00:00
|
|
|
// This is the cheapest way to get mark reordering only for Hebrew.
|
|
|
|
// We could just do the mark reordering for all scripts, but most
|
|
|
|
// of them probably don't need it...
|
|
|
|
if (fScriptCode == hebrScriptCode) {
|
|
|
|
reordered = LE_NEW_ARRAY(LEUnicode, count);
|
|
|
|
|
|
|
|
if (reordered == NULL) {
|
|
|
|
delete substitutionFilter;
|
|
|
|
success = LE_MEMORY_ALLOCATION_ERROR;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
CanonShaping::reorderMarks(&chars[offset], count, rightToLeft, reordered, fakeGlyphStorage);
|
|
|
|
inChars = reordered;
|
2005-11-18 01:37:28 +00:00
|
|
|
}
|
2004-05-03 21:13:13 +00:00
|
|
|
|
2005-11-18 01:37:28 +00:00
|
|
|
fakeGlyphStorage.allocateAuxData(success);
|
2004-05-03 21:13:13 +00:00
|
|
|
|
|
|
|
if (LE_FAILURE(success)) {
|
2008-10-28 14:50:15 +00:00
|
|
|
delete substitutionFilter;
|
2004-05-03 21:13:13 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2004-08-19 23:51:11 +00:00
|
|
|
if (rightToLeft) {
|
|
|
|
out = count - 1;
|
|
|
|
dir = -1;
|
|
|
|
}
|
|
|
|
|
2004-05-03 21:13:13 +00:00
|
|
|
for (i = 0; i < count; i += 1, out += dir) {
|
2005-11-18 01:37:28 +00:00
|
|
|
fakeGlyphStorage[out] = (LEGlyphID) inChars[i];
|
|
|
|
fakeGlyphStorage.setAuxData(out, canonFeatures, success);
|
2004-05-03 21:13:13 +00:00
|
|
|
}
|
|
|
|
|
2013-04-18 21:24:51 +00:00
|
|
|
if (reordered != NULL) {
|
|
|
|
LE_DELETE_ARRAY(reordered);
|
|
|
|
}
|
2005-03-17 02:14:54 +00:00
|
|
|
|
2013-04-18 21:24:51 +00:00
|
|
|
outCharCount = canonGSUBTable->process(canonGSUBTable, fakeGlyphStorage, rightToLeft, scriptTag, langSysTag, (const GlyphDefinitionTableHeader*)NULL, substitutionFilter, canonFeatureMap, canonFeatureMapCount, FALSE, success);
|
2008-10-28 14:50:15 +00:00
|
|
|
|
|
|
|
if (LE_FAILURE(success)) {
|
|
|
|
delete substitutionFilter;
|
|
|
|
return 0;
|
|
|
|
}
|
2004-05-03 21:13:13 +00:00
|
|
|
|
2005-11-18 01:37:28 +00:00
|
|
|
out = (rightToLeft? outCharCount - 1 : 0);
|
2004-08-19 23:51:11 +00:00
|
|
|
|
2008-06-04 00:28:58 +00:00
|
|
|
/*
|
|
|
|
* The char indices array in fakeGlyphStorage has the correct mapping
|
|
|
|
* back to the original input characters. Save it in glyphStorage. The
|
|
|
|
* subsequent call to glyphStoratge.allocateGlyphArray will keep this
|
|
|
|
* array rather than allocating and initializing a new one.
|
|
|
|
*/
|
|
|
|
glyphStorage.adoptCharIndicesArray(fakeGlyphStorage);
|
|
|
|
|
2004-05-03 21:13:13 +00:00
|
|
|
outChars = LE_NEW_ARRAY(LEUnicode, outCharCount);
|
2008-10-28 14:50:15 +00:00
|
|
|
|
|
|
|
if (outChars == NULL) {
|
|
|
|
delete substitutionFilter;
|
|
|
|
success = LE_MEMORY_ALLOCATION_ERROR;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2004-08-19 23:51:11 +00:00
|
|
|
for (i = 0; i < outCharCount; i += 1, out += dir) {
|
2005-11-18 01:37:28 +00:00
|
|
|
outChars[out] = (LEUnicode) LE_GET_GLYPH(fakeGlyphStorage[i]);
|
2004-05-03 21:13:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
delete substitutionFilter;
|
|
|
|
}
|
|
|
|
|
|
|
|
return outCharCount;
|
|
|
|
}
|
2000-11-14 21:22:14 +00:00
|
|
|
|
|
|
|
le_int32 LayoutEngine::computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,
|
2004-04-12 18:51:31 +00:00
|
|
|
LEGlyphStorage &glyphStorage, LEErrorCode &success)
|
2000-11-14 21:22:14 +00:00
|
|
|
{
|
2002-03-27 00:34:56 +00:00
|
|
|
if (LE_FAILURE(success)) {
|
|
|
|
return 0;
|
|
|
|
}
|
2000-12-21 01:18:44 +00:00
|
|
|
|
2002-03-27 00:34:56 +00:00
|
|
|
if (chars == NULL || offset < 0 || count < 0 || max < 0 || offset >= max || offset + count > max) {
|
|
|
|
success = LE_ILLEGAL_ARGUMENT_ERROR;
|
|
|
|
return 0;
|
|
|
|
}
|
2000-12-21 01:18:44 +00:00
|
|
|
|
2004-05-03 21:13:13 +00:00
|
|
|
LEUnicode *outChars = NULL;
|
|
|
|
le_int32 outCharCount = characterProcessing(chars, offset, count, max, rightToLeft, outChars, glyphStorage, success);
|
|
|
|
|
|
|
|
if (outChars != NULL) {
|
2007-01-24 22:45:49 +00:00
|
|
|
mapCharsToGlyphs(outChars, 0, outCharCount, rightToLeft, rightToLeft, glyphStorage, success);
|
2004-05-03 21:13:13 +00:00
|
|
|
LE_DELETE_ARRAY(outChars); // FIXME: a subclass may have allocated this, in which case this delete might not work...
|
|
|
|
} else {
|
2007-01-24 22:45:49 +00:00
|
|
|
mapCharsToGlyphs(chars, offset, count, rightToLeft, rightToLeft, glyphStorage, success);
|
2004-05-03 21:13:13 +00:00
|
|
|
}
|
2000-11-14 21:22:14 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
return glyphStorage.getGlyphCount();
|
2000-11-14 21:22:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Input: glyphs
|
|
|
|
// Output: positions
|
2004-04-12 18:51:31 +00:00
|
|
|
void LayoutEngine::positionGlyphs(LEGlyphStorage &glyphStorage, float x, float y, LEErrorCode &success)
|
2000-11-14 21:22:14 +00:00
|
|
|
{
|
2002-03-27 00:34:56 +00:00
|
|
|
if (LE_FAILURE(success)) {
|
|
|
|
return;
|
|
|
|
}
|
2000-12-21 01:18:44 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
glyphStorage.allocatePositions(success);
|
2000-12-21 01:18:44 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
if (LE_FAILURE(success)) {
|
|
|
|
return;
|
|
|
|
}
|
2000-12-21 01:18:44 +00:00
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
le_int32 i, glyphCount = glyphStorage.getGlyphCount();
|
2000-11-14 21:22:14 +00:00
|
|
|
|
|
|
|
for (i = 0; i < glyphCount; i += 1) {
|
|
|
|
LEPoint advance;
|
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
glyphStorage.setPosition(i, x, y, success);
|
2000-11-14 21:22:14 +00:00
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
fFontInstance->getGlyphAdvance(glyphStorage[i], advance);
|
2000-11-14 21:22:14 +00:00
|
|
|
x += advance.fX;
|
|
|
|
y += advance.fY;
|
|
|
|
}
|
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
glyphStorage.setPosition(glyphCount, x, y, success);
|
2000-11-14 21:22:14 +00:00
|
|
|
}
|
|
|
|
|
2007-06-22 03:57:45 +00:00
|
|
|
void LayoutEngine::adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse,
|
2005-01-14 19:22:53 +00:00
|
|
|
LEGlyphStorage &glyphStorage, LEErrorCode &success)
|
2003-09-03 18:27:07 +00:00
|
|
|
{
|
|
|
|
if (LE_FAILURE(success)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
if (chars == NULL || offset < 0 || count < 0) {
|
2003-09-03 18:27:07 +00:00
|
|
|
success = LE_ILLEGAL_ARGUMENT_ERROR;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-04-18 21:24:51 +00:00
|
|
|
LEReferenceTo<GlyphDefinitionTableHeader> gdefTable((GlyphDefinitionTableHeader *) CanonShaping::glyphDefinitionTable,
|
|
|
|
CanonShaping::glyphDefinitionTableLen);
|
|
|
|
CanonMarkFilter filter(gdefTable, success);
|
2007-06-22 03:57:45 +00:00
|
|
|
|
|
|
|
adjustMarkGlyphs(&chars[offset], count, reverse, glyphStorage, &filter, success);
|
|
|
|
|
2013-04-18 21:24:51 +00:00
|
|
|
if (fTypoFlags & LE_Kerning_FEATURE_FLAG) { /* kerning enabled */
|
|
|
|
LETableReference kernTable(fFontInstance, LE_KERN_TABLE_TAG, success);
|
|
|
|
KernTable kt(kernTable, success);
|
|
|
|
kt.process(glyphStorage, success);
|
2005-01-14 19:22:53 +00:00
|
|
|
}
|
|
|
|
|
2003-09-03 18:27:07 +00:00
|
|
|
// default is no adjustments
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
void LayoutEngine::adjustMarkGlyphs(LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success)
|
2000-11-14 21:22:14 +00:00
|
|
|
{
|
|
|
|
float xAdjust = 0;
|
2004-04-12 18:51:31 +00:00
|
|
|
le_int32 p, glyphCount = glyphStorage.getGlyphCount();
|
2000-11-14 21:22:14 +00:00
|
|
|
|
2002-03-27 00:34:56 +00:00
|
|
|
if (LE_FAILURE(success)) {
|
|
|
|
return;
|
|
|
|
}
|
2000-12-21 01:18:44 +00:00
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
if (markFilter == NULL) {
|
2002-03-27 00:34:56 +00:00
|
|
|
success = LE_ILLEGAL_ARGUMENT_ERROR;
|
|
|
|
return;
|
|
|
|
}
|
2000-12-21 01:18:44 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
float ignore, prev;
|
2000-11-14 21:22:14 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
glyphStorage.getGlyphPosition(0, prev, ignore, success);
|
2000-11-14 21:22:14 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
for (p = 0; p < glyphCount; p += 1) {
|
|
|
|
float next, xAdvance;
|
2013-02-06 07:01:19 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
glyphStorage.getGlyphPosition(p + 1, next, ignore, success);
|
2000-11-14 21:22:14 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
xAdvance = next - prev;
|
|
|
|
glyphStorage.adjustPosition(p, xAdjust, 0, success);
|
2000-11-14 21:22:14 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
if (markFilter->accept(glyphStorage[p])) {
|
|
|
|
xAdjust -= xAdvance;
|
|
|
|
}
|
2000-11-14 21:22:14 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
prev = next;
|
|
|
|
}
|
2004-04-12 18:51:31 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
glyphStorage.adjustPosition(glyphCount, xAdjust, 0, success);
|
2000-12-21 01:18:44 +00:00
|
|
|
}
|
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
void LayoutEngine::adjustMarkGlyphs(const LEUnicode chars[], le_int32 charCount, le_bool reverse, LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success)
|
2000-11-14 21:22:14 +00:00
|
|
|
{
|
2004-04-12 18:51:31 +00:00
|
|
|
float xAdjust = 0;
|
|
|
|
le_int32 c = 0, direction = 1, p;
|
2004-05-07 23:29:16 +00:00
|
|
|
le_int32 glyphCount = glyphStorage.getGlyphCount();
|
2004-04-12 18:51:31 +00:00
|
|
|
|
2002-03-27 00:34:56 +00:00
|
|
|
if (LE_FAILURE(success)) {
|
|
|
|
return;
|
|
|
|
}
|
2000-12-21 01:18:44 +00:00
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
if (markFilter == NULL) {
|
2002-03-27 00:34:56 +00:00
|
|
|
success = LE_ILLEGAL_ARGUMENT_ERROR;
|
|
|
|
return;
|
|
|
|
}
|
2000-12-21 01:18:44 +00:00
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
if (reverse) {
|
|
|
|
c = glyphCount - 1;
|
|
|
|
direction = -1;
|
2000-11-14 21:22:14 +00:00
|
|
|
}
|
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
float ignore, prev;
|
2000-11-14 21:22:14 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
glyphStorage.getGlyphPosition(0, prev, ignore, success);
|
2000-11-14 21:22:14 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
for (p = 0; p < charCount; p += 1, c += direction) {
|
|
|
|
float next, xAdvance;
|
2013-02-06 07:01:19 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
glyphStorage.getGlyphPosition(p + 1, next, ignore, success);
|
2000-11-14 21:22:14 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
xAdvance = next - prev;
|
|
|
|
glyphStorage.adjustPosition(p, xAdjust, 0, success);
|
2000-12-21 01:18:44 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
if (markFilter->accept(chars[c])) {
|
|
|
|
xAdjust -= xAdvance;
|
|
|
|
}
|
2004-04-12 18:51:31 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
prev = next;
|
|
|
|
}
|
2004-04-12 18:51:31 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
glyphStorage.adjustPosition(glyphCount, xAdjust, 0, success);
|
2004-04-12 18:51:31 +00:00
|
|
|
}
|
|
|
|
|
2013-04-18 21:24:51 +00:00
|
|
|
const void *LayoutEngine::getFontTable(LETag tableTag, size_t &length) const
|
2004-04-12 18:51:31 +00:00
|
|
|
{
|
2013-04-18 21:24:51 +00:00
|
|
|
return fFontInstance->getFontTable(tableTag, length);
|
2004-04-12 18:51:31 +00:00
|
|
|
}
|
|
|
|
|
2007-01-24 22:45:49 +00:00
|
|
|
void LayoutEngine::mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, le_bool mirror,
|
2004-04-12 18:51:31 +00:00
|
|
|
LEGlyphStorage &glyphStorage, LEErrorCode &success)
|
|
|
|
{
|
|
|
|
if (LE_FAILURE(success)) {
|
|
|
|
return;
|
2000-11-14 21:22:14 +00:00
|
|
|
}
|
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
glyphStorage.allocateGlyphArray(count, reverse, success);
|
2004-04-12 18:51:31 +00:00
|
|
|
|
2007-01-25 19:57:43 +00:00
|
|
|
DefaultCharMapper charMapper(TRUE, mirror);
|
2000-11-14 21:22:14 +00:00
|
|
|
|
2007-01-25 19:57:43 +00:00
|
|
|
fFontInstance->mapCharsToGlyphs(chars, offset, count, reverse, &charMapper, fFilterZeroWidth, glyphStorage);
|
2000-11-14 21:22:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Input: characters, font?
|
|
|
|
// Output: glyphs, positions, char indices
|
|
|
|
// Returns: number of glyphs
|
|
|
|
le_int32 LayoutEngine::layoutChars(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,
|
2000-12-21 01:18:44 +00:00
|
|
|
float x, float y, LEErrorCode &success)
|
2000-11-14 21:22:14 +00:00
|
|
|
{
|
2002-03-27 00:34:56 +00:00
|
|
|
if (LE_FAILURE(success)) {
|
|
|
|
return 0;
|
|
|
|
}
|
2000-12-21 01:18:44 +00:00
|
|
|
|
2002-03-27 00:34:56 +00:00
|
|
|
if (chars == NULL || offset < 0 || count < 0 || max < 0 || offset >= max || offset + count > max) {
|
|
|
|
success = LE_ILLEGAL_ARGUMENT_ERROR;
|
|
|
|
return 0;
|
|
|
|
}
|
2000-12-21 01:18:44 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
le_int32 glyphCount;
|
2006-07-31 21:03:36 +00:00
|
|
|
|
|
|
|
if (fGlyphStorage->getGlyphCount() > 0) {
|
|
|
|
fGlyphStorage->reset();
|
|
|
|
}
|
2013-02-06 07:01:19 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
glyphCount = computeGlyphs(chars, offset, count, max, rightToLeft, *fGlyphStorage, success);
|
|
|
|
positionGlyphs(*fGlyphStorage, x, y, success);
|
|
|
|
adjustGlyphPositions(chars, offset, count, rightToLeft, *fGlyphStorage, success);
|
2000-11-14 21:22:14 +00:00
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
return glyphCount;
|
2000-11-14 21:22:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void LayoutEngine::reset()
|
|
|
|
{
|
2013-04-18 21:24:51 +00:00
|
|
|
if(fGlyphStorage!=NULL) {
|
2004-04-12 18:51:31 +00:00
|
|
|
fGlyphStorage->reset();
|
2013-04-18 21:24:51 +00:00
|
|
|
}
|
2000-11-14 21:22:14 +00:00
|
|
|
}
|
2013-02-06 07:01:19 +00:00
|
|
|
|
2000-12-21 01:18:44 +00:00
|
|
|
LayoutEngine *LayoutEngine::layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, LEErrorCode &success)
|
2005-01-14 19:22:53 +00:00
|
|
|
{
|
2013-04-18 21:24:51 +00:00
|
|
|
//kerning and ligatures - by default
|
|
|
|
return LayoutEngine::layoutEngineFactory(fontInstance, scriptCode, languageCode, LE_DEFAULT_FEATURE_FLAG, success);
|
2005-01-14 19:22:53 +00:00
|
|
|
}
|
2013-02-06 07:01:19 +00:00
|
|
|
|
2005-01-14 19:22:53 +00:00
|
|
|
LayoutEngine *LayoutEngine::layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags, LEErrorCode &success)
|
2000-11-14 21:22:14 +00:00
|
|
|
{
|
2004-10-19 06:47:21 +00:00
|
|
|
static const le_uint32 gsubTableTag = LE_GSUB_TABLE_TAG;
|
|
|
|
static const le_uint32 mortTableTag = LE_MORT_TABLE_TAG;
|
2013-02-06 07:01:19 +00:00
|
|
|
static const le_uint32 morxTableTag = LE_MORX_TABLE_TAG;
|
2000-12-21 01:18:44 +00:00
|
|
|
|
2002-03-27 00:34:56 +00:00
|
|
|
if (LE_FAILURE(success)) {
|
|
|
|
return NULL;
|
|
|
|
}
|
2000-12-21 01:18:44 +00:00
|
|
|
|
2013-04-18 21:24:51 +00:00
|
|
|
LEReferenceTo<GlyphSubstitutionTableHeader> gsubTable(fontInstance,gsubTableTag,success);
|
2002-03-27 00:34:56 +00:00
|
|
|
LayoutEngine *result = NULL;
|
2003-04-12 00:37:12 +00:00
|
|
|
LETag scriptTag = 0x00000000;
|
|
|
|
LETag languageTag = 0x00000000;
|
2013-04-18 21:24:51 +00:00
|
|
|
LETag v2ScriptTag = OpenTypeLayoutEngine::getV2ScriptTag(scriptCode);
|
2000-11-14 21:22:14 +00:00
|
|
|
|
2009-03-02 23:35:48 +00:00
|
|
|
// Right now, only invoke V2 processing for Devanagari. TODO: Allow more V2 scripts as they are
|
|
|
|
// properly tested.
|
|
|
|
|
2013-04-18 21:24:51 +00:00
|
|
|
if ( v2ScriptTag == dev2ScriptTag && gsubTable.isValid() && gsubTable->coversScript(gsubTable, v2ScriptTag, success )) {
|
|
|
|
result = new IndicOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, TRUE, gsubTable, success);
|
|
|
|
}
|
|
|
|
else if (gsubTable.isValid() && gsubTable->coversScript(gsubTable, scriptTag = OpenTypeLayoutEngine::getScriptTag(scriptCode), success)) {
|
2000-11-14 21:22:14 +00:00
|
|
|
switch (scriptCode) {
|
|
|
|
case bengScriptCode:
|
|
|
|
case devaScriptCode:
|
|
|
|
case gujrScriptCode:
|
|
|
|
case kndaScriptCode:
|
|
|
|
case mlymScriptCode:
|
|
|
|
case oryaScriptCode:
|
2001-09-20 00:37:55 +00:00
|
|
|
case guruScriptCode:
|
2000-11-14 21:22:14 +00:00
|
|
|
case tamlScriptCode:
|
|
|
|
case teluScriptCode:
|
2005-07-28 20:56:04 +00:00
|
|
|
case sinhScriptCode:
|
2009-03-02 23:35:48 +00:00
|
|
|
result = new IndicOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, FALSE, gsubTable, success);
|
2002-03-27 00:34:56 +00:00
|
|
|
break;
|
2000-11-14 21:22:14 +00:00
|
|
|
|
|
|
|
case arabScriptCode:
|
2008-12-02 17:17:15 +00:00
|
|
|
result = new ArabicOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable, success);
|
2002-03-27 00:34:56 +00:00
|
|
|
break;
|
2000-11-14 21:22:14 +00:00
|
|
|
|
2011-03-21 20:48:42 +00:00
|
|
|
case hebrScriptCode:
|
|
|
|
// Disable hebrew ligatures since they have only archaic uses, see ticket #8318
|
|
|
|
result = new OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags & ~kTypoFlagLiga, gsubTable, success);
|
|
|
|
break;
|
|
|
|
|
2006-02-21 17:13:48 +00:00
|
|
|
case hangScriptCode:
|
2008-12-02 17:17:15 +00:00
|
|
|
result = new HangulOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable, success);
|
2006-02-21 17:13:48 +00:00
|
|
|
break;
|
|
|
|
|
2003-04-12 00:37:12 +00:00
|
|
|
case haniScriptCode:
|
|
|
|
languageTag = OpenTypeLayoutEngine::getLangSysTag(languageCode);
|
|
|
|
|
|
|
|
switch (languageCode) {
|
|
|
|
case korLanguageCode:
|
|
|
|
case janLanguageCode:
|
|
|
|
case zhtLanguageCode:
|
|
|
|
case zhsLanguageCode:
|
2013-04-18 21:24:51 +00:00
|
|
|
if (gsubTable->coversScriptAndLanguage(gsubTable, scriptTag, languageTag, success, TRUE)) {
|
2008-12-02 17:17:15 +00:00
|
|
|
result = new HanOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable, success);
|
2003-04-12 00:37:12 +00:00
|
|
|
break;
|
2013-04-18 21:24:51 +00:00
|
|
|
}
|
2003-04-12 00:37:12 +00:00
|
|
|
|
|
|
|
// note: falling through to default case.
|
|
|
|
default:
|
2008-12-02 17:17:15 +00:00
|
|
|
result = new OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable, success);
|
2003-04-12 00:37:12 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
2005-09-02 18:22:09 +00:00
|
|
|
|
2005-08-25 22:20:16 +00:00
|
|
|
case tibtScriptCode:
|
2008-12-02 17:17:15 +00:00
|
|
|
result = new TibetanOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable, success);
|
2005-08-25 22:20:16 +00:00
|
|
|
break;
|
|
|
|
|
2004-12-21 19:15:07 +00:00
|
|
|
case khmrScriptCode:
|
2008-12-02 17:17:15 +00:00
|
|
|
result = new KhmerOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable, success);
|
2004-12-21 19:15:07 +00:00
|
|
|
break;
|
|
|
|
|
2000-11-14 21:22:14 +00:00
|
|
|
default:
|
2008-12-02 17:17:15 +00:00
|
|
|
result = new OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable, success);
|
2000-11-14 21:22:14 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else {
|
2013-02-07 01:08:41 +00:00
|
|
|
MorphTableHeader2 *morxTable = (MorphTableHeader2 *)fontInstance->getFontTable(morxTableTag);
|
2013-04-18 21:24:51 +00:00
|
|
|
if (morxTable != NULL && SWAPL(morxTable->version)==0x00020000) {
|
2013-02-07 01:08:41 +00:00
|
|
|
result = new GXLayoutEngine2(fontInstance, scriptCode, languageCode, morxTable, typoFlags, success);
|
2013-02-06 07:01:19 +00:00
|
|
|
} else {
|
2013-04-18 21:24:51 +00:00
|
|
|
LEReferenceTo<MorphTableHeader> mortTable(fontInstance, mortTableTag, success);
|
|
|
|
if (LE_SUCCESS(success) && mortTable.isValid() && SWAPL(mortTable->version)==0x00010000) { // mort
|
|
|
|
result = new GXLayoutEngine(fontInstance, scriptCode, languageCode, mortTable, success);
|
2013-02-06 07:01:19 +00:00
|
|
|
} else {
|
|
|
|
switch (scriptCode) {
|
|
|
|
case bengScriptCode:
|
|
|
|
case devaScriptCode:
|
|
|
|
case gujrScriptCode:
|
|
|
|
case kndaScriptCode:
|
|
|
|
case mlymScriptCode:
|
|
|
|
case oryaScriptCode:
|
|
|
|
case guruScriptCode:
|
|
|
|
case tamlScriptCode:
|
|
|
|
case teluScriptCode:
|
|
|
|
case sinhScriptCode:
|
|
|
|
{
|
|
|
|
result = new IndicOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, success);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case arabScriptCode:
|
|
|
|
//case hebrScriptCode:
|
|
|
|
result = new UnicodeArabicOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, success);
|
|
|
|
break;
|
|
|
|
|
|
|
|
//case hebrScriptCode:
|
|
|
|
// return new HebrewOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags);
|
|
|
|
|
|
|
|
case thaiScriptCode:
|
|
|
|
result = new ThaiLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, success);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case hangScriptCode:
|
|
|
|
result = new HangulOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, success);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
result = new LayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, success);
|
|
|
|
break;
|
|
|
|
}
|
2000-11-14 21:22:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-12-02 17:17:15 +00:00
|
|
|
if (result && LE_FAILURE(success)) {
|
2008-10-28 14:50:15 +00:00
|
|
|
delete result;
|
|
|
|
result = NULL;
|
|
|
|
}
|
|
|
|
|
2002-03-27 00:34:56 +00:00
|
|
|
if (result == NULL) {
|
|
|
|
success = LE_MEMORY_ALLOCATION_ERROR;
|
|
|
|
}
|
2000-12-21 01:18:44 +00:00
|
|
|
|
|
|
|
return result;
|
2000-11-14 21:22:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
LayoutEngine::~LayoutEngine() {
|
2005-06-17 00:16:35 +00:00
|
|
|
delete fGlyphStorage;
|
2000-11-14 21:22:14 +00:00
|
|
|
}
|
|
|
|
|
2001-10-16 00:39:01 +00:00
|
|
|
U_NAMESPACE_END
|