Home | History | Annotate | Download | only in layout
      1 /*
      2  *
      3  * (C) Copyright IBM Corp. 1998-2013 - All Rights Reserved
      4  *
      5  */
      6 
      7 #ifndef __OPENTYPEUTILITIES_H
      8 #define __OPENTYPEUTILITIES_H
      9 
     10 /**
     11  * \file
     12  * \internal
     13  */
     14 
     15 #include "LETypes.h"
     16 #include "OpenTypeTables.h"
     17 
     18 U_NAMESPACE_BEGIN
     19 
     20 class OpenTypeUtilities /* not : public UObject because all methods are static */ {
     21 public:
     22     static le_int8 highBit(le_int32 value);
     23     static Offset getTagOffset(LETag tag, const LEReferenceToArrayOf<TagAndOffsetRecord> &records, LEErrorCode &success);
     24     static le_int32 getGlyphRangeIndex(TTGlyphID glyphID, const GlyphRangeRecord *records, le_int32 recordCount) {
     25       LEErrorCode success = LE_NO_ERROR;
     26       LETableReference recordRef0((const le_uint8*)records);
     27       LEReferenceToArrayOf<GlyphRangeRecord> recordRef(recordRef0, success, (size_t)0, recordCount);
     28       return getGlyphRangeIndex(glyphID, recordRef, success);
     29     }
     30     static le_int32 getGlyphRangeIndex(TTGlyphID glyphID, const LEReferenceToArrayOf<GlyphRangeRecord> &records, LEErrorCode &success);
     31     static le_int32 search(le_uint16 value, const le_uint16 array[], le_int32 count);
     32     static le_int32 search(le_uint32 value, const le_uint32 array[], le_int32 count);
     33     static void sort(le_uint16 *array, le_int32 count);
     34 
     35 private:
     36     OpenTypeUtilities() {} // private - forbid instantiation
     37 };
     38 
     39 U_NAMESPACE_END
     40 #endif
     41