GlyphPosnLookupProc.cpp revision 2362
0N/A/*
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A *
0N/A */
0N/A
0N/A/*
0N/A * (C) Copyright IBM Corp. 1998 - 2005 - All Rights Reserved
0N/A *
0N/A */
0N/A
0N/A#include "LETypes.h"
0N/A#include "LEFontInstance.h"
0N/A#include "OpenTypeTables.h"
0N/A#include "Features.h"
0N/A#include "Lookups.h"
0N/A#include "ScriptAndLanguage.h"
0N/A#include "GlyphDefinitionTables.h"
0N/A#include "GlyphPositioningTables.h"
0N/A#include "SinglePositioningSubtables.h"
0N/A#include "PairPositioningSubtables.h"
0N/A#include "CursiveAttachmentSubtables.h"
0N/A#include "MarkToBasePosnSubtables.h"
0N/A#include "MarkToLigaturePosnSubtables.h"
0N/A#include "MarkToMarkPosnSubtables.h"
0N/A//#include "ContextualPositioningSubtables.h"
0N/A#include "ContextualSubstSubtables.h"
0N/A#include "ExtensionSubtables.h"
0N/A#include "LookupProcessor.h"
0N/A#include "GlyphPosnLookupProc.h"
0N/A#include "LESwaps.h"
0N/A
1693N/AU_NAMESPACE_BEGIN
1693N/A
0N/A// Aside from the names, the contextual positioning subtables are
0N/A// the same as the contextual substitution subtables.
0N/Atypedef ContextualSubstitutionSubtable ContextualPositioningSubtable;
0N/Atypedef ChainingContextualSubstitutionSubtable ChainingContextualPositioningSubtable;
0N/A
0N/AGlyphPositioningLookupProcessor::GlyphPositioningLookupProcessor(
0N/A const GlyphPositioningTableHeader *glyphPositioningTableHeader,
1693N/A LETag scriptTag, LETag languageTag, const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder)
0N/A : LookupProcessor(
0N/A (char *) glyphPositioningTableHeader,
0N/A SWAPW(glyphPositioningTableHeader->scriptListOffset),
0N/A SWAPW(glyphPositioningTableHeader->featureListOffset),
0N/A SWAPW(glyphPositioningTableHeader->lookupListOffset),
0N/A scriptTag, languageTag, featureMap, featureMapCount, featureOrder)
0N/A{
0N/A // anything?
0N/A}
0N/A
0N/AGlyphPositioningLookupProcessor::GlyphPositioningLookupProcessor()
0N/A{
0N/A}
0N/A
0N/Ale_uint32 GlyphPositioningLookupProcessor::applySubtable(const LookupSubtable *lookupSubtable, le_uint16 lookupType,
0N/A GlyphIterator *glyphIterator,
0N/A const LEFontInstance *fontInstance) const
0N/A{
0N/A le_uint32 delta = 0;
0N/A
0N/A switch(lookupType)
0N/A {
0N/A case 0:
0N/A break;
0N/A
0N/A case gpstSingle:
0N/A {
0N/A const SinglePositioningSubtable *subtable = (const SinglePositioningSubtable *) lookupSubtable;
0N/A
0N/A delta = subtable->process(glyphIterator, fontInstance);
0N/A break;
0N/A }
0N/A
0N/A case gpstPair:
0N/A {
0N/A const PairPositioningSubtable *subtable = (const PairPositioningSubtable *) lookupSubtable;
0N/A
0N/A delta = subtable->process(glyphIterator, fontInstance);
0N/A break;
0N/A }
0N/A
0N/A case gpstCursive:
0N/A {
0N/A const CursiveAttachmentSubtable *subtable = (const CursiveAttachmentSubtable *) lookupSubtable;
0N/A
0N/A delta = subtable->process(glyphIterator, fontInstance);
0N/A break;
0N/A }
0N/A
0N/A case gpstMarkToBase:
0N/A {
0N/A const MarkToBasePositioningSubtable *subtable = (const MarkToBasePositioningSubtable *) lookupSubtable;
0N/A
0N/A delta = subtable->process(glyphIterator, fontInstance);
0N/A break;
0N/A }
0N/A
0N/A case gpstMarkToLigature:
0N/A {
0N/A const MarkToLigaturePositioningSubtable *subtable = (const MarkToLigaturePositioningSubtable *) lookupSubtable;
0N/A
0N/A delta = subtable->process(glyphIterator, fontInstance);
0N/A break;
0N/A }
0N/A
0N/A case gpstMarkToMark:
0N/A {
0N/A const MarkToMarkPositioningSubtable *subtable = (const MarkToMarkPositioningSubtable *) lookupSubtable;
0N/A
0N/A delta = subtable->process(glyphIterator, fontInstance);
0N/A break;
0N/A }
0N/A
0N/A case gpstContext:
0N/A {
0N/A const ContextualPositioningSubtable *subtable = (const ContextualPositioningSubtable *) lookupSubtable;
0N/A
0N/A delta = subtable->process(this, glyphIterator, fontInstance);
0N/A break;
0N/A }
0N/A
0N/A case gpstChainedContext:
0N/A {
0N/A const ChainingContextualPositioningSubtable *subtable = (const ChainingContextualPositioningSubtable *) lookupSubtable;
0N/A
0N/A delta = subtable->process(this, glyphIterator, fontInstance);
0N/A break;
0N/A }
0N/A
0N/A case gpstExtension:
0N/A {
0N/A const ExtensionSubtable *subtable = (const ExtensionSubtable *) lookupSubtable;
0N/A
0N/A delta = subtable->process(this, lookupType, glyphIterator, fontInstance);
0N/A break;
0N/A }
0N/A
0N/A default:
0N/A break;
0N/A }
0N/A
0N/A return delta;
0N/A}
0N/A
0N/AGlyphPositioningLookupProcessor::~GlyphPositioningLookupProcessor()
0N/A{
0N/A}
1693N/A
1693N/AU_NAMESPACE_END