• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *
3  * (C) Copyright IBM Corp. 1998-2013 - 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 
13 U_NAMESPACE_BEGIN
14 
coversScript(const LETableReference & base,LETag scriptTag,LEErrorCode & success) const15 le_bool GlyphLookupTableHeader::coversScript(const LETableReference &base, LETag scriptTag, LEErrorCode &success) const
16 {
17   LEReferenceTo<ScriptListTable> scriptListTable(base, success, SWAPW(scriptListOffset));
18 
19   return (scriptListOffset != 0) && scriptListTable->findScript(scriptListTable, scriptTag, success) .isValid();
20 }
21 
coversScriptAndLanguage(const LETableReference & base,LETag scriptTag,LETag languageTag,LEErrorCode & success,le_bool exactMatch) const22 le_bool GlyphLookupTableHeader::coversScriptAndLanguage(const LETableReference &base, LETag scriptTag, LETag languageTag, LEErrorCode &success, le_bool exactMatch) const
23 {
24   LEReferenceTo<ScriptListTable> scriptListTable(base, success, SWAPW(scriptListOffset));
25   LEReferenceTo<LangSysTable> langSysTable = scriptListTable->findLanguage(scriptListTable,
26                                     scriptTag, languageTag, success, exactMatch);
27 
28     // FIXME: could check featureListOffset, lookupListOffset, and lookup count...
29     // Note: don't have to SWAPW langSysTable->featureCount to check for non-zero.
30   return LE_SUCCESS(success)&&langSysTable.isValid() && langSysTable->featureCount != 0;
31 }
32 
33 U_NAMESPACE_END
34