summaryrefslogtreecommitdiff
path: root/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hdmx-table.hh
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2019-05-03 05:32:57 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2019-05-03 05:32:57 +0000
commit4cf2fa9da8208e0acd6dc5ea497a813f0c403769 (patch)
tree27f07bcff4492739b23e3aff8c0de7ea67f5b95d /Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hdmx-table.hh
parente203cb2b40427e96c870fbbe5c176b3cf17975f4 (diff)
harfbuzz-2.4.0
git-svn-id: svn://tug.org/texlive/trunk@50963 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hdmx-table.hh')
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hdmx-table.hh19
1 files changed, 11 insertions, 8 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hdmx-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hdmx-table.hh
index 95229c523b7..953ccab80ef 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hdmx-table.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hdmx-table.hh
@@ -57,16 +57,19 @@ struct DeviceRecord
}
unsigned int len () const
- { return this->subset_plan->glyphs.length; }
+ { return this->subset_plan->num_output_glyphs (); }
- const HBUINT8* operator [] (unsigned int i) const
+ const HBUINT8* operator [] (unsigned int new_gid) const
{
- if (unlikely (i >= len ())) return nullptr;
- hb_codepoint_t gid = this->subset_plan->glyphs [i];
+ if (unlikely (new_gid >= len ())) return nullptr;
- if (gid >= sizeDeviceRecord - DeviceRecord::min_size)
+ hb_codepoint_t old_gid;
+ if (!this->subset_plan->old_gid_for_new_gid (new_gid, &old_gid))
+ return &Null(HBUINT8);
+
+ if (old_gid >= sizeDeviceRecord - DeviceRecord::min_size)
return nullptr;
- return &(this->source_device_record->widthsZ[gid]);
+ return &(this->source_device_record->widthsZ[old_gid]);
}
};
@@ -140,7 +143,7 @@ struct hdmx
this->version.set (source_hdmx->version);
this->numRecords.set (source_hdmx->numRecords);
- this->sizeDeviceRecord.set (DeviceRecord::get_size (plan->glyphs.length));
+ this->sizeDeviceRecord.set (DeviceRecord::get_size (plan->num_output_glyphs ()));
for (unsigned int i = 0; i < source_hdmx->numRecords; i++)
{
@@ -156,7 +159,7 @@ struct hdmx
static size_t get_subsetted_size (const hdmx *source_hdmx, hb_subset_plan_t *plan)
{
- return min_size + source_hdmx->numRecords * DeviceRecord::get_size (plan->glyphs.length);
+ return min_size + source_hdmx->numRecords * DeviceRecord::get_size (plan->num_output_glyphs ());
}
bool subset (hb_subset_plan_t *plan) const