]> git.saurik.com Git - apple/icu.git/blame - icuSources/layout/GlyphLookupTables.cpp
ICU-59180.0.1.tar.gz
[apple/icu.git] / icuSources / layout / GlyphLookupTables.cpp
CommitLineData
374ca955
A
1/*
2 *
57a6839d 3 * (C) Copyright IBM Corp. 1998-2013 - All Rights Reserved
374ca955
A
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
57a6839d 15le_bool GlyphLookupTableHeader::coversScript(const LETableReference &base, LETag scriptTag, LEErrorCode &success) const
374ca955 16{
57a6839d 17 LEReferenceTo<ScriptListTable> scriptListTable(base, success, SWAPW(scriptListOffset));
374ca955 18
57a6839d 19 return (scriptListOffset != 0) && scriptListTable->findScript(scriptListTable, scriptTag, success) .isValid();
374ca955
A
20}
21
57a6839d 22le_bool GlyphLookupTableHeader::coversScriptAndLanguage(const LETableReference &base, LETag scriptTag, LETag languageTag, LEErrorCode &success, le_bool exactMatch) const
374ca955 23{
57a6839d
A
24 LEReferenceTo<ScriptListTable> scriptListTable(base, success, SWAPW(scriptListOffset));
25 LEReferenceTo<LangSysTable> langSysTable = scriptListTable->findLanguage(scriptListTable,
26 scriptTag, languageTag, success, exactMatch);
374ca955
A
27
28 // FIXME: could check featureListOffset, lookupListOffset, and lookup count...
29 // Note: don't have to SWAPW langSysTable->featureCount to check for non-zero.
57a6839d 30 return LE_SUCCESS(success)&&langSysTable.isValid() && langSysTable->featureCount != 0;
374ca955
A
31}
32
33U_NAMESPACE_END