Home | History | Annotate | Download | only in layout
      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 
     13 U_NAMESPACE_BEGIN
     14 
     15 le_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 
     22 le_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 
     32 U_NAMESPACE_END
     33