ICU-1067 Initial implementation of extension lookup, positioning subtables.

X-SVN-Rev: 10798
This commit is contained in:
Eric Mader 2002-12-30 19:53:40 +00:00
parent 926a4753fd
commit 7c66725001
7 changed files with 96 additions and 2 deletions

View File

@ -0,0 +1,35 @@
/*
* %W% %E%
*
* (C) Copyright IBM Corp. 2002 - All Rights Reserved
*
*/
#include "LETypes.h"
#include "OpenTypeTables.h"
#include "GlyphSubstitutionTables.h"
#include "LookupProcessor.h"
#include "ExtensionSubtables.h"
#include "GlyphIterator.h"
#include "LESwaps.h"
U_NAMESPACE_BEGIN
// FIXME: should look at the format too... maybe have a sub-class for it?
le_uint32 ExtensionSubtable::process(const LookupProcessor *lookupProcessor, le_uint16 lookupType,
GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const
{
le_uint16 elt = SWAPW(extensionLookupType);
if (elt != lookupType) {
le_uint32 extOffset = SWAPL(extensionOffset);
LookupSubtable *subtable = (LookupSubtable *) ((char *) this + extOffset);
return lookupProcessor->applySubtable(subtable, elt, glyphIterator, fontInstance);
}
return 0;
}
U_NAMESPACE_END

View File

@ -0,0 +1,30 @@
/*
* %W% %E%
*
* (C) Copyright IBM Corp. 2002 - All Rights Reserved
*
*/
#ifndef __EXTENSIONSUBTABLES_H
#define __EXTENSIONSUBTABLES_H
#include "LETypes.h"
#include "OpenTypeTables.h"
#include "GlyphSubstitutionTables.h"
#include "LookupProcessor.h"
#include "GlyphIterator.h"
U_NAMESPACE_BEGIN
struct ExtensionSubtable //: GlyphSubstitutionSubtable
{
le_uint16 substFormat;
le_uint16 extensionLookupType;
le_uint32 extensionOffset;
le_uint32 process(const LookupProcessor *lookupProcessor, le_uint16 lookupType,
GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const;
};
U_NAMESPACE_END
#endif

View File

@ -40,7 +40,8 @@ enum GlyphPositioningSubtableTypes
gpstMarkToLigature = 5,
gpstMarkToMark = 6,
gpstContext = 7,
gpstChainedContext = 8
gpstChainedContext = 8,
gpstExtension = 9
};
typedef LookupSubtable GlyphPositioningSubtable;

View File

@ -21,6 +21,7 @@
#include "MarkToMarkPosnSubtables.h"
//#include "ContextualPositioningSubtables.h"
#include "ContextualSubstSubtables.h"
#include "ExtensionSubtables.h"
#include "LookupProcessor.h"
#include "GlyphPosnLookupProc.h"
#include "LESwaps.h"
@ -124,6 +125,14 @@ le_uint32 GlyphPositioningLookupProcessor::applySubtable(const LookupSubtable *l
break;
}
case gpstExtension:
{
const ExtensionSubtable *subtable = (const ExtensionSubtable *) lookupSubtable;
delta = subtable->process(this, lookupType, glyphIterator, fontInstance);
break;
}
default:
break;
}

View File

@ -19,6 +19,7 @@
#include "AlternateSubstSubtables.h"
#include "LigatureSubstSubtables.h"
#include "ContextualSubstSubtables.h"
#include "ExtensionSubtables.h"
#include "LookupProcessor.h"
#include "GlyphSubstLookupProc.h"
#include "LESwaps.h"
@ -100,6 +101,14 @@ le_uint32 GlyphSubstitutionLookupProcessor::applySubtable(const LookupSubtable *
break;
}
case gsstExtension:
{
const ExtensionSubtable *subtable = (const ExtensionSubtable *) lookupSubtable;
delta = subtable->process(this, lookupType, glyphIterator, fontInstance);
break;
}
default:
break;
}

View File

@ -39,7 +39,9 @@ enum GlyphSubstitutionSubtableTypes
gsstAlternate = 3,
gsstLigature = 4,
gsstContext = 5,
gsstChainingContext = 6
gsstChainingContext = 6,
gsstExtension = 7,
gsstReverseChaining = 8
};
typedef LookupSubtable GlyphSubstitutionSubtable;

View File

@ -194,6 +194,10 @@ SOURCE=.\DeviceTables.cpp
# End Source File
# Begin Source File
SOURCE=.\ExtensionSubtables.cpp
# End Source File
# Begin Source File
SOURCE=.\Features.cpp
# End Source File
# Begin Source File
@ -446,6 +450,10 @@ SOURCE=.\DeviceTables.h
# End Source File
# Begin Source File
SOURCE=.\ExtensionSubtables.h
# End Source File
# Begin Source File
SOURCE=.\Features.h
# End Source File
# Begin Source File