ICU-3512 Restructure types so that GPOS tables can do coversScript and coversScriptAndLanguage.

X-SVN-Rev: 14525
This commit is contained in:
Eric Mader 2004-02-14 01:09:08 +00:00
parent c756188308
commit 7cd6ecea23
6 changed files with 70 additions and 29 deletions

View File

@ -0,0 +1,30 @@
/*
* %W% %E%
*
* (C) Copyright IBM Corp. 1998-2003 - All Rights Reserved
*
*/
#include "LETypes.h"
#include "OpenTypeTables.h"
#include "ScriptAndLanguage.h"
#include "GlyphLookupTables.h"
#include "LESwaps.h"
U_NAMESPACE_BEGIN
le_bool GlyphLookupTableHeader::coversScript(LETag scriptTag) const
{
const ScriptListTable *scriptListTable = (const ScriptListTable *) ((char *)this + SWAPW(scriptListOffset));
return scriptListTable->findScript(scriptTag) != NULL;
}
le_bool GlyphLookupTableHeader::coversScriptAndLanguage(LETag scriptTag, LETag languageTag) const
{
const ScriptListTable *scriptListTable = (const ScriptListTable *) ((char *)this + SWAPW(scriptListOffset));
return scriptListTable->findLanguage(scriptTag, languageTag, TRUE) != NULL;
}
U_NAMESPACE_END

View File

@ -0,0 +1,35 @@
/*
* %W% %E%
*
* (C) Copyright IBM Corp. 1998-2003 - All Rights Reserved
*
*/
#ifndef __GLYPHLOOKUPTABLES_H
#define __GLYPHLOOKUPTABLES_H
/**
* \file
* \internal
*/
#include "LETypes.h"
#include "OpenTypeTables.h"
U_NAMESPACE_BEGIN
struct GlyphLookupTableHeader
{
fixed32 version;
Offset scriptListOffset;
Offset featureListOffset;
Offset lookupListOffset;
le_bool coversScript(LETag scriptTag) const;
le_bool coversScriptAndLanguage(LETag scriptTag, LETag languageTag) const;
};
U_NAMESPACE_END
#endif

View File

@ -17,18 +17,14 @@
#include "LEFontInstance.h"
#include "OpenTypeTables.h"
#include "Lookups.h"
#include "GlyphLookupTables.h"
#include "GlyphDefinitionTables.h"
#include "GlyphPositionAdjustments.h"
U_NAMESPACE_BEGIN
struct GlyphPositioningTableHeader
struct GlyphPositioningTableHeader : public GlyphLookupTableHeader
{
fixed32 version;
Offset scriptListOffset;
Offset featureListOffset;
Offset lookupListOffset;
void process(LEGlyphID *glyphs, GlyphPositionAdjustment *glyphPositionAdjustments,
const LETag **glyphTags, le_int32 glyphCount,
le_bool rightToLeft, LETag scriptTag, LETag languageTag,

View File

@ -28,18 +28,4 @@ le_int32 GlyphSubstitutionTableHeader::process(LEGlyphID *&glyphs, const LETag *
return processor.process(glyphs, NULL, glyphTags, charIndices, glyphCount, rightToLeft, glyphDefinitionTableHeader, NULL);
}
le_bool GlyphSubstitutionTableHeader::coversScript(LETag scriptTag) const
{
const ScriptListTable *scriptListTable = (const ScriptListTable *) ((char *)this + SWAPW(scriptListOffset));
return scriptListTable->findScript(scriptTag) != NULL;
}
le_bool GlyphSubstitutionTableHeader::coversScriptAndLanguage(LETag scriptTag, LETag languageTag) const
{
const ScriptListTable *scriptListTable = (const ScriptListTable *) ((char *)this + SWAPW(scriptListOffset));
return scriptListTable->findLanguage(scriptTag, languageTag, TRUE) != NULL;
}
U_NAMESPACE_END

View File

@ -17,25 +17,18 @@
#include "LEGlyphFilter.h"
#include "OpenTypeTables.h"
#include "Lookups.h"
#include "GlyphLookupTables.h"
#include "GlyphDefinitionTables.h"
#include "GlyphPositionAdjustments.h"
U_NAMESPACE_BEGIN
struct GlyphSubstitutionTableHeader
struct GlyphSubstitutionTableHeader : public GlyphLookupTableHeader
{
fixed32 version;
Offset scriptListOffset;
Offset featureListOffset;
Offset lookupListOffset;
le_int32 process(LEGlyphID *&glyphs, const LETag **&glyphTags, le_int32 *&charIndices, le_int32 glyphCount,
le_bool rightToLeft, LETag scriptTag, LETag languageTag,
const GlyphDefinitionTableHeader *glyphDefinitionTableHeader,
const LEGlyphFilter *filter = NULL, const LETag *featureOrder = NULL) const;
le_bool coversScript(LETag scriptTag) const;
le_bool coversScriptAndLanguage(LETag scriptTag, LETag languageTag) const;
};
enum GlyphSubstitutionSubtableTypes

View File

@ -87,6 +87,7 @@ Features.o \
GDEFMarkFilter.o \
GlyphDefinitionTables.o \
GlyphIterator.o \
GlyphLookupTables.o \
GlyphPosnLookupProc.o \
GlyphPositioningTables.o \
GlyphSubstLookupProc.o \