]> git.saurik.com Git - apple/icu.git/blame - icuSources/layout/GlyphLookupTables.cpp
ICU-511.34.tar.gz
[apple/icu.git] / icuSources / layout / GlyphLookupTables.cpp
CommitLineData
374ca955
A
1/*
2 *
3 * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved
4 *
5 */
6
7#include "LETypes.h"
8#include "OpenTypeTables.h"
9#include "ScriptAndLanguage.h"
10#include "GlyphLookupTables.h"
11#include "LESwaps.h"
12
13U_NAMESPACE_BEGIN
14
15le_bool GlyphLookupTableHeader::coversScript(LETag scriptTag) const
16{
17 const ScriptListTable *scriptListTable = (const ScriptListTable *) ((char *)this + SWAPW(scriptListOffset));
18
19 return scriptListOffset != 0 && scriptListTable->findScript(scriptTag) != NULL;
20}
21
22le_bool GlyphLookupTableHeader::coversScriptAndLanguage(LETag scriptTag, LETag languageTag, le_bool exactMatch) const
23{
24 const ScriptListTable *scriptListTable = (const ScriptListTable *) ((char *)this + SWAPW(scriptListOffset));
25 const LangSysTable *langSysTable = scriptListTable->findLanguage(scriptTag, languageTag, exactMatch);
26
27 // FIXME: could check featureListOffset, lookupListOffset, and lookup count...
28 // Note: don't have to SWAPW langSysTable->featureCount to check for non-zero.
29 return langSysTable != NULL && langSysTable->featureCount != 0;
30}
31
32U_NAMESPACE_END