ICU-3512 Restructure types so that GPOS tables can do coversScript and coversScriptAndLanguage.
X-SVN-Rev: 14525
This commit is contained in:
parent
c756188308
commit
7cd6ecea23
30
icu4c/source/layout/GlyphLookupTables.cpp
Normal file
30
icu4c/source/layout/GlyphLookupTables.cpp
Normal 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
|
35
icu4c/source/layout/GlyphLookupTables.h
Normal file
35
icu4c/source/layout/GlyphLookupTables.h
Normal 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
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -87,6 +87,7 @@ Features.o \
|
||||
GDEFMarkFilter.o \
|
||||
GlyphDefinitionTables.o \
|
||||
GlyphIterator.o \
|
||||
GlyphLookupTables.o \
|
||||
GlyphPosnLookupProc.o \
|
||||
GlyphPositioningTables.o \
|
||||
GlyphSubstLookupProc.o \
|
||||
|
Loading…
Reference in New Issue
Block a user