提交 0e0af11c 编写于 作者: B Behdad Esfahbod

[hdmx] Renames

上级 da6aa3b0
...@@ -44,15 +44,15 @@ struct DeviceRecord ...@@ -44,15 +44,15 @@ struct DeviceRecord
struct SubsetView struct SubsetView
{ {
const DeviceRecord *source_device_record; const DeviceRecord *source_device_record;
unsigned int size_device_record; unsigned int sizeDeviceRecord;
hb_subset_plan_t *subset_plan; hb_subset_plan_t *subset_plan;
inline void init(const DeviceRecord *source_device_record, inline void init(const DeviceRecord *source_device_record,
unsigned int size_device_record, unsigned int sizeDeviceRecord,
hb_subset_plan_t *subset_plan) hb_subset_plan_t *subset_plan)
{ {
this->source_device_record = source_device_record; this->source_device_record = source_device_record;
this->size_device_record = size_device_record; this->sizeDeviceRecord = sizeDeviceRecord;
this->subset_plan = subset_plan; this->subset_plan = subset_plan;
} }
...@@ -68,7 +68,7 @@ struct DeviceRecord ...@@ -68,7 +68,7 @@ struct DeviceRecord
const HBUINT8* width = &(this->source_device_record->widthsZ[gid]); const HBUINT8* width = &(this->source_device_record->widthsZ[gid]);
if (width < ((const HBUINT8 *) this->source_device_record) + size_device_record) if (width < ((const HBUINT8 *) this->source_device_record) + sizeDeviceRecord)
return width; return width;
else else
return nullptr; return nullptr;
...@@ -92,8 +92,8 @@ struct DeviceRecord ...@@ -92,8 +92,8 @@ struct DeviceRecord
return_trace (false); return_trace (false);
} }
this->pixel_size.set (subset_view.source_device_record->pixel_size); this->pixelSize.set (subset_view.source_device_record->pixelSize);
this->max_width.set (subset_view.source_device_record->max_width); this->maxWidth.set (subset_view.source_device_record->maxWidth);
for (unsigned int i = 0; i < subset_view.len(); i++) for (unsigned int i = 0; i < subset_view.len(); i++)
{ {
...@@ -109,16 +109,16 @@ struct DeviceRecord ...@@ -109,16 +109,16 @@ struct DeviceRecord
return_trace (true); return_trace (true);
} }
inline bool sanitize (hb_sanitize_context_t *c, unsigned int size_device_record) const inline bool sanitize (hb_sanitize_context_t *c, unsigned int sizeDeviceRecord) const
{ {
TRACE_SANITIZE (this); TRACE_SANITIZE (this);
return_trace (likely (c->check_struct (this) && return_trace (likely (c->check_struct (this) &&
c->check_range (this, size_device_record))); c->check_range (this, sizeDeviceRecord)));
} }
HBUINT8 pixel_size; /* Pixel size for following widths (as ppem). */ HBUINT8 pixelSize; /* Pixel size for following widths (as ppem). */
HBUINT8 max_width; /* Maximum width. */ HBUINT8 maxWidth; /* Maximum width. */
UnsizedArrayOf<HBUINT8> widthsZ; /* Array of widths (numGlyphs is from the 'maxp' table). */ UnsizedArrayOf<HBUINT8> widthsZ; /* Array of widths (numGlyphs is from the 'maxp' table). */
public: public:
DEFINE_SIZE_ARRAY (2, widthsZ); DEFINE_SIZE_ARRAY (2, widthsZ);
}; };
...@@ -130,13 +130,13 @@ struct hdmx ...@@ -130,13 +130,13 @@ struct hdmx
inline unsigned int get_size (void) const inline unsigned int get_size (void) const
{ {
return min_size + num_records * size_device_record; return min_size + numRecords * sizeDeviceRecord;
} }
inline const DeviceRecord& operator [] (unsigned int i) const inline const DeviceRecord& operator [] (unsigned int i) const
{ {
if (unlikely (i >= num_records)) return Null(DeviceRecord); if (unlikely (i >= numRecords)) return Null(DeviceRecord);
return StructAtOffset<DeviceRecord> (&this->dataZ, i * size_device_record); return StructAtOffset<DeviceRecord> (&this->dataZ, i * sizeDeviceRecord);
} }
inline bool serialize (hb_serialize_context_t *c, const hdmx *source_hdmx, hb_subset_plan_t *plan) inline bool serialize (hb_serialize_context_t *c, const hdmx *source_hdmx, hb_subset_plan_t *plan)
...@@ -146,13 +146,13 @@ struct hdmx ...@@ -146,13 +146,13 @@ struct hdmx
if (unlikely (!c->extend_min ((*this)))) return_trace (false); if (unlikely (!c->extend_min ((*this)))) return_trace (false);
this->version.set (source_hdmx->version); this->version.set (source_hdmx->version);
this->num_records.set (source_hdmx->num_records); this->numRecords.set (source_hdmx->numRecords);
this->size_device_record.set (DeviceRecord::get_size (plan->glyphs.len)); this->sizeDeviceRecord.set (DeviceRecord::get_size (plan->glyphs.len));
for (unsigned int i = 0; i < source_hdmx->num_records; i++) for (unsigned int i = 0; i < source_hdmx->numRecords; i++)
{ {
DeviceRecord::SubsetView subset_view; DeviceRecord::SubsetView subset_view;
subset_view.init (&(*source_hdmx)[i], source_hdmx->size_device_record, plan); subset_view.init (&(*source_hdmx)[i], source_hdmx->sizeDeviceRecord, plan);
if (!c->start_embed<DeviceRecord> ()->serialize (c, subset_view)) if (!c->start_embed<DeviceRecord> ()->serialize (c, subset_view))
return_trace (false); return_trace (false);
...@@ -163,7 +163,7 @@ struct hdmx ...@@ -163,7 +163,7 @@ struct hdmx
static inline size_t get_subsetted_size (const hdmx *source_hdmx, hb_subset_plan_t *plan) static inline size_t get_subsetted_size (const hdmx *source_hdmx, hb_subset_plan_t *plan)
{ {
return min_size + source_hdmx->num_records * DeviceRecord::get_size (plan->glyphs.len); return min_size + source_hdmx->numRecords * DeviceRecord::get_size (plan->glyphs.len);
} }
inline bool subset (hb_subset_plan_t *plan) const inline bool subset (hb_subset_plan_t *plan) const
...@@ -201,15 +201,15 @@ struct hdmx ...@@ -201,15 +201,15 @@ struct hdmx
{ {
TRACE_SANITIZE (this); TRACE_SANITIZE (this);
return_trace (c->check_struct (this) && version == 0 && return_trace (c->check_struct (this) && version == 0 &&
!hb_unsigned_mul_overflows (num_records, size_device_record) && !hb_unsigned_mul_overflows (numRecords, sizeDeviceRecord) &&
size_device_record >= DeviceRecord::min_size && sizeDeviceRecord >= DeviceRecord::min_size &&
c->check_range (this, get_size())); c->check_range (this, get_size()));
} }
protected: protected:
HBUINT16 version; /* Table version number (0) */ HBUINT16 version; /* Table version number (0) */
HBUINT16 num_records; /* Number of device records. */ HBUINT16 numRecords; /* Number of device records. */
HBUINT32 size_device_record; /* Size of a device record, 32-bit aligned. */ HBUINT32 sizeDeviceRecord; /* Size of a device record, 32-bit aligned. */
UnsizedArrayOf<HBUINT8> dataZ; /* Array of device records. */ UnsizedArrayOf<HBUINT8> dataZ; /* Array of device records. */
public: public:
DEFINE_SIZE_ARRAY (8, dataZ); DEFINE_SIZE_ARRAY (8, dataZ);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册