os/textandloc/fontservices/textshaperplugin/IcuSource/layout/GlyphLookupTables.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     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