summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/harfbuzz-ng/src/hb-ot-var-mvar-table.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/harfbuzz-ng/src/hb-ot-var-mvar-table.hh')
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-var-mvar-table.hh41
1 files changed, 22 insertions, 19 deletions
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-var-mvar-table.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-var-mvar-table.hh
index e17ff5160a..5a9d2afb7c 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-var-mvar-table.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-var-mvar-table.hh
@@ -27,7 +27,7 @@
#ifndef HB_OT_VAR_MVAR_TABLE_HH
#define HB_OT_VAR_MVAR_TABLE_HH
-#include "hb-ot-layout-common-private.hh"
+#include "hb-ot-layout-common.hh"
namespace OT {
@@ -35,7 +35,7 @@ namespace OT {
struct VariationValueRecord
{
- inline bool sanitize (hb_sanitize_context_t *c) const
+ bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
return_trace (c->check_struct (this));
@@ -43,7 +43,7 @@ struct VariationValueRecord
public:
Tag valueTag; /* Four-byte tag identifying a font-wide measure. */
- UINT32 varIdx; /* Outer/inner index into VariationStore item. */
+ HBUINT32 varIdx; /* Outer/inner index into VariationStore item. */
public:
DEFINE_SIZE_STATIC (8);
@@ -51,16 +51,16 @@ struct VariationValueRecord
/*
- * MVAR -- Metrics Variations Table
+ * MVAR -- Metrics Variations
+ * https://docs.microsoft.com/en-us/typography/opentype/spec/mvar
*/
-
#define HB_OT_TAG_MVAR HB_TAG('M','V','A','R')
struct MVAR
{
- static const hb_tag_t tableTag = HB_OT_TAG_MVAR;
+ static constexpr hb_tag_t tableTag = HB_OT_TAG_MVAR;
- inline bool sanitize (hb_sanitize_context_t *c) const
+ bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
return_trace (version.sanitize (c) &&
@@ -68,16 +68,18 @@ struct MVAR
c->check_struct (this) &&
valueRecordSize >= VariationValueRecord::static_size &&
varStore.sanitize (c, this) &&
- c->check_array (values, valueRecordSize, valueRecordCount));
+ c->check_range (valuesZ.arrayZ,
+ valueRecordCount,
+ valueRecordSize));
}
- inline float get_var (hb_tag_t tag,
- int *coords, unsigned int coord_count) const
+ float get_var (hb_tag_t tag,
+ const int *coords, unsigned int coord_count) const
{
const VariationValueRecord *record;
- record = (VariationValueRecord *) bsearch (&tag, values,
- valueRecordCount, valueRecordSize,
- tag_compare);
+ record = (VariationValueRecord *) hb_bsearch (&tag, valuesZ.arrayZ,
+ valueRecordCount, valueRecordSize,
+ tag_compare);
if (!record)
return 0.;
@@ -85,7 +87,7 @@ struct MVAR
}
protected:
- static inline int tag_compare (const void *pa, const void *pb)
+ static int tag_compare (const void *pa, const void *pb)
{
const hb_tag_t *a = (const hb_tag_t *) pa;
const Tag *b = (const Tag *) pb;
@@ -95,17 +97,18 @@ protected:
protected:
FixedVersion<>version; /* Version of the metrics variation table
* initially set to 0x00010000u */
- UINT16 reserved; /* Not used; set to 0. */
- UINT16 valueRecordSize;/* The size in bytes of each value record —
+ HBUINT16 reserved; /* Not used; set to 0. */
+ HBUINT16 valueRecordSize;/* The size in bytes of each value record —
* must be greater than zero. */
- UINT16 valueRecordCount;/* The number of value records — may be zero. */
+ HBUINT16 valueRecordCount;/* The number of value records — may be zero. */
OffsetTo<VariationStore>
varStore; /* Offset to item variation store table. */
- UINT8 values[VAR]; /* Array of value records. The records must be
+ UnsizedArrayOf<HBUINT8>
+ valuesZ; /* Array of value records. The records must be
* in binary order of their valueTag field. */
public:
- DEFINE_SIZE_ARRAY (12, values);
+ DEFINE_SIZE_ARRAY (12, valuesZ);
};
} /* namespace OT */