renamed CFF::Index to CFF::CFFIndex
to avoid confusion with OT::Index
diff --git a/src/hb-ot-cff-common-private.hh b/src/hb-ot-cff-common-private.hh
index a526295..e22ee87 100644
--- a/src/hb-ot-cff-common-private.hh
+++ b/src/hb-ot-cff-common-private.hh
@@ -54,7 +54,7 @@
/* CFF INDEX */
template <typename COUNT>
-struct Index
+struct CFFIndex
{
inline bool sanitize (hb_sanitize_context_t *c) const
{
@@ -73,11 +73,11 @@
inline static unsigned int calculate_serialized_size (unsigned int offSize, unsigned int count, unsigned int dataSize)
{ return min_size + calculate_offset_array_size (offSize, count) + dataSize; }
- inline bool serialize (hb_serialize_context_t *c, const Index &src)
+ inline bool serialize (hb_serialize_context_t *c, const CFFIndex &src)
{
TRACE_SERIALIZE (this);
unsigned int size = src.get_size ();
- Index *dest = c->allocate_size<Index> (size);
+ CFFIndex *dest = c->allocate_size<CFFIndex> (size);
if (unlikely (dest == nullptr)) return_trace (false);
memcpy (dest, &src, size);
return_trace (true);
@@ -88,7 +88,7 @@
const hb_vector_t<ByteStr> &byteArray)
{
TRACE_SERIALIZE (this);
- /* serialize Index header */
+ /* serialize CFFIndex header */
if (unlikely (!c->extend_min (*this))) return_trace (false);
this->count.set (byteArray.len);
this->offSize.set (offSize_);
@@ -158,12 +158,12 @@
inline unsigned int get_size (void) const
{
- if (this != &Null(Index))
+ if (this != &Null(CFFIndex))
{
if (count > 0)
return min_size + offset_array_size () + (offset_at (count) - 1);
else
- return count.static_size; /* empty Index contains count only */
+ return count.static_size; /* empty CFFIndex contains count only */
}
else
return 0;
@@ -191,12 +191,12 @@
};
template <typename COUNT, typename TYPE>
-struct IndexOf : Index<COUNT>
+struct IndexOf : CFFIndex<COUNT>
{
inline const ByteStr operator [] (unsigned int index) const
{
- if (likely (index < Index<COUNT>::count))
- return ByteStr (Index<COUNT>::data_base () + Index<COUNT>::offset_at (index) - 1, Index<COUNT>::length_at (index));
+ if (likely (index < CFFIndex<COUNT>::count))
+ return ByteStr (CFFIndex<COUNT>::data_base () + CFFIndex<COUNT>::offset_at (index) - 1, CFFIndex<COUNT>::length_at (index));
return Null(ByteStr);
}
@@ -209,7 +209,7 @@
const PARAM2 ¶m2)
{
TRACE_SERIALIZE (this);
- /* serialize Index header */
+ /* serialize CFFIndex header */
if (unlikely (!c->extend_min (*this))) return_trace (false);
this->count.set (dataArray.len);
this->offSize.set (offSize_);
@@ -221,10 +221,10 @@
unsigned int i = 0;
for (; i < dataArray.len; i++)
{
- Index<COUNT>::set_offset_at (i, offset);
+ CFFIndex<COUNT>::set_offset_at (i, offset);
offset += dataSizeArray[i];
}
- Index<COUNT>::set_offset_at (i, offset);
+ CFFIndex<COUNT>::set_offset_at (i, offset);
/* serialize data */
for (unsigned int i = 0; i < dataArray.len; i++)
@@ -254,7 +254,7 @@
}
offSize_ = calcOffSize (totalDataSize);
- return Index<COUNT>::calculate_serialized_size (offSize_, dataArray.len, totalDataSize);
+ return CFFIndex<COUNT>::calculate_serialized_size (offSize_, dataArray.len, totalDataSize);
}
};
@@ -407,7 +407,7 @@
dictsSize += FontDict::calculate_serialized_size (fontDicts[i], opszr);
offSize_ = calcOffSize (dictsSize + 1);
- return Index<COUNT>::calculate_serialized_size (offSize_, fdCount, dictsSize);
+ return CFFIndex<COUNT>::calculate_serialized_size (offSize_, fdCount, dictsSize);
}
};
@@ -552,7 +552,7 @@
};
template <typename COUNT>
-struct Subrs : Index<COUNT>
+struct Subrs : CFFIndex<COUNT>
{
inline bool serialize (hb_serialize_context_t *c, const Subrs<COUNT> &subrs, unsigned int offSize, const hb_set_t *set, const ByteStr& nullStr = ByteStr())
{
@@ -561,7 +561,7 @@
{
if (!unlikely (c->allocate_size<COUNT> (COUNT::static_size)))
return_trace (false);
- Index<COUNT>::count.set (0);
+ CFFIndex<COUNT>::count.set (0);
return_trace (true);
}
@@ -572,7 +572,7 @@
for (hb_codepoint_t i = 0; i < subrs.count; i++)
bytesArray[i] = (hb_set_has (set, i))? subrs[i]: nullStr;
- bool result = Index<COUNT>::serialize (c, offSize, bytesArray);
+ bool result = CFFIndex<COUNT>::serialize (c, offSize, bytesArray);
bytesArray.fini ();
return_trace (result);
}
@@ -580,7 +580,7 @@
/* in parallel to above */
inline unsigned int calculate_serialized_size (unsigned int &offSize /*OUT*/, const hb_set_t *set, unsigned int nullStrSize = 0) const
{
- unsigned int count_ = Index<COUNT>::count;
+ unsigned int count_ = CFFIndex<COUNT>::count;
offSize = 0;
if ((count_ == 0) || (hb_set_get_population (set) == 0))
return COUNT::static_size;
@@ -594,7 +594,7 @@
dataSize += nullStrSize;
}
offSize = calcOffSize(dataSize);
- return Index<COUNT>::calculate_serialized_size (offSize, count_, dataSize);
+ return CFFIndex<COUNT>::calculate_serialized_size (offSize, count_, dataSize);
}
};
diff --git a/src/hb-ot-cff1-table.hh b/src/hb-ot-cff1-table.hh
index b794bba..f2a255c 100644
--- a/src/hb-ot-cff1-table.hh
+++ b/src/hb-ot-cff1-table.hh
@@ -38,10 +38,10 @@
*/
#define HB_OT_TAG_cff1 HB_TAG('C','F','F',' ')
-typedef Index<HBUINT16> CFF1Index;
+typedef CFFIndex<HBUINT16> CFF1Index;
template <typename Type> struct CFF1IndexOf : IndexOf<HBUINT16, Type> {};
-typedef Index<HBUINT16> CFF1Index;
+typedef CFFIndex<HBUINT16> CFF1Index;
typedef CFF1Index CFF1CharStrings;
typedef FDArray<HBUINT16> CFF1FDArray;
typedef Subrs<HBUINT16> CFF1Subrs;
diff --git a/src/hb-ot-cff2-table.hh b/src/hb-ot-cff2-table.hh
index 71e00c4..f5d356d 100644
--- a/src/hb-ot-cff2-table.hh
+++ b/src/hb-ot-cff2-table.hh
@@ -38,7 +38,7 @@
*/
#define HB_OT_TAG_cff2 HB_TAG('C','F','F','2')
-typedef Index<HBUINT32> CFF2Index;
+typedef CFFIndex<HBUINT32> CFF2Index;
template <typename Type> struct CFF2IndexOf : IndexOf<HBUINT32, Type> {};
typedef CFF2Index CFF2CharStrings;
diff --git a/src/hb-subset-cff2.cc b/src/hb-subset-cff2.cc
index 4f865d6..7835523 100644
--- a/src/hb-subset-cff2.cc
+++ b/src/hb-subset-cff2.cc
@@ -312,7 +312,7 @@
assert (cff2->topDict + plan.offsets.topDictSize == c.head - c.start);
CFF2Subrs *dest = c.start_embed<CFF2Subrs> ();
if (unlikely (dest == nullptr)) return false;
- CFF::Index<HBUINT32> *super = dest;
+ CFFIndex<HBUINT32> *super = dest;
if (unlikely (!super->serialize (&c, *acc.globalSubrs)))
{
DEBUG_MSG (SUBSET, nullptr, "failed to serialize CFF2 global subrs");
@@ -409,7 +409,7 @@
DEBUG_MSG (SUBSET, nullptr, "CFF2 subset: local subrs unexpectedly null [%d]", i);
return false;
}
- CFF::Index<HBUINT32> *super = subrs;
+ CFFIndex<HBUINT32> *super = subrs;
if (unlikely (!super->serialize (&c, *acc.privateDicts[i].localSubrs)))
{
DEBUG_MSG (SUBSET, nullptr, "failed to serialize CFF2 local subrs [%d]", i);